Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ruby): Require shared lib from correct subdir #53

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion ruby-sdk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ruby-sdk/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
eppo-server-sdk (3.2.4)
eppo-server-sdk (3.2.5)
rb_sys (~> 0.9.102)

GEM
Expand Down
5 changes: 3 additions & 2 deletions ruby-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ Make sure you remove the override before updating `Cargo.lock`. Otherwise, the l

## Releasing

* Bump versions in `ruby-sdk/lib/eppo_client/version.rb` and `ruby-sdk/ext/eppo_client/Cargo.toml`.
* Run `cargo update --workspace --verbose` to update `Cargo.lock` and `Gemfile.lock`.
* Bump versions in `ruby-sdk/lib/eppo_client/version.rb` and `ruby-sdk/ext/eppo_client/Cargo.toml`
* Run `cargo update --workspace --verbose` to update `Cargo.lock`
* Run `bundle` to update `Gemfile.lock`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The developer needs to do this and check on it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. right now these are manual steps but we can certainly automate this in the future

2 changes: 1 addition & 1 deletion ruby-sdk/ext/eppo_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "eppo_client"
# TODO: this version and lib/eppo_client/version.rb should be in sync
version = "3.2.4"
version = "3.2.5"
edition = "2021"
license = "MIT"
publish = false
Expand Down
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 [email protected]? then
if [email protected]?
STDERR.puts "Eppo Warning: multiple initialization of the client"
@core.shutdown
end
Expand Down
2 changes: 1 addition & 1 deletion ruby-sdk/lib/eppo_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# TODO: this version and ext/eppo_client/Cargo.toml should be in sync
module EppoClient
VERSION = "3.2.4"
VERSION = "3.2.5"
end
Loading