Skip to content

Commit e5c725f

Browse files
authored
fix(ruby): Require shared lib from correct subdir (#53)
* fix(ruby): Require shared lib from correct subdir * version bump
1 parent 396f4c7 commit e5c725f

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
-- ${{ matrix._.rb-sys-dock-setup }}
176176
177177
- name: Smoke gem install
178-
if: matrix.ruby-platform == 'x86_64-linux' # GitHub actions architecture
178+
if: matrix._.platform == 'x86_64-linux' # GitHub actions architecture
179179
run: |
180180
gem install pkg/eppo-server-sdk-*.gem --verbose
181181
script="puts EppoClient::Core::Client.new(EppoClient::Config.new('placeholder'))"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
node_modules
1717

1818
.idea/
19+
.DS_Store

ruby-sdk/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-sdk/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
eppo-server-sdk (3.2.4)
4+
eppo-server-sdk (3.2.5)
55
rb_sys (~> 0.9.102)
66

77
GEM

ruby-sdk/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ Make sure you remove the override before updating `Cargo.lock`. Otherwise, the l
2323

2424
## Releasing
2525

26-
* Bump versions in `ruby-sdk/lib/eppo_client/version.rb` and `ruby-sdk/ext/eppo_client/Cargo.toml`.
27-
* Run `cargo update --workspace --verbose` to update `Cargo.lock` and `Gemfile.lock`.
26+
* Bump versions in `ruby-sdk/lib/eppo_client/version.rb` and `ruby-sdk/ext/eppo_client/Cargo.toml`
27+
* Run `cargo update --workspace --verbose` to update `Cargo.lock`
28+
* Run `bundle` to update `Gemfile.lock`

ruby-sdk/ext/eppo_client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "eppo_client"
33
# TODO: this version and lib/eppo_client/version.rb should be in sync
4-
version = "3.2.4"
4+
version = "3.2.5"
55
edition = "2021"
66
license = "MIT"
77
publish = false

ruby-sdk/lib/eppo_client/client.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
require "logger"
55

66
require_relative "config"
7-
require_relative "eppo_client"
7+
8+
# Tries to require the extension for the current Ruby version first
9+
begin
10+
RUBY_VERSION =~ /(\d+\.\d+)/
11+
require_relative "#{Regexp.last_match(1)}/eppo_client"
12+
rescue LoadError
13+
require_relative "eppo_client"
14+
end
815

916
module EppoClient
1017
# The main client singleton
@@ -15,7 +22,7 @@ class Client
1522
def init(config)
1623
config.validate
1724

18-
if !@core.nil? then
25+
if !@core.nil?
1926
STDERR.puts "Eppo Warning: multiple initialization of the client"
2027
@core.shutdown
2128
end

ruby-sdk/lib/eppo_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# TODO: this version and ext/eppo_client/Cargo.toml should be in sync
44
module EppoClient
5-
VERSION = "3.2.4"
5+
VERSION = "3.2.5"
66
end

0 commit comments

Comments
 (0)