diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e067fe707..35315b4b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,11 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Removed +- Removed former unused `stdin` argument from `Cli::Main`. That may impact your code + if you use cucumber API `Cucumber::Cli::Main`. See [UPGRADING.md](./UPGRADING.md#upgrading-to-800). + ([PR#1588](https://github.com/cucumber/cucumber-ruby/pull/1588) + [Issue#1581](https://github.com/cucumber/cucumber-ruby/issues/1581)) + ### Security fixes ### Deprecated diff --git a/UPGRADING.md b/UPGRADING.md index f8cc85e048..3cb0c1a19d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,3 +1,38 @@ +# Upgrading to 8.0.0 + +## `Cucumber::Cli::Main` former `stdin` argument + +The second argument of `Cucumber::Cli::Main` - which was formerly named `stdin` - +has been removed. + +### Before cucumber 8.0.0 + +You would have used `Cucumber::Cli::Main` with a dummy parameter: + +```ruby +Cucumber::Cli::Main.new( + argument_list, + nil, # <-- this is a former unused `stdin` parameter + @stdout, + @stderr, + @kernel +).execute! +``` + +### With cucumber 8.0.0 + +The argument has been removed from the initializer so the dummy parameter is not +required anymore: + +```ruby +Cucumber::Cli::Main.new( + argument_list, + @stdout, + @stderr, + @kernel +).execute! +``` + # Upgrading to 7.1.0 ## The wire protocol diff --git a/features/lib/support/command_line.rb b/features/lib/support/command_line.rb index d2f8de9e05..068b47d73a 100644 --- a/features/lib/support/command_line.rb +++ b/features/lib/support/command_line.rb @@ -85,7 +85,6 @@ def execute(args) Cucumber::Cli::Main.new( argument_list, - nil, @stdout, @stderr, @kernel @@ -126,7 +125,6 @@ def execute(task) .and_wrap_original do |_, *args| Cucumber::Cli::Main.new( args[0], - nil, @stdout, @stderr, @kernel diff --git a/lib/cucumber/cli/main.rb b/lib/cucumber/cli/main.rb index a3613cfce9..99192515e1 100644 --- a/lib/cucumber/cli/main.rb +++ b/lib/cucumber/cli/main.rb @@ -14,12 +14,7 @@ def execute(args) end end - # The second argument is there for retrocompatibility - # Removing it will require a breaking change - # But it is actually responsible for a rubycop offense: too many optional parameters - # As we don't want to deactivate that cop globally, we disable it just for the - # following. - def initialize(args, _ = nil, out = $stdout, err = $stderr, kernel = Kernel) # rubocop:disable Metrics/ParameterLists + def initialize(args, out = $stdout, err = $stderr, kernel = Kernel) @args = args @out = out @err = err diff --git a/spec/cucumber/cli/main_spec.rb b/spec/cucumber/cli/main_spec.rb index 53568a239d..1020653f82 100644 --- a/spec/cucumber/cli/main_spec.rb +++ b/spec/cucumber/cli/main_spec.rb @@ -12,11 +12,10 @@ module Cli end let(:args) { [] } - let(:stdin) { StringIO.new } let(:stdout) { StringIO.new } let(:stderr) { StringIO.new } let(:kernel) { double(:kernel) } - subject { Main.new(args, stdin, stdout, stderr, kernel) } + subject { Main.new(args, stdout, stderr, kernel) } describe '#execute!' do context 'passed an existing runtime' do