Skip to content

Commit 7214d63

Browse files
authored
[wip] Ruby 2.4.0 support (#1765)
* run ruby 2.4.0 builds * fix build on 2.4.0 by insisting on uptodate json * supress rubocop on 2.4.0 * Change active job spec to use literals thus avoiding Ruby 2.4.0 warning * disable 2.4.0 builds on unsupported Rubies * temporarily suppress builds that rails will eventually support
1 parent a7f402c commit 7214d63

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ script: "script/run_build 2>&1"
3333

3434
rvm:
3535
- 1.8.7
36+
- 2.4.0
3637
- 2.3.1
3738
- 2.2
3839
- 2.1
@@ -63,6 +64,10 @@ matrix:
6364
env: RAILS_VERSION=master
6465
- rvm: 2.3.1
6566
env: RAILS_VERSION=5-0-stable
67+
- rvm: 2.4.0
68+
env: RAILS_VERSION=master
69+
- rvm: 2.4.0
70+
env: RAILS_VERSION=5-0-stable
6671
exclude:
6772
# 3.0.x is not supported on MRI 2.0+
6873
- rvm: 2.0.0
@@ -73,6 +78,8 @@ matrix:
7378
env: RAILS_VERSION='~> 3.0.20'
7479
- rvm: 2.3.1
7580
env: RAILS_VERSION='~> 3.0.20'
81+
- rvm: 2.4.0
82+
env: RAILS_VERSION='~> 3.0.20'
7683
# 4.x is not supported on MRI ruby-1.8.7 or 1.9.2
7784
- rvm: 1.8.7
7885
env: RAILS_VERSION='~> 4.0.4'
@@ -103,11 +110,32 @@ matrix:
103110
env: RAILS_VERSION='~> 3.1.12'
104111
- rvm: 2.3.1
105112
env: RAILS_VERSION='~> 3.1.12'
113+
# MRI 2.4+ is not supported on a few versions
114+
- rvm: 2.4.0
115+
env: RAILS_VERSION='~> 4.1.0'
116+
- rvm: 2.4.0
117+
env: RAILS_VERSION=4-1-stable
118+
- rvm: 2.4.0
119+
env: RAILS_VERSION='~> 4.0.4'
120+
- rvm: 2.4.0
121+
env: RAILS_VERSION=4-0-stable
122+
- rvm: 2.4.0
123+
env: RAILS_VERSION='~> 3.2.17'
124+
- rvm: 2.4.0
125+
env: RAILS_VERSION=3-2-stable
126+
- rvm: 2.4.0
127+
env: RAILS_VERSION='~> 3.1.12'
106128
allow_failures:
107129
- rvm: 2.2.2
108130
env: RAILS_VERSION=master
109131
- rvm: 2.3.1
110132
env: RAILS_VERSION=master
133+
- rvm: 2.4.0
134+
env: RAILS_VERSION=master
135+
- rvm: 2.4.0
136+
env: RAILS_VERSION='~> 4.2.0'
137+
- rvm: 2.4.0
138+
env: RAILS_VERSION=4-2-stable
111139
fast_finish: true
112140

113141
branches:

Gemfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ end
2020

2121
gem 'sqlite3', '~> 1.3.6'
2222

23+
if RUBY_VERSION >= '2.4.0'
24+
gem 'json', '>= 2.0.2'
25+
end
26+
2327
if RUBY_VERSION >= '1.9.3'
2428
gem 'rake', '>= 10.0.0'
2529
else
@@ -53,7 +57,10 @@ if RUBY_VERSION <= '1.8.7'
5357
gem 'rubyzip', '< 1.0'
5458
end
5559

56-
gem 'rubocop', "~> 0.23.0", :platform => [:ruby_19, :ruby_20, :ruby_21]
60+
unless RUBY_VERSION >= '2.4.0'
61+
# our current rubocop version doesnt support the json version
62+
gem 'rubocop', "~> 0.23.0", :platform => [:ruby_19, :ruby_20, :ruby_21]
63+
end
5764

5865
custom_gemfile = File.expand_path("../Gemfile-custom", __FILE__)
5966
eval_gemfile custom_gemfile if File.exist?(custom_gemfile)

spec/rspec/rails/matchers/active_job_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def perform; end
212212
it "passes with provided argument matchers" do
213213
expect {
214214
hello_job.perform_later(42, "David")
215-
}.to have_enqueued_job.with(instance_of(Fixnum), instance_of(String))
215+
}.to have_enqueued_job.with(42, "David")
216216
end
217217

218218
it "generates failure message with all provided options" do

0 commit comments

Comments
 (0)