"binary" -> "executable"

This commit is contained in:
Sam Stephenson 2013-01-03 10:06:12 -06:00
parent 149f4b4607
commit e56885f4c9
3 changed files with 18 additions and 17 deletions

View file

@ -57,15 +57,15 @@ rbenv correspond to subdirectories of `~/.rbenv/versions`. For
example, you might have `~/.rbenv/versions/1.8.7-p354` and example, you might have `~/.rbenv/versions/1.8.7-p354` and
`~/.rbenv/versions/1.9.3-p327`. `~/.rbenv/versions/1.9.3-p327`.
Each version is a working tree with its own binaries, like Each version is a working tree with its own executables, like
`~/.rbenv/versions/1.8.7-p354/bin/ruby` and `~/.rbenv/versions/1.8.7-p354/bin/ruby` and
`~/.rbenv/versions/1.9.3-p327/bin/irb`. rbenv makes _shim binaries_ `~/.rbenv/versions/1.9.3-p327/bin/irb`. rbenv makes _shim executables_
for every such binary across all installed versions of Ruby. for every such executable across all installed versions of Ruby.
These shims are simple wrapper scripts that live in `~/.rbenv/shims` These shims are simple wrapper scripts that live in `~/.rbenv/shims`
and detect which Ruby version you want to use. They insert the and detect which Ruby version you want to use. They insert the
directory for the selected version at the beginning of your `$PATH` directory for the selected version at the beginning of your `$PATH`
and then execute the corresponding binary. and then invoke the corresponding executable.
## Installation ## ## Installation ##
@ -131,9 +131,9 @@ easy to fork and contribute any changes back upstream.
As an alternative, you can download and compile Ruby yourself into As an alternative, you can download and compile Ruby yourself into
`~/.rbenv/versions/`. `~/.rbenv/versions/`.
6. Rebuild the shim binaries. You should do this any time you install 6. Rebuild the shim executables. You should do this any time you
a new Ruby binary (for example, when installing a new Ruby version, install a new Ruby executable (for example, when installing a new
or when installing a gem that provides a binary). Ruby version, or when installing a gem that provides a command).
~~~ ~~~
$ rbenv rehash $ rbenv rehash
@ -304,16 +304,16 @@ how it was set.
### rbenv rehash ### ### rbenv rehash ###
Installs shims for all Ruby binaries known to rbenv (i.e., Installs shims for all Ruby executables known to rbenv (i.e.,
`~/.rbenv/versions/*/bin/*`). Run this command after you install a new `~/.rbenv/versions/*/bin/*`). Run this command after you install a new
version of Ruby, or install a gem that provides binaries. version of Ruby, or install a gem that provides commands.
$ rbenv rehash $ rbenv rehash
### rbenv which ### ### rbenv which ###
Displays the full path to the binary that rbenv will execute when you Displays the full path to the executable that rbenv will invoke when
run the given command. you run the given command.
$ rbenv which irb $ rbenv which irb
/Users/sam/.rbenv/versions/1.9.3-p327/bin/irb /Users/sam/.rbenv/versions/1.9.3-p327/bin/irb

View file

@ -32,9 +32,9 @@ remove_prototype_shim() {
# The prototype shim file is a script that re-execs itself, passing # The prototype shim file is a script that re-execs itself, passing
# its filename and any arguments to `rbenv exec`. This file is # its filename and any arguments to `rbenv exec`. This file is
# hard-linked for every binary and then removed. The linking technique # hard-linked for every executable and then removed. The linking
# is fast, uses less disk space than unique files, and also serves as # technique is fast, uses less disk space than unique files, and also
# a locking mechanism. # serves as a locking mechanism.
create_prototype_shim() { create_prototype_shim() {
cat > "$PROTOTYPE_SHIM_PATH" <<SH cat > "$PROTOTYPE_SHIM_PATH" <<SH
#!/usr/bin/env bash #!/usr/bin/env bash
@ -130,7 +130,8 @@ remove_stale_shims() {
cd "$SHIM_PATH" cd "$SHIM_PATH"
shopt -s nullglob shopt -s nullglob
# Create the prototype shim, then register shims for all known binaries. # Create the prototype shim, then register shims for all known
# executables.
create_prototype_shim create_prototype_shim
remove_outdated_shims remove_outdated_shims
make_shims ../versions/*/bin/* make_shims ../versions/*/bin/*

View file

@ -4,8 +4,8 @@
# #
# Usage: rbenv which <command> # Usage: rbenv which <command>
# #
# Displays the full path to the binary that rbenv will execute when you # Displays the full path to the executable that rbenv will invoke when
# run the given command. # you run the given command.
set -e set -e
[ -n "$RBENV_DEBUG" ] && set -x [ -n "$RBENV_DEBUG" ] && set -x