Skip to content

Commit fc391c6

Browse files
committed
Add Ruby 3.x to CI testing
1 parent 5f41fa9 commit fc391c6

File tree

4 files changed

+44
-20
lines changed

4 files changed

+44
-20
lines changed

.travis.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ language: ruby
22
script: bundle exec rake rspec
33
bundler_args: --without development docs
44
rvm:
5-
- 2.2.4
6-
- 2.3.0
7-
- 2.4
8-
- 2.5
9-
- 2.6
10-
- 2.7
5+
# - 2.3.0
6+
# - 2.4
7+
# - 2.5
8+
# - 2.6
9+
# - 2.7
10+
# - 3.0
11+
# - 3.1
12+
- 3.2
13+
- 3.3
1114
- jruby-9.0.5.0
1215
jdk:
1316
- openjdk8
@@ -21,10 +24,18 @@ branches:
2124
only:
2225
- master
2326
before_install: |
24-
# Install bundler < 2.0, see https://docs.travis-ci.com/user/languages/ruby/
25-
gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
26-
gem install bundler -v '< 2'
27-
if [[ k$TRAVIS_RUBY_VERSION = kjruby* ]] ; then
27+
RUBY_MAJOR=$(echo "$TRAVIS_RUBY_VERSION" | cut -d. -f1)
28+
RUBY_MINOR=$(echo "$TRAVIS_RUBY_VERSION" | cut -d. -f2)
29+
30+
if (( $RUBY_MAJOR >= 3 && $RUBY_MINOR >= 2)); then
31+
# Hack the Gemfile.lock, bundler 1.x does not work with Ruby 3.2+
32+
sed -e 's/ 1\.17\.3/ 2.5.9/g' -i '' Gemfile.lock
33+
sed -e 's/bundler (~> 1\.6)/bundler (~> 2.5)/g' -i '' Gemfile.lock
34+
elif [[ k$TRAVIS_RUBY_VERSION = kjruby* ]]; then
2835
# Hack the Gemfile.lock file to indicate we're a JRuby gem, to make bundler happy.
2936
sed -e 's/\(cassandra-driver [^)]*\)/\1-java/' -i"" Gemfile.lock
37+
else
38+
# Install bundler < 2.0, see https://docs.travis-ci.com/user/languages/ruby/
39+
gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
40+
gem install bundler -v '< 2'
3041
fi

Gemfile.lock

+13-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ GEM
3636
delorean (2.1.0)
3737
chronic
3838
diff-lcs (1.2.5)
39-
docile (1.1.5)
39+
docile (1.3.5)
4040
ffi (1.9.25)
4141
ffi (1.9.25-java)
4242
gherkin (3.2.0)
4343
ione (1.2.4)
44-
json (1.8.6)
45-
json (1.8.6-java)
44+
json (2.7.2)
45+
json (2.7.2-java)
4646
lz4-ruby (0.3.3)
4747
lz4-ruby (0.3.3-java)
4848
minitest (4.7.5)
@@ -59,6 +59,7 @@ GEM
5959
rake (13.0.1)
6060
rake-compiler (0.9.5)
6161
rake
62+
rbtree (0.4.6)
6263
rspec (3.9.0)
6364
rspec-core (~> 3.9.0)
6465
rspec-expectations (~> 3.9.0)
@@ -84,16 +85,21 @@ GEM
8485
ruby-progressbar (~> 1.7)
8586
unicode-display_width (~> 1.0, >= 1.0.1)
8687
ruby-progressbar (1.9.0)
87-
simplecov (0.11.2)
88-
docile (~> 1.1.0)
89-
json (~> 1.8)
88+
set (1.1.0)
89+
simplecov (0.17.1)
90+
docile (~> 1.1)
91+
json (>= 1.8, < 3)
9092
simplecov-html (~> 0.10.0)
91-
simplecov-html (0.10.0)
93+
simplecov-html (0.10.2)
9294
snappy (0.0.14)
9395
snappy (0.0.14-java)
9496
snappy-jars (~> 1.1.0)
9597
snappy-jars (1.1.0.1.2-java)
9698
thor (0.19.1)
99+
sorted_set (1.0.3)
100+
rbtree
101+
set (~> 1.0)
102+
sorted_set (1.0.3-java)
97103
unicode-display_width (1.3.0)
98104
yard (0.9.20)
99105

cassandra-driver.gemspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
1919
s.extra_rdoc_files = ['README.md']
2020
s.rdoc_options << '--title' << 'Datastax Ruby Driver' << '--main' << 'README.md' << '--line-numbers'
2121

22-
s.required_ruby_version = '>= 2.2.0'
22+
s.required_ruby_version = '>= 2.3.0'
2323

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

3333
s.add_runtime_dependency 'ione', '~> 1.2'
34+
s.add_runtime_dependency 'sorted_set', '~> 1.0'
3435

3536
s.add_development_dependency 'bundler', '~> 1.6'
3637
s.add_development_dependency 'rake', '~> 13.0'

spec/cassandra/protocol/coder_spec.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@ module Protocol
3838

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

4450
Coder.read_values_v1(buffer, column_specs)
4551
end

0 commit comments

Comments
 (0)