-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[supply][Ruby 3] fix Ruby 3 keyword args issues #18703
Conversation
@@ -279,13 +279,13 @@ def latest_version(track) | |||
def update_listing_for_language(language: nil, title: nil, short_description: nil, full_description: nil, video: nil) | |||
ensure_active_edit! | |||
|
|||
listing = AndroidPublisher::Listing.new(**{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since other places already use keyword-ish style arguments, I made this consistent with others. **
would make sense where Hash
object is given from somewhere else whereas this is just a hash literal that we can just omit {}
.
[1] pry(main)> def hello(**args)
[1] pry(main)* p args
[1] pry(main)* end
=> :hello
[2] pry(main)> hello(a: 1, b: 2)
{:a=>1, :b=>2}
=> {:a=>1, :b=>2}
[3] pry(main)> hello(**{a: 1, b: 2})
{:a=>1, :b=>2}
=> {:a=>1, :b=>2}
[4] pry(main)> hello({a: 1, b: 2})
ArgumentError: wrong number of arguments (given 1, expected 0)
from (pry):1:in `hello'
Both result in the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -233,10 +233,10 @@ def upload_changelog(language, version_code) | |||
end | |||
end | |||
|
|||
AndroidPublisher::LocalizedText.new({ | |||
AndroidPublisher::LocalizedText.new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations! 🎉 This was released as part of fastlane 2.183.2 🚀
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
#18698
Description
Due to the lack of unit tests, we missed some Ruby 3 keyword args issues. I fixed another issue in
supply/lib/supply/uploader.rb
.I checked with
git grep "Google::Apis"
andgit grep "AndroidPublisher::"
but the rest looks okay.Testing Steps