rails3.plugin.zsh 890 B

1234567891011121314151617181920212223242526272829303132
  1. # Rails 3 aliases, backwards-compatible with Rails 2.
  2. function _rails_command () {
  3. if [ -e "script/server" ]; then
  4. ruby script/$@
  5. else
  6. if [ -e "bin/rails" ]; then
  7. bin/rails $@
  8. else
  9. rails $@
  10. fi
  11. fi
  12. }
  13. alias rc='_rails_command console'
  14. alias rd='_rails_command destroy'
  15. alias rdb='_rails_command dbconsole'
  16. alias rdbm='rake db:migrate db:test:clone'
  17. alias rg='_rails_command generate'
  18. alias rgm='_rails_command generate migration'
  19. alias rp='_rails_command plugin'
  20. alias ru='_rails_command runner'
  21. alias rs='_rails_command server'
  22. alias rsd='_rails_command server --debugger'
  23. alias devlog='tail -f log/development.log'
  24. alias testlog='tail -f log/test.log'
  25. alias prodlog='tail -f log/production.log'
  26. alias rdm='rake db:migrate'
  27. alias rdr='rake db:rollback'
  28. alias -g RET='RAILS_ENV=test'
  29. alias -g REP='RAILS_ENV=production'
  30. alias -g RED='RAILS_ENV=development'