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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ruby 3.0] Replace Kernel.open overridden by open-uri with URI.open #18395
Conversation
@@ -1,4 +1,3 @@ | |||
require 'open-uri' |
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 is not in use.
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.
Seems simple enough! LGTM 馃帀
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.
Oh goodness, I had no idea Kernel.open
was being called anywhere 馃槺 Good catch on this! 鉂わ笍
The mystery solved. #18405 (comment) |
Hey @ainame 馃憢 Thank you for your contribution to fastlane and congrats on getting this pull request merged 馃帀 Please let us know if this change requires an immediate release by adding a comment here 馃憤 |
Congratulations! 馃帀 This was released as part of fastlane 2.179.0 馃殌 |
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
Prior to this PR, I've fixed most issues about Ruby 2.7 deprecation warnings at least within fastlane/fastlane's codebase #18021 as per plan #17931. There are some left in its dependencies. While working on this PR #18278 that randomises the order of execution of test cases, I found that there are more issues that I missed last time due to the code path in unit testing which is always the same unless using
--order random
like #18278. (In other words, #18278 will be quite handy to reveal undiscovered issues馃槃)https://app.circleci.com/pipelines/github/fastlane/fastlane/2446/workflows/604cf165-0e95-4227-8088-732c3957d62c/jobs/64390/parallel-runs/0/steps/0-115
Description
Kernel#open
which is overridden byrequire 'open-uri'
is deprecated in Ruby 2.7 and removed in Ruby 3.0. For some reasons, it wasn't detected in fastlane's codebase. So this PR replaceKernel#open
that appears asopen(url)
withURI.open
which remains available in Ruby 3.0.ruby/ruby@a73b5cc
Testing Steps