Skip to content

Commit

Permalink
Merge pull request #466 from mvz/drop-support-for-ruby-2-3
Browse files Browse the repository at this point in the history
Support for Ruby 2.4 through 2.7
  • Loading branch information
luke-hill authored Jun 12, 2020
2 parents 44b8b52 + 54a0ef9 commit 1f89a25
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
30 changes: 29 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require:
- rubocop-performance

AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.4
Exclude:
# These are auto-generated from a load of features that use aruba
- 'tmp/**/*'
Expand All @@ -20,6 +20,34 @@ Metrics/BlockLength:
Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_only

# Enable new cops
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Style/SlicingWithRange:
Enabled: true

## Cucumber Repo styles (Across implementations) ##

Layout/LineLength:
Expand Down
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ language: ruby
dist: bionic

rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head

addons:
Expand All @@ -33,10 +33,6 @@ matrix:
exclude:
# Only test Rails6 on supported rubies
# Don't test lowest rails support on maintained rubies
- rvm: 2.3
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.4
gemfile: gemfiles/rails_4_2.gemfile
- rvm: 2.4
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.5
Expand All @@ -47,6 +43,12 @@ matrix:
gemfile: gemfiles/rails_5_0.gemfile
- rvm: 2.6
gemfile: gemfiles/rails_5_1.gemfile
- rvm: 2.7
gemfile: gemfiles/rails_4_2.gemfile
- rvm: 2.7
gemfile: gemfiles/rails_5_0.gemfile
- rvm: 2.7
gemfile: gemfiles/rails_5_1.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails_4_2.gemfile
- rvm: ruby-head
Expand Down
10 changes: 5 additions & 5 deletions cucumber-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ Gem::Specification.new do |s|
# Main development dependencies
s.add_development_dependency('ammeter', '>= 1.1.4')
s.add_development_dependency('appraisal', '~> 2.2')
s.add_development_dependency('aruba', '~> 0.14.4')
s.add_development_dependency('aruba', '~> 1.0')
s.add_development_dependency('bundler', '>= 1.17')
s.add_development_dependency('rake', '>= 12.0')
s.add_development_dependency('rspec', '~> 3.6')
s.add_development_dependency('rubocop', '~> 0.81.0')
s.add_development_dependency('rubocop-performance', '~> 1.5.0')
s.add_development_dependency('rubocop-rspec', '~> 1.38.0')
s.add_development_dependency('rubocop', '~> 0.85.0')
s.add_development_dependency('rubocop-performance', '~> 1.6.1')
s.add_development_dependency('rubocop-rspec', '~> 1.39.0')
s.add_development_dependency('sqlite3', '~> 1.3')

# For Documentation:
s.add_development_dependency('rdoc', '>= 6.0')
s.add_development_dependency('yard', '~> 0.9.10')

s.required_ruby_version = '>= 2.3.0'
s.required_ruby_version = '>= 2.4.0'
s.rubygems_version = '>= 1.6.1'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/cucumber_rails_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
new_content = []

content.each do |line|
next if line =~ /gem ["|']#{gem_name}["|'].*/
next if /gem ["|']#{gem_name}["|'].*/.match?(line)

new_content << line
end
Expand Down
2 changes: 1 addition & 1 deletion features/support/cucumber_rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def add_gem(name, *args)
gem_regexp = /gem ["']#{name}["'].*$/
gemfile_content = File.read(expand_path('Gemfile'))

if gemfile_content =~ gem_regexp
if gemfile_content&.match?(gem_regexp)
updated_gemfile_content = gemfile_content.gsub(gem_regexp, line)
overwrite_file('Gemfile', updated_gemfile_content)
else
Expand Down

0 comments on commit 1f89a25

Please sign in to comment.