rails.plugin.zsh 850 B

1234567891011121314151617181920212223242526272829303132
  1. alias ss='thin --stats "/thin/stats" start'
  2. alias sg='ruby script/generate'
  3. alias sd='ruby script/destroy'
  4. alias sp='ruby script/plugin'
  5. alias ssp='ruby script/spec'
  6. alias rdbm='rake db:migrate'
  7. alias sc='ruby script/console'
  8. alias sd='ruby script/server --debugger'
  9. alias devlog='tail -f log/development.log'
  10. function _cap_does_task_list_need_generating () {
  11. if [ ! -f .cap_tasks~ ]; then return 0;
  12. else
  13. accurate=$(stat -f%m .cap_tasks~)
  14. changed=$(stat -f%m config/deploy.rb)
  15. return $(expr $accurate '>=' $changed)
  16. fi
  17. }
  18. function _cap () {
  19. if [ -f config/deploy.rb ]; then
  20. if _cap_does_task_list_need_generating; then
  21. echo "\nGenerating .cap_tasks~..." > /dev/stderr
  22. cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
  23. > .cap_tasks~
  24. fi
  25. compadd `cat .cap_tasks~`
  26. fi
  27. }
  28. compctl -K _cap cap