Commit graph

32 commits

Author SHA1 Message Date
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
Sam Stephenson
b9474ae1db Add summary lines for rbenv install and rbenv uninstall 2012-12-30 15:25:52 -06:00
Sam Stephenson
9e49bc5638 Fix rbenv-help invocation 2012-12-30 15:13:26 -06:00
Sam Stephenson
643ea84b3f Delegate to rbenv-help for usage, if available 2012-12-30 15:10:57 -06:00
Sam Stephenson
4f72a1591b CACHE_PATH -> RUBY_BUILD_CACHE_PATH 2012-11-13 17:34:08 -06:00
Loic Nageleisen
776c6e1d0e Simple, optional tarball cache support
Rationale:

Both in development and in production, some usage patterns of ruby-build
are slowed down by the download phase. In scenarios such as
troubleshooting failing builds or with provisioning situations (chef,
vagrant...) the repeated download is unnerving, bandwidth wasting and
simply against etiquette towards tarball hosters.

It also happens that some source sites happen to be down and in such
cases it is helpful to be able to sideload sources to rbenv.

Behavior:

By default nothing changes.

If the variable CACHE_PATH is set, then ruby-build will use that
directory to store a successful download, and will check before
downloading if the tarball is already there, in which case downloading
is skipped.

The file is first downloaded as before in the tmp subdirectory and only
moved afterwards, thus ensuring consistency.

There is no default cache path and the optional variable is to be set by
hand, ensuring people know what they're doing when using ruby-build.

Additionnally, rbenv-install will helpfully set CACHE_PATH if and only
if a RBENV_ROOT/cache directory exists. Again, the directory has to be
created manually.

The CACHE_PATH variable internally ends with a slash to mutualize
non-cached cases. Still, consistency is ensured whether or not a slash
is provided externally.

Notes:

I'm not quite sure CACHE_PATH is a good name, maybe
RUBY_BUILD_CACHE_PATH is better and less conflicting.
2012-11-07 16:43:15 +01:00
Fabio Rehm
cb2a79f111 Allow hooks to be defined for rbenv-install 2012-08-15 23:49:13 -03:00
Sam Stephenson
681d6b59f2 Simplify shared library function loading 2012-08-15 14:43:44 -05:00
Sam Stephenson
db359ec844 Better option parsing for rbenv-install 2012-08-15 14:02:23 -05:00
Sam Stephenson
2d489e7742 Avoid += for compatibility with older bash versions 2012-05-24 13:51:30 -05:00
Sam Stephenson
997c1d3328 Use ~/.rbenv/sources instead of ~/.rbenv/srcs 2012-05-24 13:29:36 -05:00
James Tucker
8b89e24411 If $RBENV_BUILD_ROOT is set, then always ask ruby-build to build $VERSION under that path. 2012-04-28 15:27:24 -07:00
James Tucker
daa4f246e6 rbenv-install supports a -k/--keep flag that by default builds under $RBENV_ROOT/srcs/$VERSION_NAME. 2012-04-28 15:27:19 -07:00
Joshua Peek
e14662de3a Rehash after install 2011-09-23 09:08:53 -05:00
Sam Stephenson
f47e74aa44 Autocompletion 2011-09-13 13:16:03 -05:00
Sam Stephenson
7b4b51a79e Show usage 2011-09-12 20:38:48 -05:00
Sam Stephenson
a72a81b911 Respect RBENV_ROOT 2011-09-12 20:28:24 -05:00
Joshua Peek
56dfc05233 Add basic rbenv-install script 2011-09-06 22:17:51 -05:00