Skip to content

Commit 4919c18

Browse files
authored
Merge pull request #529 from mgrunberg/add-ruby-3.1
Add ruby 3.1 & drop ruby 2.4
2 parents fc0e34c + b687edf commit 4919c18

File tree

6 files changed

+27
-21
lines changed

6 files changed

+27
-21
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,19 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0' ]
10+
ruby: [ '2.5.8', '2.6', '2.7', '3.0', '3.1' ]
1111
gemfile: [ 'rails_5_0', 'rails_5_1', 'rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0' ]
1212
exclude:
1313
# Only test latest Rails (Of each major), on actively supported Ruby Versions
1414
# Only test latest Ruby with latest Rails versions (Of each major)
15-
# 2.4 -> Only use legacy rails versions (5.0/5.1)
1615
# 2.5 -> Not 5.2/6.1
1716
# 2.6 -> Users of this should be using Rails 5.2+
1817
# 2.7 -> Users of this should be using Rails 5.2+
19-
# 3.0 -> Only Rails 6.1
20-
- { ruby: '2.4', gemfile: 'rails_5_2' }
21-
- { ruby: '2.4', gemfile: 'rails_6_0' }
22-
- { ruby: '2.4', gemfile: 'rails_6_1' }
23-
- { ruby: '2.4', gemfile: 'rails_7_0' }
24-
- { ruby: '2.5', gemfile: 'rails_5_2' }
25-
- { ruby: '2.5', gemfile: 'rails_6_1' }
26-
- { ruby: '2.5', gemfile: 'rails_7_0' }
18+
# 3.0 -> Rails 6.1 and 7.0
19+
# 3.1 -> Only 7.0
20+
- { ruby: '2.5.8', gemfile: 'rails_5_2' }
21+
- { ruby: '2.5.8', gemfile: 'rails_6_1' }
22+
- { ruby: '2.5.8', gemfile: 'rails_7_0' }
2723
- { ruby: '2.6', gemfile: 'rails_5_0' }
2824
- { ruby: '2.6', gemfile: 'rails_5_1' }
2925
- { ruby: '2.6', gemfile: 'rails_7_0' }
@@ -33,6 +29,11 @@ jobs:
3329
- { ruby: '3.0', gemfile: 'rails_5_1' }
3430
- { ruby: '3.0', gemfile: 'rails_5_2' }
3531
- { ruby: '3.0', gemfile: 'rails_6_0' }
32+
- { ruby: '3.1', gemfile: 'rails_5_0' }
33+
- { ruby: '3.1', gemfile: 'rails_5_1' }
34+
- { ruby: '3.1', gemfile: 'rails_5_2' }
35+
- { ruby: '3.1', gemfile: 'rails_6_0' }
36+
- { ruby: '3.1', gemfile: 'rails_6_1' }
3637
env:
3738
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
3839
steps:
@@ -44,9 +45,9 @@ jobs:
4445
bundler-cache: true
4546
- run: bundle exec rake spec
4647
- run: bundle exec rubocop
47-
# ruby-2.5.9 has issues running bundle install during specs.
48+
# ruby-2.5.8 and 2.5.9 has issues running bundle install during specs.
4849
# see errors here https://github.com/mgrunberg/cucumber-rails/runs/4824503004?check_suite_focus=true
4950
# seems incompatibility with psych gem and rubygems version.
5051
- run: gem update --system
51-
if: matrix.ruby == '2.5'
52+
if: matrix.ruby == '2.5.8'
5253
- run: bundle exec rake cucumber

.rubocop.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require:
44
- rubocop-rspec
55

66
AllCops:
7-
TargetRubyVersion: 2.4
7+
TargetRubyVersion: 2.5
88
NewCops: enable
99
Exclude:
1010
# These are auto-generated from a load of features that use aruba
@@ -48,3 +48,7 @@ Style/RegexpLiteral:
4848

4949
RSpec/MessageSpies:
5050
EnforcedStyle: receive
51+
52+
# TODO: investigate changes to release process and then enable MFA (https://guides.rubygems.org/mfa-requirement-opt-in/)
53+
Gemspec/RequireMFA:
54+
Enabled: false

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on how to contribute to Cucumber.
66
### New Features
77

88
* Added `:none` option for `javascript_strategy` which indicates no special handling of `@javascript` tagged tests ([#522](https://github.com/cucumber/cucumber-rails/pull/522) [akostadinov])
9-
* Add support for Rails 7 ([#526](https://github.com/cucumber/cucumber-rails/pull/526/)
9+
* Added support for Rails 7 ([#526](https://github.com/cucumber/cucumber-rails/pull/526/) [mgrunberg])
10+
* Added Ruby 3.1 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
1011

1112
### Changed
1213

13-
*
14+
* Dropped Ruby 2.4 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
1415

1516
### Fixed
1617

cucumber-rails.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
3737
s.add_development_dependency('database_cleaner', ['>= 1.8', '< 3.0'])
3838
s.add_development_dependency('rake', '>= 12.0')
3939
s.add_development_dependency('rspec', '~> 3.6')
40-
s.add_development_dependency('rubocop', '~> 1.7.0')
40+
s.add_development_dependency('rubocop', '~> 1.24.0')
4141
s.add_development_dependency('rubocop-packaging', '~> 0.5.1')
4242
s.add_development_dependency('rubocop-performance', '~> 1.10.2')
4343
s.add_development_dependency('rubocop-rspec', '~> 2.2.0')
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
4747
s.add_development_dependency('rdoc', '>= 6.0')
4848
s.add_development_dependency('yard', '~> 0.9.10')
4949

50-
s.required_ruby_version = '>= 2.4.0'
50+
s.required_ruby_version = '>= 2.5.0'
5151
s.rubygems_version = '>= 1.6.1'
5252
s.require_path = 'lib'
5353
s.files = Dir['lib/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md', 'LICENSE', 'README.md']

dev_tasks/yard/default/layout/html/setup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ def init
44
super
55
options[:serializer].serialize(
66
'/images/bubble_32x32.png',
7-
IO.read("#{File.dirname(__FILE__)}/bubble_32x32.png")
7+
File.read("#{File.dirname(__FILE__)}/bubble_32x32.png")
88
)
99
end

lib/generators/cucumber/install_generator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ def create_database
6161
protected
6262

6363
def embed_file(source, indent = '')
64-
IO.read(File.join(self.class.source_root, source)).gsub(/^/, indent)
64+
File.read(File.join(self.class.source_root, source)).gsub(/^/, indent)
6565
end
6666

6767
def embed_template(source, indent = '')
6868
template = File.join(self.class.source_root, source)
6969
if RUBY_VERSION >= '2.6'
70-
ERB.new(IO.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
70+
ERB.new(File.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
7171
else
72-
ERB.new(IO.read(template), nil, '-').result(binding).gsub(/^/, indent)
72+
ERB.new(File.read(template), nil, '-').result(binding).gsub(/^/, indent)
7373
end
7474
end
7575
end

0 commit comments

Comments
 (0)