Differentiating JRuby executables from CRuby

2008.04.06 19:35

Now that I’ve installed JRuby alongside CRuby, I have a hard time knowing which gem or rake I’m running.

I fix this by running this script from my .bashrc:

export JRUBY_HOME=/usr/local/jruby
export PATH=$PATH:$JRUBY_HOME/bin

if [ -d $JRUBY_HOME ]; then
  for file in $JRUBY_HOME/bin/*; do
    alias jruby_`basename $file`=$file
  done
else
  echo "$JRUBY_HOME not found"
fi

Then I can run jruby_gem or jruby_rake and know it’s legitimate.

Comments? (moderated as hell)

allowed HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>