Commit graph

680 commits

Author SHA1 Message Date
Jason Karns
a6cb4b6317 consistent completions for rbenv-help 2015-11-20 09:15:06 -05:00
Jason Karns
2f917312f1 completions for rbenv-completions 2015-11-20 09:12:53 -05:00
Jason Karns
d1f8081d1c completions for rbenv-versions 2015-11-20 09:12:47 -05:00
Jason Karns
d7ca2aba2a add --help to subcommand completions
ensure subcommand exists, then include --help in its completion output
2015-11-19 12:05:19 -05:00
Jason Karns
2c4dd63f77 handle --help for subcommands
If subcommand is provided (and exists) and its first arg is -h/--help,
go ahead and intercept the call; redirecting to rbenv-help <subcommand>

This means subcommands and plugins need not handle --help flag
themselves
2015-11-19 12:05:18 -05:00
Jason Karns
06e4f1b682 explicit --version flag
Without it, it falls back to `--version` being executed as a subcommand,
which works but isn't obvious
2015-11-19 11:14:59 -05:00
Mislav Marohnić
825de5d2e3 Fix argument handling in main rbenv command
- Explicitly asking for help with `-h` or `--help` exits with 0 status
  and displays help on stdout.

- Not providing any arguments to rbenv results in failure status and
  displays version and help on stderr.
2015-11-19 01:52:48 +01:00
Mislav Marohnić
c30e096a54 Merge branch 'which-fixes' 2015-11-14 10:42:41 +00:00
Mislav Marohnić
3405c4d03c Fix error message when command is not found for "system" version
If `foo` didn't exist and `RBENV_VERSION=system rbenv which foo` was
called, the error message used to be misleading:

    rbenv: version `system' is not installed

Instead, have the error message simply say that the command was not found.

Fixes #770
2015-11-13 23:10:09 -05:00
Jason Karns
8c3cab61c7 add completion block for rbenv-help 2015-11-13 15:06:29 -05:00
Yamashita, Yuu
12ad6f670b Merge pull request #471 from yyuu/activate-ng
List Anaconda-style virtual environments as a version in pyenv
2015-11-05 18:42:03 +09:00
Yamashita, Yuu
9163c46568 v20151105 2015-11-05 09:21:08 +00:00
Yamashita, Yuu
3937dc3618 list virtual environments created by anaconda/miniconda as a version in pyenv 2015-11-04 15:00:48 +00:00
Yamashita, Yuu
0daf04a71b v20151103 2015-11-03 13:31:28 +00:00
moe
f6c1e5220a Never use hardlinks. Never. 2015-10-28 21:35:39 +01:00
Mislav Marohnić
e80886e9be Add rbenv versions --skip-aliases option
Useful in combination with `--bare` to list just the unique version
numbers without the extra directory entries that are symlinks to other
version numbers in the same directory.
2015-10-27 21:05:10 +01:00
Mislav Marohnić
7026e529c7 Fix realpath fallback in rbenv hooks
The symlinks weren't correctly resolved if they were pointing to a
single path component, such as `ln -s foo bar`.
2015-10-27 21:05:10 +01:00
Mislav Marohnić
6e02b944f7 Use $BASH_SOURCE instead of $0
BASH_SOURCE might be more reliable.
2015-10-27 20:55:23 +01:00
Mislav Marohnić
6913fee89a If there is .bashrc but no .bash_profile, recommend the former
This is for Linux desktop platforms that have Terminal application
configured to start shells in interactive but not login mode. Creating a
`~/.bash_profile` would also cause `~/.profile` to not run, which might
be a problem on Ubuntu which ships with a default `~/.profile`.
2015-10-26 15:45:52 +01:00
Mislav Marohnić
dcca61c0bc Improve rbenv --version git checkout discovery
When `rbenv --version` is called, this now happens:

1. It changes into the directory where `libexec/rbenv--version` resides
   and checks if it's a checkout of the rbenv repo (as opposed to
   Homebrew checkout or something else). Then it reads the git revision.

2. If that failed, change to `$RBENV_ROOT` directory and repeat step 1.
2015-10-25 16:54:38 +01:00
Mislav Marohnić
0f44c57d08 Fix eval'ing multiline sh-* command output with bash 2015-10-12 01:33:17 +02:00
Mislav Marohnić
efb187f26f Merge pull request #663 from kevinburke/use-command
Use `command` to run rbenv rehash
2015-10-11 04:04:46 +02:00
Mislav Marohnić
c101052a7f Fix eval'ing multiline sh-* command output with fish 2015-10-10 21:48:40 +02:00
Mislav Marohnić
51a1ee06e4 Merge commit '5c1094a' from #529
Closes #529
2015-10-10 19:17:18 +02:00
Mislav Marohnić
c43928a8e4 Merge pull request #731 from blueyed/init-no-basename-for-shell
rbenv-init: do not use basename for $shell
2015-10-10 18:33:52 +02:00
Yamashita, Yuu
19c02bf39c v20151006 2015-10-06 14:12:04 +00:00
Yamashita, Yuu
948d1f4ca7 Merge branch 'blueyed-pyenv-rehash-python-glub' (fixes #379, #404) 2015-09-22 15:28:15 +09:00
Josh Friend
c452da8084 v20150913 2015-09-13 11:03:52 -04:00
Mislav Marohnić
9e664b5d27 Suggest that rbenv should be loaded at end of shell rc file
Closes #725
2015-09-12 15:27:32 -07:00
Josh Friend
193e64b6b2 v20150901 2015-09-01 13:59:13 -04:00
Yamashita, Yuu
7f32e96c28 v20150719 2015-07-19 13:07:24 +09:00
Daniel Hahler
e3982fae38 Display version origin with non-installed versions
This is useful as an indicator where it is coming from.
2015-07-17 17:10:33 +02:00
Daniel Hahler
493f036928 shims: handle symlinked scripts, via new PYENV_FILE_ARG
`PYENV_FILE_ARG` is used here to make use of `abs_dirname` later in
`libexec/pyenv`.

Fixes https://github.com/yyuu/pyenv/issues/404
2015-07-08 18:59:22 +02:00
Daniel Hahler
af438abeae shims: look for python*
This is required for the shims to handle `#!/usr/bin/env python3` in a
shebang, just like `python` is handled currently: it will set
`PYENV_DIR` to the root of the invoked script, which is required for a
`.python-version` script to get picked up from there.

This was rejected for rbenv, where it does not make much sense
(https://github.com/sstephenson/rbenv/pull/735).

Ref: https://github.com/yyuu/pyenv/pull/368#issuecomment-102806837
2015-07-08 18:59:22 +02:00
Yamashita Yuu
114063495f pyenv-prefix should return proper prefix of system version (fixes #391) 2015-06-27 01:07:18 +09:00
Mislav Marohnić
43b28caa94 Fix discovering .ruby-version files in root directory
It's not that this is a preferred way to set a global version (one
should use `rbenv global <version>` instead), but this fixes the
function purely for correctness: all parent directories should be
scanned, even the root directory.

Fixes #745
2015-06-09 17:24:15 +02:00
Josh Friend
5cb9c9af2e v20150601 2015-06-01 21:48:44 -04:00
Yamashita Yuu
1b066598ce v20150524 2015-05-24 10:53:17 +09:00
Daniel Hahler
c754efc44b Merge pull request #378 from blueyed/version-file-read-without-type
pyenv-version-file-read: use sed instead of type/head/awk
2015-05-18 16:37:09 +02:00
Yamashita, Yuu
46ffb0c8df Merge pull request #290 from blueyed/version-handle-missing-better
Improve `pyenv version`, if there is one missing
2015-05-17 12:05:03 +09:00
Daniel Hahler
9156191168 pyenv-version-file-read: use sed/cut instead of type/head/awk
I was seeing the following occasionally in scripts:

> …/.pyenv/libexec/pyenv-version-file-read: line 12: type: write error: Broken pipe

This patch hopefully improves/fixes this, and it seems better anyway to
just use sed here.
2015-05-16 23:02:00 +02:00
Daniel Hahler
4ea7d0849b rbenv-init: do not use basename for $shell
This can be done using bash directly.
2015-05-10 16:17:35 +02:00
Josh Friend
1d31529b46 v20150404 2015-05-04 08:25:25 -04:00
Kevin Burke
0cd078bae6 Merge branch 'master' into use-command 2015-03-31 18:57:44 -07:00
Yamashita Yuu
ab2aa6d13b v20150326 2015-03-26 23:13:55 +09:00
derwolfe
e9aa6cf649 doc: make location to add code to more clear 2015-03-18 21:33:15 +01:00
Yamashita Yuu
f48a5b11d7 Import recent changes from rbenv 4d72eefffc 2015-03-07 01:01:32 +09:00
Yamashita Yuu
efe461d2b4 v20150226 (#323) 2015-02-26 11:35:10 +09:00
Yamashita Yuu
9146f44db1 v20150204 2015-02-04 10:33:21 +09:00
Mislav Marohnić
6820704c91 Remove warning about extraneous "ruby-" prefix in .ruby-version
When we started to support reading `.ruby-version` files, we made a
commitment to not support fuzzy version matching. Treating "ruby-2.1.5"
as "2.1.5" is a sort of fuzzy matching, so we put in place a warning
telling you to remove the extraneous "ruby-" prefix popularly used by
other Ruby version managers to denote MRI. (Their logic is that MRI is
"ruby" and other rubies are not "ruby", apparently.)

However, people are often not able to remove the prefix in their
projects because they want to support other coworkers and tools that
sadly still require the prefix, like RubyMine.

So to restore sanity for a big portion of our users, the warning is gone.
2015-01-29 01:55:58 -08:00
Yamashita Yuu
8abefe1fcb v20150124 2015-01-24 00:45:03 +09:00
Daniel Hahler
e8433cfeb3 Use exitcode from pyenv-version-name in pyenv-version, do not halt 2014-12-11 20:37:03 +01:00
Daniel Hahler
7f88eabd0b Improve pyenv version, if there is one missing
Display the other available ones still.

Fixes https://github.com/yyuu/pyenv/issues/291
2014-12-11 18:49:38 +01:00
Yamashita Yuu
d320d74a07 v20141211 (fixes #288) 2014-12-11 22:39:38 +09:00
Yamashita Yuu
5ca423c9f3 Revert a fix for #101 to fix broken tests relating to PYENV_NATIVE_EXT 2014-12-01 20:34:12 +09:00
Yamashita Yuu
f0e852553a Import rbenv changes at 7e0e85bdda 2014-12-01 00:29:26 +09:00
Kevin Burke
c9a96c9f79 Use command to run rbenv rehash
In the event that `eval "$(rbenv init -)"` is called from a function named
rbenv (which I do to get rbenv to load lazily in my shell), evaluating the
phrase `rbenv rehash` will cause the outer function to run again (causing an
infinite loop).

This change makes it clear you want the command named rbenv and not a function
which may exist in the environment.
2014-11-28 21:16:14 -08:00
Makoto Sasaki
c0aff27842 v20141127 2014-11-27 14:58:31 +09:00
Yamashita Yuu
8761ae8f7c v20141118 2014-11-18 20:05:01 +09:00
Yamashita Yuu
7220044b49 v20141106 2014-11-06 09:41:22 -08:00
Daniel Hahler
a797bb6d88 Fix "pyenv: version 'system' is not installed" with pyenv which
This is a follow-up to de5c61c.
2014-11-06 17:57:17 +01:00
Mislav Marohnić
632263568e Add rbenv's own rbenv.d directory to hook paths
This allows rbenv source code to ship with built-in hooks.
2014-10-19 14:35:36 +02:00
Mislav Marohnić
07d675350f Merge pull request #636 from sstephenson/speedup-rehash
Speed up `rbenv rehash`
2014-10-16 12:29:51 +02:00
Daniel Hahler
de5c61cd59 Fix "version X is not installed" with multiple PYENV_VERSIONs
This was introduced when merging the rbenv upstream change
(https://github.com/sstephenson/rbenv/commit/6bb7f07d2d).
2014-10-16 02:51:07 +02:00
Mislav Marohnić
39cde6fc95 Merge pull request #528 from sstephenson/dylib
Speed up rbenv by dynamically loading compiled command
2014-10-15 18:19:54 +02:00
Mislav Marohnić
1381c2ca79 Simplify the shims registration implementation in rbenv-rehash
It doesn't need to be a bash array and we don't need a separate index of
shims registered. Simply keep everything in a space-separated string and
use that as an index as well.

This assumes that executable names *never* have spaces in them.
2014-10-15 05:46:18 +02:00
Mislav Marohnić
89d4e8a0e0 Speed up rehash process when there are many Ruby versions
On my system that has 25 versions under rbenv, this speeds up rehash
almost 3-fold:

- before: 391 ms
- after:  134 ms

This is achieved by removing duplicate names of executables before
registering them as shims. Since most Rubies will share a lot of the
same executable names ("ruby", "rake", "bundle", ...), this is a
considerable reduction in number of shims registered.
2014-10-15 05:46:18 +02:00
Mislav Marohnić
a8df5d587c Avoid changing directories during rehash process 2014-10-15 05:46:18 +02:00
Mislav Marohnić
e2173df4aa Revert "Don't duplicate shims in PATH"
Too many of our users have a shell initialization set up that
inadvertently duplicates some or most of the entries in their PATH,
bringing the system paths again in front of rbenv's shims. If this was a
nested shell (a typical scenario when starting up tmux), `rbenv init`
would get eval'd again but this time, shims won't get added to the front
of the PATH and would only stay and the end of the path, effectively
rendering them useless.

I tried to argue that this is a user problem rather than rbenv's, but I
can't fix everybody shell init when they report bugs. Instead, let's
revert to simpler times in rbenv where we just roll along with the
duplication and don't ask any questions.

This reverts commit 03fa148e81.

Fixes #369
2014-10-15 01:43:24 +02:00
Mislav Marohnić
e851250da6 Speed up obtaining exec/which/whence completions
Delegate to `rbenv-shims` instead of `rbenv shims` and therefore skip
going through the main `rbenv` executable again that would set up a lot
of the environment that was already set.
2014-10-15 01:24:45 +02:00
Yamashita Yuu
8e657374a1 Import recent changes from rbenv-versions 2014-10-15 00:46:11 +09:00
Yamashita, Yuu
77bd5bc6c9 Merge pull request #129 from blueyed/optimize-pyenv-which
Optimize pyenv-which: implement remove_from_path in Bash
2014-10-15 00:19:28 +09:00
Daniel Hahler
a1df551bcf Merge tests and remove_from_path from rbenv
This adds the missing parts from the upstream rbenv merge:
f4652fbbf0

- e4cbf04592
- 3ee395f9b5
2014-10-13 21:14:57 +02:00
Mislav Marohnić
3ee395f9b5 Clean up PATH sanitization in rbenv-which 2014-10-13 12:27:19 +02:00
Daniel Hahler
e4cbf04592 Improve performance of rbenv-which when RBENV_VERSION=system
This implements removing of the shims path element via bash
substitution, instead of jumping around in all the `$PATH` elements.
2014-10-13 12:26:43 +02:00
Mislav Marohnić
6bb7f07d2d Avoid rbenv-exec calling out to rbenv-version-name twice
Running any shim (and thus `rbenv-exec`) would always execute
`rbenv-version-name` twice: once in `rbenv-exec` and another time in
`rbenv-which`, even though RBENV_VERSION variable would have already
been populated at this point.

Now RBENV_VERSION is respected within `rbenv-which`.
2014-10-13 12:26:43 +02:00
Mislav Marohnić
3f74da0e73 Fail hard if RBENV_NATIVE_EXT is set but extensions failed to load 2014-10-13 04:12:35 +02:00
Mislav Marohnić
8bac958994 Stop using abs_dirname() in rbenv-init
It's slow and not necessary since we expect `$0` to already be expanded.

In tests this change forces us to deal with some relative paths, but
it's not a big deal. The `rbenv init -` output in the most common case
will be the same as before:

    source '/home/myuser/.rbenv/libexec/../completions/rbenv.bash'
2014-10-13 04:12:34 +02:00
Mislav Marohnić
5287e2ebf4 Avoid slow abs_dirname() by loading realpath extension
This speeds up every `rbenv` invocation significantly.
2014-10-13 04:12:34 +02:00
Mislav Marohnić
16c7eb4135 Speed up realpath() with dynamically loaded C extension
On systems that support both C compiling and dynamic loading, we can
speed up `realpath()` (where most time in rbenv is spent) by replacing
it with a dynamically loaded bash builtin.

When `make -C src` is called in the project's root,
`libexec/rbenv-realpath.dylib` will be created. If it exists, rbenv will
attempt to load it as a builtin command. If it fails, execution will
fall back to the old `realpath()` shell function.
2014-10-13 04:12:34 +02:00
Mislav Marohnić
f237a11f4f Have versions emit a warning when no Ruby version was found 2014-10-13 04:02:04 +02:00
Makoto Sasaki
77d9e34a49 v20141012 2014-10-12 21:48:56 +09:00
Makoto Sasaki
d38f00cd4a v20141011 2014-10-11 20:00:54 +09:00
Makoto Sasaki
ff995b6654 v20141008 2014-10-08 19:29:20 +09:00
Yamashita Yuu
ab9ee414ad v20140924 2014-09-24 13:57:53 +09:00
Daniel Hahler
9901c4b84d Use consistent quoting for versions=("$@") across bins 2014-09-11 12:59:40 +02:00
Daniel Hahler
b6aef96cea pyenv-version-file-write: do not use rm, but clobber the file
With e.g. /usr/local/bin/.python-version owned by some user, `pyenv
local foo` would fail, if the user has no permissions for
`/usr/local/bin`, but only the `.python-version` file.
2014-09-07 16:56:40 +02:00
Yamashita Yuu
6509d318f4 v20140825 2014-08-25 10:21:26 +09:00
Yamashita Yuu
b8a7de8a3c v20140705 (fixes #204) 2014-07-06 00:35:50 +09:00
Yamashita Yuu
6f761f8159 Remove exit 0 from initialization code of fish 2014-06-30 23:00:09 +09:00
Yamashita Yuu
0468ffdd49 v20140628 2014-06-28 18:04:17 +09:00
Makoto Sasaki
21c0d930e9 v20140615 2014-06-15 05:37:34 +09:00
Yamashita Yuu
2b5ee0c425 v20140614 2014-06-14 14:38:13 +09:00
Yamashita Yuu
6efe6dafe7 Changed versioning scheme; 0.4.0-20140602 -> 20140602 2014-06-04 13:40:16 +09:00
Mislav Marohnić
13a474c4e9 Get rid of explicit exit in fish branch of rbenv-init
Allows for code to be added to the end of the script which will not
mysteriously fail to run for fish shell.
2014-06-03 00:39:34 +07:00
Yamashita Yuu
d378b274d9 v20140602 2014-06-02 11:27:24 +09:00
Yamashita Yuu
033529915e v20140520 2014-05-20 12:28:04 +09:00
Yamashita Yuu
ef8c8b8ef2 v20140516 2014-05-16 21:07:19 +09:00
Yamashita Yuu
0c81002220 Prefer gawk over awk if both are available. 2014-05-01 13:09:55 +09:00
Adam Harvey
808527b5d0 Prefer gawk over awk if both are available. 2014-04-18 10:40:56 +10:00
Yamashita Yuu
3cde540ca0 v20140404 2014-04-04 13:16:27 +09:00
Yamashita Yuu
34065dddbb reads only the first word from file 2014-03-24 19:42:52 +09:00
Yamashita Yuu
ea9214bb2e ignores carriage returns 2014-03-24 18:15:40 +09:00
Vincent Robert
b025dfcf58 Add \r to IFS instead of removing it manually 2014-03-21 01:36:39 +01:00
Vincent Robert
f50cee2ac7 Simplify bash expression 2014-03-20 16:52:45 +01:00
Vincent Robert
2fd3b18d39 Remove carriage return characters in version file
When created on Windows, .rbenv-version or .ruby-version files may have CR characters that will prevent rbenv from correctly parsing the Ruby version. Discard those characters when reading the file.
2014-03-20 11:30:27 +01:00
Yamashita Yuu
0d51899e9b v0.4.0-20140317 2014-03-17 21:51:40 +09:00
Daniel Hahler
44c20af80e Optimize pyenv-which: implement remove_from_path in Bash
This greatly improves the performance of `pyenv virtualenvwrapper_lazy`,
which happens to call pyenv-which a lot.

For profiling I've initially used:

    % zmodload zsh/zprof
    % eval "$(pyenv init -)"
    % pyenv virtualenvwrapper_lazy

    Before:
    % zprof|grep -E '(pyenv|virtualenv)'
     1)    1         754,07   754,07   58,95%    751,50   751,50   58,75%  pyenv
    21)    1           2,57     2,57    0,20%      2,57     2,57    0,20%  virtualenvwrapper_setup_lazy_loader
     1)    1         754,07   754,07   58,95%    751,50   751,50   58,75%  pyenv
           1/1         2,57     2,57    0,20%      2,57     2,57             virtualenvwrapper_setup_lazy_loader [21]
           1/1         2,57     2,57    0,20%      2,57     2,57             pyenv [1]
    21)    1           2,57     2,57    0,20%      2,57     2,57    0,20%  virtualenvwrapper_setup_lazy_loader

    After:
    % zprof|grep -E '(pyenv|virtualenv)'
     1)    1         383,30   383,30   27,97%    380,88   380,88   27,79%  pyenv
    31)    1           2,42     2,42    0,18%      2,42     2,42    0,18%  virtualenvwrapper_setup_lazy_loader
     1)    1         383,30   383,30   27,97%    380,88   380,88   27,79%  pyenv
           1/1         2,42     2,42    0,18%      2,42     2,42             virtualenvwrapper_setup_lazy_loader [31]
           1/1         2,42     2,42    0,18%      2,42     2,42             pyenv [1]
    31)    1           2,42     2,42    0,18%      2,42     2,42    0,18%  virtualenvwrapper_setup_lazy_loader

Fixes https://github.com/yyuu/pyenv-virtualenvwrapper/issues/13
2014-03-13 19:21:32 +01:00
Yamashita Yuu
65ae0a3261 v0.4.0-20140311 2014-03-11 11:55:44 +09:00
Yamashita Yuu
e835d447ed v0.4.0-20140211 2014-02-11 12:11:38 +09:00
Yamashita Yuu
73d5ea7426 v0.4.0-20140123 2014-01-23 19:14:26 +09:00
Yamashita Yuu
9c82314570 Unset GREP_OPTIONS to avoid unexpected grep behavior (fixes #101) 2014-01-23 11:11:56 +09:00
Yamashita Yuu
314937d599 Set PYENV_BIN_PATH in PATH even if the version is system (fixes #98) 2014-01-15 16:41:06 +09:00
Yamashita Yuu
a7f5a19a24 v0.4.0-20140110.1 2014-01-10 15:04:16 +09:00
Yamashita Yuu
38eb9fe948 v0.4.0-20140110 2014-01-10 11:27:43 +09:00
kou1okada
5c1094adb9 Response enhancement for in the case of the working directory under the UNC path.
finding_local_version_file is extremely slow, when working directory is under the UNC path.
Because //host/.rbenv-version and //.rbenv-version do not exist, but testing them is so slow.
It's the reason to make a serious delay of the response, when the Ruby runs with a current working directory under the UNC path under Cygwin environment.

A response of before applying this patch.
//somehost/somedir $ time ruby -e "exit"

real    0m13.922s
user    0m0.168s
sys     0m0.287s

A response of after applying this patch.
//somehost/somedir $ time ruby -e "exit"

real    0m0.721s
user    0m0.153s
sys     0m0.319s
2014-01-09 15:31:29 +09:00
Yamashita Yuu
71a916faf2 simplicy the check for infinite loop 2014-01-08 10:54:11 +09:00
Yamashita Yuu
4c5ffc8d99 Avoid infinite loop in case where pwd returns relative path
The `pwd` may return relative path if the `$PWD` is badly declared
in bash/zsh (e.g. `PWD="." bash`). To avoid the infinite loop in
`find_local_version_file()`, stop finding the version file if the
target paths are same consecutively.
2014-01-03 08:35:39 +09:00
Yamashita Yuu
8dc4e8d6f8 Revert "Merge branch 'golang-workaround'"
This reverts commit 7edceff71c, reversing
changes made to 5dea3c9e63.
2014-01-03 07:39:52 +09:00
Mislav Marohnić
1a6bada94c Fix detecting parent shell on OpenBSD and Cygwin
It seems that "comm" header can't be relied on cross-platform, but that
"ucomm" is more portable. I have no idea whether it's the right value to
use here, but it seems to be doing the job.

Also strip trailing whitespace because OpenBSD 5.4 `ps` output is padded
with spaces for some reason.

Fixes #489
2014-01-02 22:36:03 +01:00
Mislav Marohnić
eda535a942 Fix detecting completions support on OpenBSD
The non-extended regex pattern didn't work on OpenBSD so this switches
grep to extended pattern mode that seems to work consistenty on all
systems.
2014-01-02 22:33:54 +01:00
Yamashita Yuu
1587d8a03c Apply readlink to output from pwd may returns "." to get actual path 2014-01-03 05:07:21 +09:00
Yamashita Yuu
5dea3c9e63 Import changes from recent rbenv 2014-01-03 04:58:44 +09:00
Yamashita Yuu
3dd9332eee Fix broken tests 2014-01-03 04:33:30 +09:00
Yamashita Yuu
f538169992 Restore OLDIFS expectedly 2014-01-03 01:47:10 +09:00
Yamashita Yuu
d03f290b5d s/rbenv/pyenv/ 2014-01-02 22:49:23 +09:00
Yamashita Yuu
8ddf8760d5 Import recent changes from rbenv 0.4.0 2014-01-02 22:45:02 +09:00
wmoxam
2f5d9a6f90 Fixes rbenv on OpenBSD and any other systems that don't support head -c 2013-12-31 01:44:36 -05:00
Mislav Marohnić
be5e1a4ded Improve rbenv init instructions for fish
Fish user config file `~/.config/fish/config.fish` loads for every
instance of fish shell, not just interactive ones. Since it's
unnecessary and dangerous to eval `rbenv init -` output in
non-interactive shells, wrap the invocation in a conditional that checks
if the current shell is interactive.

Fixes #501
2013-12-06 16:45:22 +01:00
Yamashita Yuu
5bff9c773a Reliably detect parent shell in pyenv init (fixes #93)
Imported changes from sstephenson/rbenv#453.
2013-12-26 13:48:43 +09:00
Yamashita Yuu
3d5156ed1d v0.4.0-20131217 2013-12-17 11:46:44 +09:00
Yamashita Yuu
fe07deb193 v0.4.0-20131216 2013-12-16 13:51:48 +09:00
Tanix
fd3dd225ba rewrite strip of PYENV_PREFIX_PATH in a single line 2013-12-12 23:05:31 +09:00
Tanix
140808e3d4 Fix pyenv-prefix to trim "/bin" in pyenv prefix system 2013-12-12 22:16:43 +09:00
Yamashita Yuu
5e20237f5b v0.4.0-20131116 2013-11-16 19:29:30 +09:00
Mislav Marohnić
95a039aaaa Revert "rbenv exec: avoid mutating PATH"
It was supposed to fix shelling out to Ruby but it in fact broke another
kind of shelling out to Ruby: invoking the `ruby` binary directly with
the `-S` flag.

Fixes #480

This reverts commit db143bb654.
2013-11-03 12:18:28 +02:00
Mislav Marohnić
f1fdb9bbc8 Avoid invoking hash -r in fish
It doesn't exist as a builtin, and it doesn't seem there is a way to
detect support for a shell builtin that is portable. So, just detect
fish and don't the rehash command at all.

Fixes #478
2013-10-31 20:18:14 +02:00
Mislav Marohnić
44e76bea23 Merge pull request #372 from sstephenson/exec-next
Change `exec` semantics to allow using rbenv from a ruby process
2013-10-29 18:53:33 -07:00
Mislav Marohnić
681435e0b4 Simplify version-file-read to avoid process substitution
Process substitution seems to be causing problems with some versions of
bash on specific systems.

Fixes #401
2013-10-30 02:33:49 +01:00
Yamashita Yuu
a2ab3bc32c v0.4.0-20131023 2013-10-23 15:19:33 +09:00
Mislav Marohnić
3300587c6b strip initial - from the name of shell process
Avoids the case where shell detection would result in
`basename "-bash"` invocation, triggering the error:

    basename: illegal option -- b

fixes #462
2013-10-07 14:19:37 +02:00
Mislav Marohnić
878bd87328 reliably detect parent shell in rbenv init
`$SHELL` variable is a terrible way of detecting the current shell
because it's not even supposed to reflect the current shell; it's meant
for keeping the value of the default shell for programs to start.

If an explicit `<shell>` argument wasn't passed to `rbenv init`, it
tries to detect the shell by getting the name of its parent process. If
this fails, it falls back on the value of `$SHELL` as before.

Furthermore, `rbenv init` will set the RBENV_SHELL variable in the
current shell to the value of the detected shell so that `sh-shell` and
`sh-rehash` commands don't have to repeat the detection.
2013-10-07 03:24:45 +02:00
Mislav Marohnić
f4fade3d26 better error message for rbenv prefix system
Have `rbenv prefix` handle the case where system Ruby is not installed,
i.e. `rbenv which ruby` doesn't find ruby in PATH.

Fixes #362
2013-10-03 21:42:52 +02:00
Mislav Marohnić
e97326845c Ubuntu fix: don't use . in place of source
If `rbenv init -` outputs `.` in place of `source` and that gets eval'd
by the desktop manager via `~/.profile`, it chokes and prevents the user
from logging in.

Fixes #457
2013-10-03 16:12:24 +02:00
Yamashita Yuu
6e749ef12f Import recent changes relating to fish from rbenv 2013-09-30 18:02:12 +09:00
Mislav Marohnić
5ae2cac088 fix rbenv() function in ksh and dash
ksh syntax becomes:

    function rbenv {
      typeset command

`typeset` only declares a local variable if there's an explicit
`function` declaration; otherwise the variable leaks.

Other shells use this syntax:

    rbenv() {
      local command

This is for dash compatibility, which supports neither `function` nor
`typeset`.

references #205, fixes #408
2013-09-28 16:12:53 +02:00
Mislav Marohnić
31fab8cdae cleanup in fish
Use process subtitution syntax:

    . (rbenv init -|psub)

instead of:

    eval (rbenv init -)

because the latter doesn't work well with newlines.
2013-09-28 16:12:43 +02:00
Yamashita Yuu
5bfec84432 add fish shell support 2013-09-28 16:11:02 +02:00
Jeffrey 'jf' Lim
caa4a8e228 fix rehash when paths have spaces in them
fixes #450
2013-09-26 01:42:34 +02:00
Mislav Marohnić
bdcc2e1790 check if completion script is readable
fixes #444
2013-09-09 09:53:50 +02:00
Yamashita Yuu
683036298e fish doesn't have builtin command equivalent to bash's hash -r. 2013-08-15 22:56:57 +09:00
Yamashita Yuu
93b536863f Support fish shell 2013-08-15 22:56:53 +09:00
Yamashita Yuu
403f4eb7a7 Preserve original IFSs 2013-08-15 22:29:47 +09:00
Yamashita Yuu
ce66352f6d v0.4.0-20130726 2013-07-26 16:59:51 +09:00
Yamashita Yuu
1a6eb80bcd should not declare IFS in toplevel 2013-06-21 19:37:58 +09:00
Mislav Marohnić
db143bb654 rbenv exec: avoid mutating PATH
Enables shelling out from a ruby process started with rbenv to a ruby
process with a different RBENV_VERSION. Fixes #121

This removes the workaround created for #15 and solves `ruby -S` support
by setting RUBYPATH. PATH is never changed.

To illustrate how RUBYPATH changes in various configurations:

    PATH=~/bin:~/.rbenv/shims:/usr/bin:/bin
    RBENV_VERSION=1.8 ruby -S rake
    #=> executes ~/.rbenv/versions/1.8/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/1.8/bin:/usr/bin:/bin

    RBENV_VERSION=2.0 ruby -S rake
    #=> executes ~/.rbenv/versions/2.0/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/2.0/bin:/usr/bin:/bin

    RBENV_VERSION=system ruby -S rake
    #=> executes /usr/bin/rake
    #=> RUBYPATH=~/bin:/rbenv_shims_were_here:/usr/bin:/bin

    RBENV_VERSION=1.8 ruby -S rake
    #=> executes ~/.rbenv/versions/1.8/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/1.8/bin:/usr/bin:/bin
2013-06-20 20:41:22 +02:00
Yamashita Yuu
cc9c72747a v0.4.0-20130613 2013-06-13 20:52:10 +09:00
James FitzGibbon
81bb14e181 bail out early if readlink is not available
readlink comes from GNU coreutils.  On systems without it, rbenv used to
spin out of control when it didn't have readlink or greadlink available
because it would re-exec the frontend script over and over instead of the
worker script in libexec.

Fixes #389
2013-06-07 19:16:38 +02:00
Yamashita Yuu
319000b448 pyenv-prefix returns wrong prefix if system is given in the middle of arguments. 2013-06-04 17:35:23 +09:00
Yamashita Yuu
1b7d3b0502 move pyenv-sh-{push,pop} into plugins since they aren't from rbenv 2013-06-01 15:14:18 +09:00
Yamashita Yuu
c24207428c remove useless definition of PYENV_VERSION_PATH 2013-05-16 18:21:37 +09:00
Ian Yang
6ca591ab75 restore original IFS for hooks 2013-04-16 14:01:43 +02:00
Mislav Marohnić
ab197ef51e add tests for version commands 2013-04-08 23:16:35 +02:00
Alisdair Sullivan
497911d6c0 improve detection of completion support for commands
Enable JavasCript, Lua and Erlang scripts to provide completions
2013-04-01 16:39:51 +02:00
Mislav Marohnić
400fe31061 fix exec fails for invalid version 2013-04-01 03:01:37 +02:00
Mislav Marohnić
baf7656d2f fix iterating through paths that have spaces in them
Fixes #344, #196
2013-04-01 01:04:19 +02:00
Shohei Yamasaki
2bbf49b2f5 replace tab with spaces 2013-03-23 22:37:25 +09:00
Tim Pope
03fa148e81 Don't duplicate shims in PATH 2013-03-20 13:16:02 +01:00
Mislav Marohnić
ea3203dbab fix resolving symlinks in rbenv-hooks 2013-03-08 14:35:46 -05:00
Mislav Marohnić
bb6bccb782 tests galore 2013-03-07 15:07:32 -05:00
Mislav Marohnić
1fe59e41ea error message when rehash fails on non-writable directory
Fixes #238
2013-03-07 00:13:50 -05:00
YanhaoYang
13f36e0416 rbenv(): preserve multiline output of sh-* commands 2013-02-22 15:42:31 +01:00
Yamashita Yuu
dbb1fb5a06 release 0.2.0 2013-02-18 12:39:35 +09:00
Yamashita Yuu
ea7dc5f1e1 fix inverted result of checking version existence (refs #7) 2013-02-07 16:50:20 +09:00
Yamashita Yuu
167ff2a198 s/Ruby/Python/g; s/RBENV/PYENV/g 2013-02-06 16:05:29 +09:00
Yamashita Yuu
ee3c9bef5e fix typo; s/vesions/versions/
also this will fix https://github.com/yyuu/python-virtualenv/issues/1
2013-02-01 12:46:57 +09:00
Yamashita Yuu
a0705cb86e fix shell syntax error. add missing `then'. 2013-01-28 12:53:18 +09:00
Sam Stephenson
e3f72ebae2 Guard against exported CDPATH (fixes #316) 2013-01-25 12:02:11 -06:00
Sam Stephenson
98f45695db Suppress shell warnings when hashing is disabled by set +h 2013-01-25 11:50:37 -06:00
Sam Stephenson
3cb95b4d2d Add rbenv --debug <command> as a shortcut for setting RBENV_DEBUG=1 2013-01-23 19:07:37 -06:00
Sam Stephenson
892aea138e Export PS4 when RBENV_DEBUG is set for more informative debug output 2013-01-23 19:07:37 -06:00
Yamashita Yuu
fca31c4307 import trivial changes from rbenv 0.4.0 2013-01-18 19:10:35 +09:00
Yamashita Yuu
684f7b7f21 add support for .python-version file to store local python version 2013-01-18 19:10:30 +09:00
Yamashita Yuu
da06998457 import rbenv-help from rbenv 0.4.0 2013-01-18 19:09:56 +09:00
Yamashita Yuu
f466679bd1 import pyenv---version from rbenv 2013-01-17 23:17:41 +09:00
Leo Cassarani
1d687ac734 Fix incorrect formatting of rbenv-help output under MAWK
In systems that use the MAWK interpreter (the default AWK installed with
Ubuntu), the output of `rbenv help <command>` would have no line breaks.
The issue is fixed by changing `gsub` to `sub` in the snippet of awk
commands that are used to extract documentation comments.

I suspect the bug is something to do with the way the '^' and '$'
characters are interpreted by different AWK interpreters (per-line vs
per-string anchors).

If I understand correctly, the purpose of trim() is to remove all line
breaks from the start and end of each sections of a command's
documentation, in which case `sub` should serve the same purpose.
2013-01-05 16:55:19 +00:00
Mislav Marohnić
cd940bd797 typo in docs 2013-01-04 23:26:01 +01:00
Sam Stephenson
9375e99f92 rbenv 0.4.0 2013-01-04 12:27:26 -06:00
Sam Stephenson
266d896871 Prioritize rbenv local over rbenv global and rbenv shell 2013-01-03 10:40:28 -06:00
Sam Stephenson
e56885f4c9 "binary" -> "executable" 2013-01-03 10:06:12 -06:00
Sam Stephenson
149f4b4607 "per-project" -> "application-specific" 2013-01-03 10:00:10 -06:00
Sam Stephenson
80750f730f Merge pull request #302 from sstephenson/ruby-version
Support for .ruby-version files
2013-01-03 07:32:02 -08:00
Sam Stephenson
919c4240fc Clarify that .rbenv-version is removed when migrating 2013-01-02 12:51:47 -06:00
Sam Stephenson
44c2378f2a Shims include the full path to rbenv
This makes it possible to execute rbenv shims without rbenv's bin
directory in the path.
2013-01-01 13:27:39 -06:00
Sam Stephenson
d2a8ca7d89 Tweak the ruby- prefix warning 2012-12-31 09:58:10 -06:00
Sam Stephenson
d4faae187a Read both .ruby-version and .rbenv-version, but write (and migrate to) .ruby-version 2012-12-30 21:20:29 -06:00
Sam Stephenson
5e52fae7c1 Accept "ruby-" version prefix but print a warning to stderr 2012-12-30 19:01:30 -06:00
Sam Stephenson
b974bf54dc Prefer .ruby-version to .rbenv-version for reading local versions 2012-12-30 18:35:20 -06:00
Sam Stephenson
4b6c91e827 Usage consistency 2012-12-30 16:00:53 -06:00
Sam Stephenson
51467dc4a3 Include install and uninstall in help if ruby-build is installed 2012-12-30 15:30:37 -06:00
Sam Stephenson
37eca782cc Documentation tweaks 2012-12-29 22:05:04 -06:00
Sam Stephenson
19666f2598 Wrap documentation comments at 70 columns 2012-12-29 21:50:38 -06:00
Mislav Marohnić
3436bddaea new-style documentation for most commands 2012-12-29 23:34:53 +01:00
Mislav Marohnić
5cc6b0e3d3 allow indented lines in help text
Before, lines of help that were indented were stripped away.
2012-12-29 22:48:28 +01:00
Mislav Marohnić
2b21e22e97 display help for commands that have Summary but not Usage
A command doesn't have to specify Usage docs if it doesn't accept any
arguments. The default usage for a command will be printed as:

    Usage: rbenv ${command}
2012-12-29 22:14:54 +01:00
Sam Stephenson
57df945738 Don't print version before help summary (bare rbenv already does this) 2012-12-29 12:19:06 -06:00
Sam Stephenson
e2e474c59d Add rbenv help --usage 2012-12-29 12:12:47 -06:00
Sam Stephenson
4c19dc22d7 Improve syntax for inline documentation and allow for multi-line usage 2012-12-29 12:06:20 -06:00
Sam Stephenson
ef44b4ccac Merge branch 'master' into help 2012-12-29 11:23:23 -06:00
Mislav Marohnić
8ee2f2657a avoid prepending system ruby to PATH
System ruby is already on PATH (that's the definition of system ruby) and by
duplicating its path by putting it in front, we can break the user's
environment.

Fixes #275
2012-12-29 00:17:16 +01:00
Sam Stephenson
e0b8938fef Merge pull request #299 from sstephenson/automatic-local-exec
Automatic local exec
2012-12-28 09:05:24 -08:00
Sam Stephenson
811ca05916 Run hash -r after rbenv rehash when shell integration is enabled
Fixes #119
2012-12-28 10:59:10 -06:00
Sam Stephenson
df9bbd7ab3 Speed up rbenv-rehash with a simpler indexing approach 2012-12-27 17:16:57 -06:00
Sam Stephenson
339e331f1d Ensure outdated shims are removed first when rehashing 2012-12-27 13:42:25 -06:00
Sam Stephenson
283e67b57e When the ruby shim is invoked with a script, set RBENV_DIR to the script's dirname 2012-12-27 13:41:55 -06:00
Sam Stephenson
6c1fb9ffd0 Fall back to $PWD if a local version file can't be found in $RBENV_DIR 2012-12-27 13:39:36 -06:00
Yamashita Yuu
5b14236bac fix "system" handling 2012-12-19 23:58:39 +09:00
Yamashita Yuu
a16355fe33 fix wrong link to the README in the help message 2012-12-14 18:45:28 +09:00
Sam Stephenson
1ebcbd92e2 Tweak rbenv --version output 2012-12-13 11:26:39 -06:00
Mislav Marohnić
3060578e3b use typeset instead of local in rbenv() function
This is to insure portability to ksh.

Fixes #205, references #209
2012-12-13 06:01:26 +01:00
Mislav Marohnić
b8715bfee6 foundation for a help system where each command holds its own docs
Docs are comprised from "Usage", "Summary" and "Help" sections, where
"Help" can span multiple commented lines. If it is missing, "Summary" is
shown in its place.

References #204, references #206
2012-12-13 05:48:28 +01:00
Sam Stephenson
7fe9231e64 Fix rbenv prefix for system version
Should be `/usr` or `/usr/local`, not `/usr/bin` or `/usr/local/bin`
2012-12-12 21:40:57 -06:00
Sam Stephenson
9289af0132 Don't include system in rbenv versions --bare output 2012-12-12 21:40:57 -06:00
Mislav Marohnić
1f7722088d make shell return an error code in case of failure
Fixes #274
2012-12-13 02:58:41 +01:00
Mislav Marohnić
e548877ead have versions also list "system" if it exists
Closes #263
2012-12-13 01:52:52 +01:00
Mislav Marohnić
21391c8d2f put up a note why version-file-read is tricky 2012-12-13 01:45:06 +01:00
Roy Liu
99551dd1ec fix rbenv-which with system ruby
Don't have `command -v` abort the whole script prematurely.
2012-12-13 01:00:24 +01:00
Mislav Marohnić
b5a26936e8 rbenv --version 2012-12-13 00:40:29 +01:00
Ruben Verborgh
cf28136003 speed up rbenv-init
Use `rbenv-commands` instead of `rbenv commands`. The latter
unnecessarily goes through `rbenv` executable.

Fixes #254
2012-12-13 00:18:32 +01:00
Guillermo Iguaran
0ce6fad14e Merge pull request #287 from mislav/versions-fix
fix `versions` in case current version doesn't exist
2012-12-12 14:12:39 -08:00
Mislav Marohnić
0ff3ca8a12 fix obsolete usage instruction 2012-12-12 00:32:27 +01:00
Mislav Marohnić
47c8a0e0b8 fix versions in case current version doesn't exist
`rbenv-versions` tries to read the current version to display a marker
next to it, but if that fails the whole script aborts.

This change makes it so that the failures from `rbenv-version-name` are
tolerated. It also makes the `--bare` mode never call it in the first
place, because it doesn't need to display a marker.
2012-12-12 00:25:02 +01:00
Yamashita Yuu
d09af20897 0.1.3git 2012-10-23 15:25:18 +09:00
Yamashita Yuu
b520475b22 release 0.1.2 2012-10-23 15:24:41 +09:00
Yamashita Yuu
e8ad78f837 add pyenv push and pyenv pop to manage version stack 2012-10-03 12:19:42 +09:00
FUSE Yoshio
f3ae8fd904 fix typo in function name 2012-09-09 21:45:44 +09:00
Yamashita Yuu
4174749b24 replace tr by shell's IFS 2012-09-07 20:10:10 +09:00
Yamashita Yuu
e89ae3a4a9 show all enabled versions (maybe multiple) in pyenv versions 2012-09-07 19:56:55 +09:00
Yamashita Yuu
13122ca9bf fixed to read multiple versions from PYENV_VERSION environment variable 2012-09-07 19:16:42 +09:00
Yamashita Yuu
34a4a532b2 0.1.2git 2012-09-03 19:40:49 +09:00
Yamashita Yuu
d08fcc522e release 0.1.1 2012-09-03 19:40:30 +09:00
Yamashita Yuu
da659739d2 fixed pyenv shell. we cannot carry out bash array via envvars. 2012-08-31 20:12:26 +09:00
Yamashita Yuu
dff57ae35d s/PYENV_VERSIONS/PYENV_VERSION/ for backward compatibility. 2012-08-31 19:39:29 +09:00
Yamashita Yuu
8187bc84e3 search commands from python version stack.
users can use multiple python versions at once.
2012-08-31 16:09:46 +09:00
Yamashita Yuu
880ea61dd8 0.1.1git 2012-08-31 15:59:36 +09:00
Yamashita Yuu
2457419b4a created new project.
modified rbenv source for Python and renamed to pyenv.
2012-08-31 15:30:20 +09:00
Alec Chen
3a94daeaf8 remove "+=" operator to support bash-3.0 2012-04-23 22:11:19 +08:00
Gabriel Horner
d3700dfd70 help for versions and commands, including their options 2012-03-23 16:21:53 -04:00
Andrew Marshall
9c43fa9161 Prevent $command from leaking outside of function 2012-02-04 18:05:43 -05:00
Antonio Terceiro
d1bfeee334 Add /usr/lib/rbenv/hooks to hook search path
This will help with the packaging of rbenv plugin that contain hooks in
Debian.
2012-01-26 20:23:31 -02:00
John Williams
f40bc773d2 Allow init arguments to be in any order. 2012-01-17 08:50:40 -06:00
Sam Stephenson
5d0a6630b9 Account for path entries with spaces in remove_from_path 2011-12-30 13:40:22 -06:00
Sam Stephenson
114b81c9a4 Use if instead of inline && so rbenv rehash exits with a zero status 2011-12-26 20:12:16 -06:00
Sam Stephenson
b10bdb1e78 rbenv 0.3.0 2011-12-25 21:32:48 -05:00
Sam Stephenson
ee5ad02d42 Add --no-rehash option to rbenv-init (#170) 2011-12-25 20:59:24 -05:00
Sam Stephenson
cd2094ff71 Remove deprecated set-default and set-local commands 2011-12-25 20:39:11 -05:00
Sam Stephenson
7fbcde8af0 Properly expand RBENV_DIR and ensure it exists 2011-12-25 16:41:15 -05:00
Sam Stephenson
b670849ebd Merge remote-tracking branch 'mlafeldt/rbenv-rehash'
Conflicts:
	libexec/rbenv-rehash
2011-12-24 18:03:10 -05:00
Sam Stephenson
288c6b3f09 Go with paren-style function definition 2011-12-24 17:49:22 -05:00
Sam Stephenson
802d70568c Merge pull request #168 from mgrubb/topic/portability-fixes
Made ksh portability changes
2011-12-24 14:48:34 -08:00
Sam Stephenson
efe600f6de Ensure shims don't disappear when rehashed 2011-12-24 15:16:37 -05:00
Michael Grubb
7e83e07cf3 Made ksh portability changes
Added specific message for ksh in identifying the proper shell
initialization file.

Changed rbenv functiond definition to be more portable.
Shell functions should be defined by using the function command or
using the parenthesis grammar, but using both is not portable:

rbenv() {...  -or-
function rbenv { ...
2011-12-15 14:54:38 -06:00
Per Velschow
dfc7645609 Quoting the argument to greadlink to make it work with paths containing spaces. 2011-11-18 21:21:16 +01:00
Mathias Lafeldt
9dde161b65 rbenv-rehash: use $OLDPWD to restore previous working directory
$OLDPWD is a standard shell variable that contains the previous working
directory as set by the "cd" command. No need to save $PWD to some
custom variable.

(We could also have used "cd -" but it prints out $OLDPWD too.)
2011-11-14 22:30:47 +01:00
Mathias Lafeldt
0324b118ee rbenv-rehash: remove superfluous trap signals
A trap on the special signal EXIT is executed before the shell
terminates. EXIT actually covers SIGINT and SIGTERM as well, and
we don't need any extra traps for them.

See bash(1) and "help trap" in bash.
2011-11-14 22:30:47 +01:00
Joshua Peek
be7dcc0ad8 Add rbenv root
Prints $RBENV_ROOT (defaults to ~/.rbenv)
2011-11-10 10:54:30 -06:00
Sam Stephenson
01a0ad0b69 rbenv 0.2.1 2011-10-01 12:26:19 -05:00
Sam Stephenson
e49be969ab Ensure RBENV_DIR is always an absolute path
Otherwise, `RBENV_DIR=bin rbenv version-file` loops indefinitely
2011-10-01 12:15:20 -05:00
Sam Stephenson
2cd12e3fa6 rbenv 0.2.0 2011-09-28 13:38:03 -05:00
Joshua Peek
149e61a649 Don't exit out of piped loop
Can cause the stdin of cat to close too soon causing:

  echo: write error: Broken pipe

Fixes #97
2011-09-28 12:08:34 -05:00
Sam Stephenson
72b62e13aa Make rbenv help a little nicer 2011-09-28 10:59:02 -05:00
Sam Stephenson
ada26ab92e Document rbenv which and rbenv whence 2011-09-28 10:48:04 -05:00
Sam Stephenson
058e2cb7a6 Add rbenv shell to help 2011-09-28 10:21:57 -05:00
Sam Stephenson
0a4ffcd15f Global version file is now ${RBENV_ROOT}/version
This is the last time it'll change. Promise.
2011-09-28 09:45:58 -05:00
Sam Stephenson
07815769ae RBENV_DIR sets the directory from which .rbenv-version files are scanned 2011-09-27 15:50:39 -05:00
Sam Stephenson
10084ae020 Automatically add ${RBENV_ROOT}/plugins/*/etc/rbenv.d to $RBENV_HOOK_PATH 2011-09-23 10:47:45 -05:00
Sam Stephenson
8ce5e84c21 Automatically add ${RBENV_ROOT}/plugins/*/bin to $PATH 2011-09-23 10:44:00 -05:00
Sam Stephenson
f9fb3c934e rbenv-plugin-scripts -> rbenv-hooks; RBENV_PLUGIN_PATH -> RBENV_HOOK_PATH 2011-09-23 10:43:06 -05:00
Joshua Peek
eae5e5e092 realpath plugin scripts 2011-09-22 19:15:00 -05:00
Joshua Peek
a238099e38 Include /usr/local/etc hooks 2011-09-22 19:08:03 -05:00
Sam Stephenson
699cd8c203 Quote script path and remove unnecessary semicolon 2011-09-21 13:05:08 -05:00
Sam Stephenson
096743acde Add support for RBENV_PLUGIN_PATH environment variable 2011-09-21 13:00:23 -05:00
Sam Stephenson
0c7c62dc04 Show usage if no arguments are passed to rbenv-plugin-scripts 2011-09-21 12:43:22 -05:00
Joshua Peek
2b5fb40b99 Not exec specific 2011-09-21 12:39:26 -05:00
Joshua Peek
96b98ed039 Use plugin-scripts 2011-09-21 12:38:58 -05:00
Joshua Peek
789ace54ec Add bin to list plugin scripts 2011-09-21 12:36:07 -05:00
Roy Liu
94d87211f9 Restore the current working directory in rbenv-rehash 2011-09-19 10:45:12 -04:00
Sam Stephenson
305db1c35b Fix rbenv-completions for shell commands. Closes #90. 2011-09-16 14:18:29 -05:00
Sam Stephenson
568cd4b23e Strip trailing slashes from RBENV_ROOT (#83) 2011-09-14 12:45:44 -05:00
Sam Stephenson
b4f8906b24 Update zsh completion adapter 2011-09-13 13:12:04 -05:00
Sam Stephenson
465a1472ba Completion for which 2011-09-13 13:02:55 -05:00
Sam Stephenson
3644840d4b Show usage for rbenv which without an argument 2011-09-13 13:01:31 -05:00
Sam Stephenson
03d664e048 Completion for whence 2011-09-13 12:59:59 -05:00
Sam Stephenson
61830048d5 Extract rbenv-shims 2011-09-13 12:55:19 -05:00
Sam Stephenson
69d596f56f Completion for commands 2011-09-13 12:48:49 -05:00
Sam Stephenson
4923838981 Completion for exec 2011-09-13 12:46:06 -05:00
Sam Stephenson
f1ca8906c0 Completions for global, local, prefix, shell 2011-09-13 12:38:34 -05:00
Sam Stephenson
43520db389 Fix rbenv prefix system 2011-09-13 12:37:29 -05:00
Sam Stephenson
d50ce90a36 Add --unset to local completion 2011-09-13 12:33:46 -05:00
Sam Stephenson
6da85246c6 Proof-of-concept external completions 2011-09-13 10:13:27 -05:00
Joshua Peek
964c12fe27 Ensure shims set RBENV_ROOT 2011-09-12 11:05:45 -05:00
Sam Stephenson
0632325a43 Set RBENV_DEBUG=1 to see what's going on under the hood 2011-09-12 10:11:59 -05:00
Sam Stephenson
2e3e141d2e RBENV_ROOT defaults to ~/.rbenv 2011-09-11 12:05:56 -05:00
Sam Stephenson
c36950a7cb RBENV_HOME -> RBENV_ROOT 2011-09-11 12:04:59 -05:00
Sam Stephenson
8f6b0bc1d4 Use RBENV_ROOT to search for rbenv-exec plugins 2011-09-11 12:00:02 -05:00
Sam Stephenson
7ac964353f RBENV_HOME -> RBENV_ROOT 2011-09-11 11:58:57 -05:00
Sam Stephenson
c6ce8fafd8 Merge remote-tracking branch 'alexrinass/systemwide' 2011-09-11 11:28:54 -05:00
Sam Stephenson
6fa81ef28d Add rbenv local --unset 2011-09-11 10:16:22 -05:00
Sam Stephenson
e5c0fd22e1 Exit with 0 status when a version file is read successfully 2011-09-11 10:16:08 -05:00
Sam Stephenson
fb6eee26d4 Only shift if an argument is passed. Fixes #78. 2011-09-10 20:10:07 -05:00
Sam Stephenson
1ba2ce0cb6 Fix quoting in rbenv function 2011-09-10 20:10:07 -05:00
Sam Stephenson
76929320c8 Make rbenv-sh-shell consistent with rbenv-local 2011-09-10 20:10:07 -05:00
Joshua Peek
5ad45afe5e Merge pull request #81 from eric/empty_path_to_remove_in_which
Deal with an empty result from expand_path
2011-09-09 15:05:34 -07:00
Eric Lindvall
b81b64453b Deal with an empty result from expand_path 2011-09-09 15:00:59 -07:00
Sam Stephenson
db2a94d4bc rbenv-version-name returns system for empty version files. Closes #62, #65, #77. 2011-09-09 15:52:31 -05:00
Joshua Peek
783a5700c4 reset isn't standard 2011-09-09 10:45:23 -05:00
Timothy King
555472210b Adds sh-shell subcommand to unset RBENV_VERSION 2011-09-09 08:22:03 -04:00
Timothy King
39497042bc Adds error handling to rbenv-sh-shell 2011-09-09 08:18:14 -04:00
Sam Stephenson
837bfc5aa9 Fix rbenv-version-file-read for version files without trailing newlines 2011-09-07 14:46:33 -05:00
Joshua Peek
042794b651 use -> shell 2011-09-07 10:26:11 -05:00
Joshua Peek
c928ba7a21 Include sh commands in default listing 2011-09-06 22:07:05 -05:00
Alexander Rinass
5130f0464a Support install locations other than $HOME/.rbenv.
Define RBENV_HOME env variable in libexec/rbenv and let all script delegates use this variable to determine rbenv's install location.
2011-08-25 09:28:01 +02:00
Joshua Peek
bff38d7e71 use command 2011-08-23 11:35:06 -05:00
Joshua Peek
f9225d9cb4 Define lightweight rbenv shell function to dispatch commands 2011-08-23 11:34:42 -05:00
Joshua Peek
5a4bee6eb5 List sh commands separately 2011-08-23 11:34:03 -05:00
Sam Stephenson
af36d449bf Exit after printing usage in rbenv-version-file-write 2011-08-18 15:28:35 -05:00
Sam Stephenson
5be66da9f4 Rename rbenv-default to rbenv-global 2011-08-18 14:35:00 -05:00
Sam Stephenson
506bc3634f Extract rbenv-version-file{,-read,-write} 2011-08-18 14:11:40 -05:00
Sam Stephenson
1d5c6531a2 Improve deprecation notice 2011-08-18 14:09:48 -05:00
Sam Stephenson
174e101799 Merge remote-tracking branch 'gma/drop-set-prefix' into drop-set-prefix 2011-08-18 12:50:06 -05:00
Sam Stephenson
113e037646 Move the nullglob declaration further up so a '*' shim isn't created when no Ruby versions are present. Fixes #45. 2011-08-17 17:53:37 -05:00
Sam Stephenson
7bbfecd9af Working on 0.2.0-pre now 2011-08-17 17:35:04 -05:00
Paul Mucur
b7e19b4953 Solaris doesn't support readlink so use greadlink if available instead.
Taken from Ryan Tomayko's "GNU is killing Solaris", c.f. http://tomayko.com/writings/gnu-is-killing-solaris
2011-08-16 22:26:57 +01:00
Sam Stephenson
49ecbe147f rbenv 0.1.2 2011-08-16 00:16:17 -05:00
Sam Stephenson
b45bce80ca Source the zsh autocompletion script in rbenv-init 2011-08-16 00:13:12 -05:00
Sam Stephenson
71b5965540 Use read instead of egrep for reading version files. Closes #41. 2011-08-16 00:01:03 -05:00
Sam Stephenson
6d6b1d6002 Run rbenv rehash on init 2011-08-15 01:18:04 -05:00
Sam Stephenson
dd8a005c7d Atomic rehash 2011-08-15 01:16:13 -05:00
Sam Stephenson
3efdf6a243 Guard against nonexistent entries in $PATH 2011-08-14 14:16:26 -05:00
Sam Stephenson
bd1e56ff37 rbenv 0.1.1 2011-08-14 13:51:51 -05:00
Samuel Cochran
a14095f299 Add "-h" and "--help" which work as expected 2011-08-14 21:30:13 +08:00
Graham Ashton
1ed231cb21 Report default or local version.
If no argument is passed to the default or local sub commands, report
the currently configured version.
2011-08-13 08:26:54 +01:00
Graham Ashton
7a0cde9a4e Remove set- prefix from local and default commands. 2011-08-13 08:26:54 +01:00
Andreas Johansson
6938692ca2 Fix argument that cannot be sent to bash via env
/usr/bin/env seems to have problems with arguments to bash on some
platforms. To bypass this, use set -e instead.
2011-08-12 11:33:45 +02:00
Chris Moore
aae721c5f1 fix typo in rbenv help 2011-08-11 17:43:57 -04:00
Sam Stephenson
5c11f14c9b rbenv 0.1.0 2011-08-11 14:48:40 -05:00
Sam Stephenson
71493e8065 Typo 2011-08-10 09:31:53 -05:00
Sam Stephenson
5394347500 A few tweaks to the help text 2011-08-10 09:23:43 -05:00
Ryan Baumann
f2f8ef88a5 Implement some basic command line help 2011-08-10 09:53:34 -04:00
Ryan Baumann
bd0e1a73f9 Split rbenv-version into rbenv-version-name and rbenv-version-origin, update versions, prefix, and which appropriately 2011-08-09 16:41:35 -04:00