You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.4 KiB
91 lines
2.4 KiB
13 years ago
|
Ruby
|
||
|
====
|
||
|
|
||
|
Configures [Ruby][1] local gem installation, loads version managers, and defines
|
||
|
aliases.
|
||
|
|
||
|
Local Gem Installation
|
||
|
----------------------
|
||
|
|
||
|
When a Ruby version manager is not detected, local gems are installed in
|
||
|
*~/Library/Ruby/Gems/1.8* on Mac OS X.
|
||
|
|
||
|
RVM
|
||
|
---
|
||
|
|
||
|
An alternative to the above is to use [The Ruby Version Manager (RVM)][2], which
|
||
|
allows for managing multiple, isolated Ruby installations and gem sets in the
|
||
|
home directory.
|
||
|
|
||
|
Since RVM is loaded into the shell and is known to override shell commands, it
|
||
|
may conflict with shell scripts.
|
||
|
|
||
|
rbenv
|
||
|
-----
|
||
|
|
||
|
An alternative RVM is to use [rbenv][3], which allows for switching between multiple,
|
||
|
isolated Ruby installations in the home directory.
|
||
|
|
||
|
While it is not as feature rich as RVM, it is not loaded into the shell and is
|
||
|
not known to cause conflicts with shell scripts.
|
||
|
|
||
|
Bundler
|
||
|
-------
|
||
|
|
||
|
Manage gems that are not meant to be used as commands, such as application
|
||
|
dependencies, with [Bundler][4].
|
||
|
|
||
|
Aliases
|
||
|
-------
|
||
|
|
||
12 years ago
|
### General
|
||
|
|
||
|
- `rb` is short for `ruby`.
|
||
|
|
||
13 years ago
|
### Bundler
|
||
|
|
||
12 years ago
|
- `rbb` manages ruby dependencies (`bundle`).
|
||
|
- `rbbe` executes a script in the context of the current bundle.
|
||
|
- `rbbi` installs the gems specified in the *Gemfile* in *vendor/bundle*.
|
||
|
- `rbbI` installs the following:
|
||
13 years ago
|
- gems specified in the *Gemfile* in *vendor/bundle*.
|
||
|
- packages the gems into *vendor/cache*.
|
||
|
- appends bundler directories to *.gitignore*.
|
||
12 years ago
|
- `rbbl` lists all gems in the current bundle.
|
||
|
- `rbbo` opens an installed gem in the editor.
|
||
|
- `rbbp` packages gem files into *vendor/cache*.
|
||
|
- `rbbu` updates gems to their latest version.
|
||
13 years ago
|
|
||
12 years ago
|
Functions
|
||
|
---------
|
||
|
|
||
11 years ago
|
- `ruby-app-root` displays the path to the Ruby application root directory.
|
||
12 years ago
|
- `ruby-info` exposes information about the Ruby environment via the
|
||
|
`$ruby_info` associative array.
|
||
|
|
||
|
Theming
|
||
|
-------
|
||
|
|
||
|
To display the name of the current Ruby version in a prompt, define the
|
||
12 years ago
|
following style in the `prompt_name_setup` function.
|
||
12 years ago
|
|
||
|
# %v - ruby version.
|
||
12 years ago
|
zstyle ':prezto:module:ruby:info:version' format 'version:%v'
|
||
12 years ago
|
|
||
|
Then add `$ruby_info[version]` to `$PROMPT` or `$RPROMPT` and call
|
||
12 years ago
|
`ruby-info` in the `prompt_name_preexec` hook function.
|
||
12 years ago
|
|
||
13 years ago
|
Authors
|
||
|
-------
|
||
|
|
||
|
*The authors of this module should be contacted via the [issue tracker][5].*
|
||
|
|
||
|
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||
|
|
||
|
[1]: http://www.ruby-lang.org
|
||
|
[2]: https://rvm.io
|
||
|
[3]: https://github.com/sstephenson/rbenv
|
||
|
[4]: http://gembundler.com
|
||
12 years ago
|
[5]: https://github.com/sorin-ionescu/prezto/issues
|
||
13 years ago
|
|