Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for keyword arguments for lanes in Ruby 3 (#21587)
* Add tests for lanes using keyword parameters * Support keyword parameters in lanes in Ruby 3 While that previously worked implicitly in Ruby 2.x (with our internal implementation always passing a `Hash` in `lane.call(…)` but Ruby converting it as keywords dynamically if the block expected keywords), this has to be explicit in Ruby 3.x now. See https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ * Support Windows using a different error message format * Fix CI Linux failures and rubocop violations * Slightly improve code comment * Slightly tweak unit tests and fix typos * Improve test description Co-authored-by: Roger Oba <rogerluan.oba@gmail.com> * Add test cases for passing nil to keyword parameters --------- Co-authored-by: Roger Oba <rogerluan.oba@gmail.com>
- Loading branch information
1 parent
5c63bd5
commit 2c4f29f
Showing
4 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
fastlane/spec/fixtures/fastfiles/FastfileLaneKeywordParams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
platform :ios do | ||
lane :lane_no_param do | ||
'No parameter' | ||
end | ||
|
||
lane :lane_hash_param do |options| | ||
"name: #{options[:name].inspect}; version: #{options[:version].inspect}; interactive: #{options[:interactive].inspect}" | ||
end | ||
|
||
lane :lane_kw_params do |name:, version:, interactive: true| | ||
"name: #{name.inspect}; version: #{version.inspect}; interactive: #{interactive.inspect}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters