Add Ruby Module.

Ruby is a popular language, and has a number of tools in its ecosystem
which support it.

RVM
-----

The most popular tool is RVM which lets you manage a multiplicity of
ruby interperters on your system in the event that you have a bunch of
different projects each requiring their own interpreter. If you have
RVM installed, this module sets it up for you.

Bundler
------

Lots of handly aliases for working with bundler which, is basically a
requirement for doing any sort of Ruby development.
This commit is contained in:
Charles Lowell 2018-04-06 13:13:39 -06:00 committed by Charles Lowell
parent e1a2a38a0f
commit 4a2df0e206
2 changed files with 55 additions and 0 deletions

29
modules/ruby/README.md Normal file
View File

@ -0,0 +1,29 @@
Ruby
===
Provides RVM integration and nice aliases for Ruby
RVM
---
If you have RVM installed, this will automatically set it up without
any required configuration to your dot files. To install RVM, see
http://rvm.io
Aliases
-------
### Ruby
- `rb` is short for `ruby`.
### Bundler
- `rbb` bundle install
- `rbbc` bundle clean
- `rbbe` bundle exec
- `rbbi` bundle install --path vendor/bundle
- `rbbl` bundle list
- `rbbo` bundle open
- `rbbp` bundle package
- `rbbu` bundle update

26
modules/ruby/init.zsh Normal file
View File

@ -0,0 +1,26 @@
# Load RVM into the shell session.
if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
# Unset AUTO_NAME_DIRS since auto adding variable-stored paths to ~ list
# conflicts with RVM.
unsetopt AUTO_NAME_DIRS
# Source RVM.
source "$HOME/.rvm/scripts/rvm"
fi
#
# Aliases
#
# General
alias rb='ruby'
# Bundler
alias rbb='bundle'
alias rbbc='bundle clean'
alias rbbe='bundle exec'
alias rbbi='bundle install --path vendor/bundle'
alias rbbl='bundle list'
alias rbbo='bundle open'
alias rbbp='bundle package'
alias rbbu='bundle update'