rails3.plugin.zsh 706 B

123456789101112131415161718192021222324252627282930
  1. # Rails 3 aliases, backwards-compatible with Rails 2.
  2. function _bundle_command {
  3. if command -v bundle && [ -e "Gemfile" ]; then
  4. bundle exec $@
  5. else
  6. $@
  7. fi
  8. }
  9. function _rails_command () {
  10. if [ -e "script/server" ]; then
  11. ruby script/$@
  12. else
  13. ruby script/rails $@
  14. fi
  15. }
  16. alias rc='_rails_command console'
  17. alias rd='_rails_command destroy'
  18. alias rdb='_rails_command dbconsole'
  19. alias rdbm='rake db:migrate db:test:clone'
  20. alias rg='_rails_command generate'
  21. alias rp='_rails_command plugin'
  22. alias rs='_rails_command server'
  23. alias rsd='_rails_command server --debugger'
  24. alias devlog='tail -f log/development.log'
  25. alias rspec='_bundle_command rspec'
  26. alias cuke='_bundle_command cucumber'