Skip to content

Commit

Permalink
Update to use new get-ruby-version function.
Browse files Browse the repository at this point in the history
Also refactor to pull out common irb arguments.
  • Loading branch information
mattfoster committed Jan 9, 2011
1 parent 1936448 commit 76ba962
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions 05_ruby
@@ -1,10 +1,20 @@
# Convenient. Also works in Gentoo or Ubuntu
if [[ -x $(which irb$(get_ruby_version)) ]]; then
alias irb='irb1.9.1 --readline -r irb/completion'
#
# Set up ruby
#
autoload -U get-ruby-version && get-ruby-version

# If you alias ruby to (say) ruby 1.9, this should update irb too.
# You might want to alias 'gem' here too, if you do, remember to update your path.
local irb_options="--readline -r irb/completion"

if [[ -x $(which irb$RUBY_VERSION) ]]; then
alias irb='irb$RUBY_VERSION $irb_options'
else
alias irb='irb --readline -r irb/completion'
alias irb="irb $irb_options"
fi

export RI='-f ansi --width 70'

if [[ -x `which fri` ]]; then
alias ri=fri
fi

0 comments on commit 76ba962

Please sign in to comment.