ruby-install
ruby-install copied to clipboard
Improve help text/examples for updating versions?
Looking at https://github.com/postmodern/ruby-versions/blob/master/ruby/stable.txt#L2 2.4.6 is included, but when I run ruby-install
it's not listed:
⇒ ruby-install
Stable ruby versions:
ruby:
2.2.10
2.3.8
2.4.5
..snip..
Is there some way I can force my version to pull the latest list?
⇒ ruby-install --version
ruby-install: 0.7.0
Alternatively, maybe the version on brew
is outdated?
⇒ brew info ruby-install
ruby-install: stable 0.7.0 (bottled), HEAD
Which seems to match the latest release: https://github.com/postmodern/ruby-install/releases/tag/v0.7.0
Looking at https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby-versions.sh#L6 ~it's trying to check against https://raw.githubusercontent.com/postmodern/ruby-versions/master, but when i try to view that in my browser I get a 400: Invalid request
(though maybe that is just the base url that is used to fetch the specific files)~ I can see that https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt correctly lists 2.4.6
I can see that my local cache doesn't have it, which explains why it isn't showing up:
⇒ cat ~/.cache/ruby-install/ruby/versions.txt| grep '2.4'
2.2.4
2.4.0-preview1
2.4.0-preview2
2.4.0-preview3
2.4.0-rc1
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
Looking at https://github.com/postmodern/ruby-install/blob/master/bin/ruby-install#L12-L15 there appears to be a force update function, but that doesn't seem to be listed in ruby-install -h
(usage ref)
I can see that --latest
will set force_update
https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby-install.sh#L186-L189 and I guess re-reading the help for it.. it's probably actually what I want.. -L, --latest Downloads the latest ruby versions and checksums
I wonder if it would be useful to include this check automatically sometimes (like how brew
auto updates itself these days), and/or include an alias like --update
or similar, or just call it out in the examples/help text more explicitly?
You should be able to fetch the latest versions from postmodern/ruby-versions with:
ruby-install --latest
Does 2.4.6
show up after a ruby-install --latest
?
It does.. that was a brain fail on my part, thanks for pointing it out. Edited my original post as I discovered that (before I saw your post):
I can see that --latest will set force_update https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby-install.sh#L186-L189 and I guess re-reading the help for it.. it's probably actually what I want.. -L, --latest Downloads the latest ruby versions and checksums
I wonder if it would be useful to include this check automatically sometimes (like how brew auto updates itself these days), and/or include an alias like --update or similar, or just call it out in the examples/help text more explicitly?
Any thoughts on tweaking the help text/examples/etc to call this out better?
I thought about naming --latest
as --update
, but ruby-install --update ruby
seemed kind of confusing; whereas ruby-install --latest ruby
reads better. --sync
was also considered. My assumption was a user would see the news that a new ruby version was released, and then run ruby-install --latest ruby [2.X]
to install the "latest" released version.
Convention for package managers (according to apt-get
, brew
, etc.) is to use xyz update
to fetch the latest packages, and xyz upgrade abc
to install a new version of a package.
My opinion is that ruby-install
should fetch the latest versions by default and list them. Why would someone want to see a potentially out of date list of ruby versions?
If you prefer keeping the current behavior, I propose revising the README.md and ruby-install --help
to the following:
List supported Rubies and their versions (from local cache):
$ ruby-install
Fetch latest supported Rubies and list their versions:
$ ruby-install --latest
Install the current stable version of Ruby (from local cache):
$ ruby-install ruby
Fetch and install the latest version of Ruby:
$ ruby-install --latest ruby
I've added -U,--update
in 9196cc4 and adjusted the wording in the README in 14375a02ff9287b77e877e94483ef00acf09f1dc.