Ruby on Rails OSX Console Aliases 2

Posted by Tony Buser Thu, 18 Jan 2007 15:07:00 GMT

I found that every day when I goto work in the morning I do the same things whenever I go to work on a rails project:

  1. open firefox
  2. open iTerm
  3. cd ~/Code/railsprojectx
  4. mate .
  5. script/server
  6. open another tab in iTerm
  7. svn update
  8. goto http://localhost:3000

Sure it only takes a few seconds, but it wasn't very DRY. :) I figured I could create a shell alias to basically reduce all that to a single command. I also thought I'd finally start giving mongrel a try. So this is what I came up with for an rdev command (along with a bunch of my other rails related aliases):

alias rdev='svn update;mate .;mongrel_rails start -d;sleep 2;open http://localhost:3000;tail -f log/development.log'

alias ss='script/server'
alias sc='script/console'
alias sg='script/generate'
alias sp='script/plugin'
alias sr='script/runner'
alias rt='rake test'
alias rtu='rake test:units'
alias rtr='rake test:recent'
alias mr='mongrel_rails start -d'
alias mrs='mongrel_rails stop'

Just stick that in your ~/.profile file and either reopen your console or run:

. ~/.profile
Trackbacks

Use the following link to trackback from your own site:
http://juju.org/articles/trackback/892

Comments

Leave a response, Track co.mments

  1. Avatar
    Jake Good Thu, 18 Jan 2007 17:33:30 GMT

    Another technique that I use is doing rake tasks... seems like a good fit.

  2. Avatar
    Ulysses Sun, 28 Jan 2007 00:38:36 GMT

    I do the same thing. :-) I typically have a few projects on the go, so I write a script for each one. When I want to start working on a new project, I just source the relevant script.

    I also use pushd and popd so that I can run (say, ) console from wherever I happen to be without cd'ing to $PROJECT.

Comments