Skip to content

Commit

Permalink
Add Ruby 3.x to CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston committed May 1, 2024
1 parent 5f41fa9 commit d4f5c91
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ language: ruby
script: bundle exec rake rspec
bundler_args: --without development docs
rvm:
- 2.2.4
- 2.3.0
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- 3.1
- 3.2
- 3.3
- jruby-9.0.5.0
jdk:
- openjdk8
Expand All @@ -21,9 +24,17 @@ branches:
only:
- master
before_install: |
# Install bundler < 2.0, see https://docs.travis-ci.com/user/languages/ruby/
gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
gem install bundler -v '< 2'
RUBY_MAJOR=$(echo "$TRAVIS_RUBY_VERSION" | cut -d. -f1)
RUBY_MINOR=$(echo "$TRAVIS_RUBY_VERSION" | cut -d. -f2)
if (( $RUBY_MAJOR >= 3 && $RUBY_MINOR >= 2)); then
# use travis default bundler
else
# Install bundler < 2.0, see https://docs.travis-ci.com/user/languages/ruby/
gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
gem install bundler -v '< 2'
fi
if [[ k$TRAVIS_RUBY_VERSION = kjruby* ]] ; then
# Hack the Gemfile.lock file to indicate we're a JRuby gem, to make bundler happy.
sed -e 's/\(cassandra-driver [^)]*\)/\1-java/' -i"" Gemfile.lock
Expand Down
20 changes: 13 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ GEM
delorean (2.1.0)
chronic
diff-lcs (1.2.5)
docile (1.1.5)
docile (1.4.0)
ffi (1.9.25)
ffi (1.9.25-java)
gherkin (3.2.0)
ione (1.2.4)
json (1.8.6)
json (1.8.6-java)
json (2.7.2)
json (2.7.2-java)
lz4-ruby (0.3.3)
lz4-ruby (0.3.3-java)
minitest (4.7.5)
Expand All @@ -59,6 +59,7 @@ GEM
rake (13.0.1)
rake-compiler (0.9.5)
rake
rbtree (0.4.6)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
Expand All @@ -84,16 +85,21 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
set (1.1.0)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
simplecov-html (0.10.2)
snappy (0.0.14)
snappy (0.0.14-java)
snappy-jars (~> 1.1.0)
snappy-jars (1.1.0.1.2-java)
thor (0.19.1)
sorted_set (1.0.3)
rbtree
set (~> 1.0)
sorted_set (1.0.3-java)
unicode-display_width (1.3.0)
yard (0.9.20)

Expand Down
3 changes: 2 additions & 1 deletion cassandra-driver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ['README.md']
s.rdoc_options << '--title' << 'Datastax Ruby Driver' << '--main' << 'README.md' << '--line-numbers'

s.required_ruby_version = '>= 2.2.0'
s.required_ruby_version = '>= 2.3.0'

if defined?(JRUBY_VERSION)
s.platform = 'java'
Expand All @@ -31,6 +31,7 @@ Gem::Specification.new do |s|
end

s.add_runtime_dependency 'ione', '~> 1.2'
s.add_runtime_dependency 'sorted_set', '~> 1.0'

s.add_development_dependency 'bundler', '~> 1.6'
s.add_development_dependency 'rake', '~> 13.0'
Expand Down
10 changes: 8 additions & 2 deletions spec/cassandra/protocol/coder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ module Protocol

describe('RUBY-128') do
it 'reads very large short strings and string' do
column_specs = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/cols.yml"))
buffer = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"))
# https://bugs.ruby-lang.org/issues/17866
if RUBY_VERSION >= "3.1"
column_specs = ::YAML::unsafe_load(::File.open(::File.dirname(__FILE__) + "/cols.yml"))
buffer = ::YAML::unsafe_load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"))
else
column_specs = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/cols.yml"))
buffer = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"))
end

Coder.read_values_v1(buffer, column_specs)
end
Expand Down

0 comments on commit d4f5c91

Please sign in to comment.