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
cmd/{rb,nod}env-sync: add new commands. #14972
Conversation
Review period ended. |
3e01fd7
to
ab891b6
Compare
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.
Makes sense to me. Can probably extract gem_like_version
and gem_version_segments
since they're reused between these two commands
Library/Homebrew/cmd/nodenv-sync.rb
Outdated
def gem_like_version(version_path) | ||
Gem::Version.new(version_path.basename | ||
.to_s | ||
.tr("_", ".")) | ||
end | ||
|
||
def gem_version_segments(version_path) | ||
basename_without_revision = version_path.basename | ||
.to_s | ||
.gsub(/_\d+$/, "") | ||
Gem::Version.new(basename_without_revision) | ||
.canonical_segments | ||
end |
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.
Any particular reason we're not using our Version
?
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.
@Bo98 Just because it used to live in Not Homebrew. Ported to use Keg
and Version
from us now, bit nicer from that, thanks for suggestion!
Add these commands to ease use of Homebrew's bottles with `rbenv` and `nodenv`. I've had a lot of people request this over the years and it's worked well for me for a long time. I could see people extending these to support other languages or version managers so perhaps we want a more generic name. Co-authored-by: Rylan Polster <rslpolster@gmail.com>
08a798d
to
b61bf25
Compare
Refactored them a bit instead so not longer needed! |
Add these commands to ease use of Homebrew's bottles with
rbenv
andnodenv
.I've had a lot of people request this over the years and it's worked well for me for a long time.
I could see people extending these to support other languages or version managers so perhaps we want a more generic name.
Migrated from Homebrew/homebrew-core#125503
Marking as
critical
as already went through some rounds of review over there.