anildigital (owner)

Fork Of

Revisions

gist: 177993 Download_button fork
public
Public Clone URL: git://gist.github.com/177993.git
Embed All Files: show embed
Bash #
1
2
3
4
5
6
7
8
9
# put this in ~/.bash_profile or whatever
ruby_or_irb () {
  if [ "$1" == "" ]; then
irb
  else
ruby "$@"
  fi
}
alias ruby="ruby_or_irb"
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
# now `ruby` on its own launches irb
$ ruby -e "puts :hi"
hi
$ ruby -rubygems -e "puts :hi"
hi
$ ruby
>> :woot
=> :woot
# want to pass crap to your session? use irb
$ irb -rubygems
>> :tada
=> :tada