Skip to content

Commit eae1cec

Browse files
authored
feat: BAML gem supports ruby 3.4 (#1804)
`baml` gem now supports ruby 3.4 1. Update runtime_test.rb to find integ-tests relative to file instead of hardcoded path. 2. Update github workflow to include ruby 3.4. Currently suffers from the same pinning issue, will follow up with another PR to have it be unpinned to 3.4. But at least this unblocks ruby 3.4. 3. bump Gemfile.lock to latest baml gem <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Add support for Ruby 3.4 in `baml` gem by updating GitHub workflow, test paths, and `Gemfile.lock`. > > - **Ruby 3.4 Support**: > - Update `.github/workflows/build-ruby-release.reusable.yaml` to include Ruby 3.4 in the build matrix. > - Modify `runtime_test.rb` to use relative paths for `integ-tests` directory. > - **Gem Updates**: > - Update `Gemfile.lock` to latest `baml` gem version. > - **Misc**: > - Adjust `serialize` method in `sorbet_test.rb` to include additional parameters. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for ddd2873. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent c2b3c43 commit eae1cec

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/build-ruby-release.reusable.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- uses: oxidize-rb/actions/setup-ruby-and-rust@main
4949
with:
5050
rubygems: latest
51-
ruby-version: "3.3"
51+
ruby-version: "3.4"
5252
bundler-cache: false
5353
cargo-cache: false
5454
cargo-vendor: false
@@ -105,7 +105,7 @@ jobs:
105105
--platform ${{ matrix._.platform }} \
106106
--mount-toolchains \
107107
--directory language_client_ruby \
108-
--ruby-versions 3.3,3.2,3.1 \
108+
--ruby-versions 3.4,3.3,3.2,3.1 \
109109
--build \
110110
-- ${{ matrix._.rb-sys-dock-setup }}
111111

engine/language_client_ruby/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-
baml (0.78.0)
4+
baml (0.84.3)
55

66
GEM
77
remote: https://rubygems.org/

engine/language_client_ruby/test/runtime_test.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# frozen_string_literal: true
22

3-
require_relative "../lib/baml"
3+
require_relative '../lib/baml'
44

55
require 'minitest/autorun'
66
require 'minitest/reporters'
77

8-
describe "runtime sanity check" do
9-
it "can build runtime" do
10-
baml = Baml::Ffi::BamlRuntime.from_directory("/Users/sam/baml/integ-tests/baml_src", {})
8+
describe 'runtime sanity check' do
9+
it 'can build runtime' do
10+
# Construct the path relative to the current file's directory (__dir__)
11+
# Go up three levels to the project root, then into integ-tests/baml_src
12+
baml_src_dir = File.expand_path('../../../integ-tests/baml_src', __dir__)
13+
Baml::Ffi::BamlRuntime.from_directory(baml_src_dir, {})
1114
# assert_equal(baml.always_error("input"), "0.1.0")
12-
1315
end
1416
end
1517

engine/language_client_ruby/test/sorbet_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def name
2828
module Baml
2929
module Serializable
3030
def serialize
31-
Baml::Ffi::serialize(Baml::Types, self)
31+
Baml::Ffi::serialize(Baml::Types, Baml::Types, false, self)
3232
end
3333
end
3434

0 commit comments

Comments
 (0)