Skip to content

Instantly share code, notes, and snippets.

@nogweii
Forked from defunkt/gist:172292
Created August 21, 2009 18:55
Show Gist options
  • Save nogweii/172323 to your computer and use it in GitHub Desktop.
Save nogweii/172323 to your computer and use it in GitHub Desktop.
# put this in ~/.zshrc
# No alias needed! The `whence -p` does a path search.
function ruby() { [[ "$1" == "" ]] && irb || `whence -p ruby` $@ }
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment