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
Update method for finding latest ruby version #410
Conversation
find_latest_ruby() { | ||
local ruby_download_site="https://www.ruby-lang.org/en/downloads/" | ||
|
||
fancy_echo "Find latest stable Ruby 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.
Finding
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.
👍 72dc852
Since we're using |
|
||
fancy_echo "Find latest stable Ruby version ..." | ||
curl -s $ruby_download_site | grep "Current stable:" -A 1 | grep "Ruby" |\ | ||
sed 's|</b>|-|g' | sed 's|<[^>]*>||g' | sed 's/Ruby //g' |
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.
I shortened this:
curl -s "$ruby_download_site" | sed -ne '/Current stable/{n; /Ruby/s/.*Ruby //; s/<.*//p}'
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.
thanks @mike-burns... any thoughts on going this route verse what @iwz suggested? Since this is parsing a webpage it seems like it might have more of a potential to break in the future.
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.
Ian's suggestion is probably better.
good idea @iwz |
👍 to offloading that to |
I agree, parsing |
@kenyonj can you squash these into one commit? I'm soliciting more feedback, but I'd like to get this merged in. |
29408f4
to
c299c1d
Compare
@geoffharcourt I've squashed, but I think it would probably good to explore finding the latest version through |
The "it works for RVM and chruby users" argument is appealing. Laptop is coupled to rbenv but it's not a library embedded in people's programs. Many users use Laptop in the following way:
I see the elegance of the |
@croaky but the script installs However, in the default case where no modifications are made to the script, it may be possible to have a race condition where there's a new ruby released that isn't yet available on |
Where do we serve |
@tute I've just updated it to 2.3.0. |
Thank you! |
When I run the script in this branch, I get:
I've taken a stab at the rbenv method here: |
Went with the rbenv method in 36cd104 |
This PR:
curl
ing the ruby-lang siteWhy?