Skip to content

Commit

Permalink
fix(ruby): Require shared lib from correct subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecsl committed Oct 22, 2024
1 parent 396f4c7 commit 28c70de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
-- ${{ matrix._.rb-sys-dock-setup }}
- name: Smoke gem install
if: matrix.ruby-platform == 'x86_64-linux' # GitHub actions architecture
if: matrix._.platform == 'x86_64-linux' # GitHub actions architecture
run: |
gem install pkg/eppo-server-sdk-*.gem --verbose
script="puts EppoClient::Core::Client.new(EppoClient::Config.new('placeholder'))"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
node_modules

.idea/
.DS_Store
11 changes: 9 additions & 2 deletions ruby-sdk/lib/eppo_client/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
require "logger"

require_relative "config"
require_relative "eppo_client"

# Tries to require the extension for the current Ruby version first
begin
RUBY_VERSION =~ /(\d+\.\d+)/
require_relative "#{Regexp.last_match(1)}/eppo_client"
rescue LoadError
require_relative "eppo_client"
end

module EppoClient
# The main client singleton
Expand All @@ -15,7 +22,7 @@ class Client
def init(config)
config.validate

if !@core.nil? then
if !@core.nil?
STDERR.puts "Eppo Warning: multiple initialization of the client"
@core.shutdown
end
Expand Down

0 comments on commit 28c70de

Please sign in to comment.