Commit graph

67 commits

Author SHA1 Message Date
Mislav Marohnić
81eed6c48e
rbenv install: error out instead of prompting in non-interactive mode 2024-05-01 15:45:23 +02:00
Mislav Marohnić
b80edb1889
💅 Tidy up ruby-build help output 2023-11-07 18:20:59 +01:00
Mislav Marohnić
b4b1dd20ce
Enable shellcheck parsing of ruby-build source (#2268) 2023-10-12 11:10:43 +02:00
Mislav Marohnić
fbdf88cc13
Accept ruby configuration flags as extra position arguments on the command line 2023-10-11 18:02:07 +02:00
Masato Ohba
46878c9646
Remove brew update instruction (#2151)
because `brew update` runs automatically on `brew upgrade` by default since long time ago.
2023-02-20 16:00:59 +01:00
Mislav Marohnić
7de903c560
Fix rbenv install --list exit status 2022-10-03 13:28:58 +02:00
Mislav Marohnić
2b955e7ee3
List output: only print stderr notice if printing to a terminal
This makes it easier to redirect `rbenv install -l` output without having to silence stderr to get rid of the extra notice.
2022-09-29 15:44:48 +02:00
Mislav Marohnić
cde170b581
Suggest rbenv global if there is no explicit global setting (#2052)
Upon installing their first Ruby version on the system, the user may want to set it as their default; otherwise the default will remain "system" and any `gem install` attempts will fail with a permission error.

This suggestion is skipped if the user already has chosen an explicit default, even if it's "system".
2022-09-25 11:20:43 +02:00
Koichiro Iwao
a31896579e
promote 'rbenv install -L', an alias of '--list-all'
As far as I search on Twitter, the short option is not well known.
2020-09-24 11:52:30 +09:00
Koichiro Iwao
61ca880f7f
Replace one more "all available versions" with "all local versions" 2020-05-02 23:21:56 +09:00
Koichiro Iwao
e5951b2ec0
PR: #1419 should be applied also bin/rbenv-install 2020-04-27 11:26:31 +09:00
Koichiro Iwao
e2b65f5dd5 Merge branch 'master' into list-exclude-eol 2020-04-27 11:20:31 +09:00
Koichiro Iwao
c634b8e886
Reword s/Try/Use/ 2020-03-07 21:29:16 +09:00
Koichiro Iwao
67ac0b45d6
the short list now shows only latest stable versions
for each Ruby implementations like the following.

    2.4.9
    2.5.7
    2.6.5
    2.7.0
    jruby-9.2.9.0
    maglev-1.0.0
    mruby-2.1.0
    rbx-3.107
    truffleruby-19.3.1
2020-03-06 22:23:46 +09:00
Koichiro Iwao
12b17e6e93
rbenv-install: show the short list by default
As suggested by @eregon, now we have "-l/--list" option for the short
list of versions. Behaviour of `ruby-build --definitions` is kept as
before for compatibility.

rbenv-install:
  -L/--list-all       full list
  -l/--list           short list

ruby-build:
  -d/--definitions    full list
  -l/--list           short list
2020-02-19 11:01:43 +09:00
eladeyal-intel
1e94192659 shorter git command chains 2020-01-31 17:23:02 +02:00
Koichiro Iwao
e06bf905df
Add new option to exclude EoL'ed versions
when showing available versions
2020-01-30 14:57:11 +09:00
Mislav Marohnić
9e41ff482c Have rbenv install --list output match ruby-build --definitions
This is for simplicity and usability in scripts.

Fixes #1170
2019-11-02 19:30:31 +01:00
Mislav Marohnić
a937418190 Merge pull request #886 from jasonkarns/rbenv-root
rbenv ensures RBENV_ROOT is set for us
2016-01-19 11:47:48 +11:00
Jason Karns
29a987c9fb Include --version in completions 2016-01-18 12:12:09 -05:00
Jason Karns
c534656f7a Include --version in usage documentation 2016-01-18 12:12:09 -05:00
Jason Karns
67fc7e2a1d Clean up usage documentation 2016-01-18 12:12:05 -05:00
Jason Karns
6b639919cf rbenv ensures RBENV_ROOT is set for us 2016-01-18 09:43:28 -05:00
Mislav Marohnić
eef6a2ed8e Merge pull request #841 from jasonkarns/rbenv-completions
Provide completion of flags for install/uninstall
2015-12-08 10:17:31 +01:00
Chulki Lee
866dacc0b4 update urls to rbenv 2015-12-07 14:17:04 -08:00
Jason Karns
273dab13b3 include flags in nodenv-install completions 2015-12-04 16:44:36 -05:00
Jason Karns
699f0cc566 remove sed fallback for help/usage 2015-06-01 21:41:42 -04:00
Simon Hürlimann (CyT)
f2a43c5554 Add 'cd -' to proposed steps to upgrade ruby-build
When a target is not found, rbenv-install proposes pulling changes from
upstream. This involves changing the directory to the ruby-build checkout.

This patch adds a '&& cd -' to change the working directory back to where
we've been. Should work on at least Bash and Zsh.
2015-04-14 00:03:00 +02:00
Mislav Marohnić
4a6b9280bb Provide CLI usage help on stout/stderr appropriately
When requested via `-h|--help`, usage text should be displayed on stdout
and the exit status should be 0.

When usage text is shown due to invalid arguments, it should be
printed to stderr and exit status should be 1.
2014-11-26 20:46:44 -08:00
Mislav Marohnić
22c73bf3f5 Perform CLI argument validation as early as possible 2014-11-26 20:46:44 -08:00
Ivan Kuchin
fa38b660e2 Abort with usage help on wrong number of CLI arguments
- rbenv-install accepts 0 or 1 argument
- rbenv-uninstall accepts 1 argument
- ruby-build accepts 2 arguments
2014-11-26 20:45:53 -08:00
Mislav Marohnić
aa4a237f79 Show specific upgrade instructions based on environment
Because ruby-build is both a Homebrew formula and an rbenv plugin, some
people end up with both installed. In these cases, executing
`rbenv install` vs. `ruby-build` might not use the same install. Users
end up being unsure where `rbenv install` is coming from and upgrading
it from the wrong location.

This detect whether ruby-build is contained in Homebrew or git and shows
upgrade instructions accordingly. Example:

    See all available versions with \`rbenv install --list'.

    If the version you need is missing, try upgrading ruby-build:

      brew update && brew upgrade ruby-build
2014-09-08 22:23:23 -07:00
Mislav Marohnić
56c8f296ce rbenv install completion includes definitions from plugins
Before, `ruby-build --definitions` was invoked sooner than
RUBY_BUILD_DEFINITIONS was built up with paths from rbenv plugins.
2014-09-08 20:14:33 -07:00
Mislav Marohnić
311d96f779 Fix rbenv install --list for definitions auto-discovery
The build definitions auto-discovered from rbenv plugins would
previously not appear in `--list` results due to discovery process
taking place too late.
2014-09-06 02:57:19 -07:00
Mislav Marohnić
78bc84660b Auto-discovery of build definitions from rbenv plugins
The `share/ruby-build/` directory from each rbenv plugin, if it exists,
is added to RUBY_BUILD_DEFINITIONS automatically during `rbenv install`.
2014-08-18 16:08:06 -07:00
Adam Harvey
2e6e100a2e Prefer ggrep for grep invocations that use GNU extensions. 2014-04-18 10:51:26 +10:00
Kristofer White
c114885731 Add rbenv install --skip-existing <VERSION> option
The `-f` option allows for forcing installation of versions that already
exist in the environment. If that option isn't used, then an interactive
prompt is created which causes problems for non-interactive execution of
the command.

This change adds the `-s/--skip-existing` option to not install versions
that already exist, while still exiting as success.

Closes #543
2014-04-04 19:18:14 +02:00
Mislav Marohnić
4d8319bde7 Call rbenv-* subcommands directly, not through the rbenv executable
Benefits:
- makes it easier to stub `rbenv-*` subcommands in tests
- speeds up subcommands because it skips the main `rbenv` executable

Caveats:
- users are no longer able to call `bin/rbenv-install` or
  `rbenv-uninstall` directly
2014-01-05 18:58:57 +01:00
Mislav Marohnić
24ff49ccc0 Support rbenv hook paths that have spaces
Same approach taken in rbenv: sstephenson/rbenv@baf7656d
2014-01-05 18:58:57 +01:00
Mislav Marohnić
dc1a77590c Clarify which rbenv install flags get forwarded to ruby-build 2013-12-12 00:35:31 +01:00
Mislav Marohnić
2d6d676586 Shorten rbenv install usage synopsis
It was getting out of hand, so just use the single-character flags which
are documented below anyway.
2013-12-11 21:33:32 +01:00
Mislav Marohnić
4351c46923 Add --patch flag to apply a Ruby patch from stdin
If `-p|--patch` flag was set while invoking `ruby-build` or
`rbenv install`, ruby-build will use `patch -p0 -i -` to apply a patch
from stdin to Ruby, Rubinius, or JRuby source code before running the
rest of `build_package_*` commands.

References #443
2013-12-11 21:16:47 +01:00
Sam Stephenson
e46986c7b5 Default RBENV_VERSION to the globally-specified Ruby
Fixes `rbenv install` in a directory with a .ruby-version file that specifies ree
2013-04-19 11:46:12 -05:00
Sam Stephenson
386b37613f rbenv install 1.9.3 lists matching definitions 2013-03-21 12:40:53 -05:00
Adam Stankiewicz
f0d5c5979f fix: Ensure cleaned directory did not exist 2013-02-22 20:22:15 +01:00
Adam Stankiewicz
0d7a05157e Autoclean on unsuccessful installation 2013-02-05 00:22:28 +01:00
Sam Stephenson
8372808980 Confirm reinstalling already-installed versions unless invoked with --force 2013-01-29 17:22:56 -06:00
Sam Stephenson
5fd4ec64cc rbenv install with no arguments defaults to rbenv local 2013-01-29 17:01:13 -06:00
Sam Stephenson
36b2d13baa Allow plugins to run code before and after the installation process 2013-01-29 15:07:06 -06:00
Sam Stephenson
aa4a0287f9 Point people to the readme 2012-12-30 15:29:52 -06:00