Skip to content

Commit

Permalink
Merge pull request #918 from cucumber/support-ruby-3-and-up
Browse files Browse the repository at this point in the history
Support Ruby 3.0 and up
  • Loading branch information
mvz authored Dec 28, 2023
2 parents 78bc930 + fcaff4b commit 8ff1c20
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 17 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ jobs:

strategy:
matrix:
ruby: ["3.1", "3.2", "jruby-9.4", "3.3.0-preview3"]
ruby: ["3.1", "3.2", "jruby-9.4", "3.3"]
appraisal: [cucumber_8, cucumber_9]
include:
- ruby: "2.7"
appraisal: cucumber_8
- ruby: "3.0"
appraisal: cucumber_8

Expand All @@ -50,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, "3.0", "3.1", "3.2"]
ruby: ["3.0", "3.1", "3.2", "3.3"]

runs-on: macos-latest

Expand All @@ -70,7 +68,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, "3.0", "3.1", "3.2"]
ruby: ["3.0", "3.1", "3.2", "3.3"]

runs-on: windows-latest

Expand All @@ -95,7 +93,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.3"
bundler-cache: true
- name: Install license_finder
run: gem install license_finder
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require:
AllCops:
DisplayCopNames: true
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
Exclude:
- 'bin/cucumber'
- 'bin/rspec'
Expand Down
2 changes: 1 addition & 1 deletion aruba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rubocop-rspec", "~> 2.8"
spec.add_development_dependency "simplecov", ">= 0.18.0", "< 0.23.0"

spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 3.0.0"

spec.files = File.readlines("Manifest.txt", chomp: true)

Expand Down
2 changes: 1 addition & 1 deletion fixtures/cli-app/cli-app.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = "Description"
spec.homepage = "http://example.com"

spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 3.0"

# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
Expand Down
2 changes: 1 addition & 1 deletion fixtures/cli-app/lib/cli/app.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "cli/app/version"

Dir.glob(File.expand_path("**/*.rb", __dir__)).sort.each { |f| require_relative f }
Dir.glob(File.expand_path("**/*.rb", __dir__)).each { |f| require_relative f }

module Cli
module App
Expand Down
2 changes: 1 addition & 1 deletion fixtures/cli-app/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

require_relative "support/aruba"

Dir.glob(File.expand_path("support/**/*.rb", __dir__)).sort
Dir.glob(File.expand_path("support/**/*.rb", __dir__))
.each { |f| require_relative f }
2 changes: 1 addition & 1 deletion fixtures/empty-app/cli-app.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = "Description"
spec.homepage = "http://example.com"

spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 3.0"

# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
Expand Down
4 changes: 2 additions & 2 deletions lib/aruba/platforms/unix_environment_variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ def delete(name)
end

# Pass on checks
def method_missing(name, *args, &block)
def method_missing(name, ...)
super unless to_h.respond_to? name

to_h.send name, *args, &block
to_h.send(name, ...)
end

# Check for respond_to
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/platforms/unix_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def current_ruby
end

def require_matching_files(pattern, base)
::Dir.glob(::File.expand_path(pattern, base)).sort.each { |f| require_relative f }
::Dir.glob(::File.expand_path(pattern, base)).each { |f| require_relative f }
end

# Create directory and subdirectories
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
end

# Loading support files
Dir.glob(File.expand_path("support/*.rb", __dir__)).sort.each { |f| require_relative f }
Dir.glob(File.expand_path("support/**/*.rb", __dir__)).sort.each { |f| require_relative f }
Dir.glob(File.expand_path("support/*.rb", __dir__)).each { |f| require_relative f }
Dir.glob(File.expand_path("support/**/*.rb", __dir__)).each { |f| require_relative f }

0 comments on commit 8ff1c20

Please sign in to comment.