Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created August 21, 2009 18:38
Show Gist options
  • Save defunkt/172292 to your computer and use it in GitHub Desktop.
Save defunkt/172292 to your computer and use it in GitHub Desktop.

Revisions

  1. defunkt created this gist Aug 21, 2009.
    9 changes: 9 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # put this in ~/.bash_profile or whatever
    ruby_or_irb () {
    if [ "$1" == "" ]; then
    irb
    else
    ruby "$@"
    fi
    }
    alias ruby="ruby_or_irb"
    12 changes: 12 additions & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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