Skip to content
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

Improve help text/examples for updating versions? #345

Open
0xdevalias opened this issue May 7, 2019 · 5 comments
Open

Improve help text/examples for updating versions? #345

0xdevalias opened this issue May 7, 2019 · 5 comments

Comments

@0xdevalias
Copy link

0xdevalias commented May 7, 2019

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?

@havenwood
Copy link
Collaborator

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?

@0xdevalias
Copy link
Author

0xdevalias commented May 7, 2019

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?

@0xdevalias 0xdevalias changed the title Ruby 2.4.6 missing? Improve help text/examples for updating versions? May 7, 2019
@postmodern
Copy link
Owner

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.

@phaseOne
Copy link

phaseOne commented Feb 10, 2021

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

@postmodern
Copy link
Owner

I've added -U,--update in 9196cc4 and adjusted the wording in the README in 14375a0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants