-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
bump-formula-pr: more enhancements. #3729
bump-formula-pr: more enhancements. #3729
Conversation
base_url = if new_url_split.count > 5 | ||
new_url_split[0..4].join("/") | ||
else | ||
new_url_split[0..(new_url_split.count - 2)].join("/") |
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.
With all these splits a comment would be cool explaining what's going on here (as I have no idea). Perhaps using some/a new variables for the 5
, 4
, new_url_split.count - 2
?
new_mirror | ||
else | ||
new_url | ||
new_mirror = if requested_spec != :devel && new_url =~ %r{.*ftp.gnu.org/gnu.*} |
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.
Could maybe make this a case
statement if you anticipate more of these in future.
@@ -260,7 +264,7 @@ def bump_formula_pr | |||
end | |||
elsif forced_version && forced_version == "0" | |||
if requested_spec == :stable | |||
replacement_pairs << [/^ version \"[a-z\d+\.]+\"\n/m, ""] | |||
replacement_pairs << [/^ version \"[a-zA-Z\d+\.\-\_]+\"\n/m, ""] |
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.
Could be shortened to this, I think:
/^ version \"[\w\.\-]+\"\n/m
homebrew/core now uses ftp.gnu.org/gnu for the primary url and ftpmirror.gnu.org for the mirror.
Previously, CurlDownloadStrategy was hard coded.
6f6313c
to
ccbe494
Compare
PR refreshed. |
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.
Looks good, way more readable. 👍 thanks!
brew style
with your changes locally?brew tests
with your changes locally?