This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/modules/rails/init.zsh

48 lines
1000 B
Bash
Raw Normal View History

2012-01-31 23:37:51 -05:00
#
# Defines Ruby on Rails aliases.
#
# Authors:
# Robby Russell <robby@planetargon.com>
# Jake Bell <jake.b.bell@gmail.com>
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
2012-07-23 15:00:44 -04:00
# Return if requirements are not found.
if (( ! $+commands[rails] )); then
return 1
fi
2012-08-04 14:48:32 -04:00
#
2012-06-14 19:05:12 -04:00
# Aliases (Compatible with Rails 2)
2012-08-04 14:48:32 -04:00
#
2012-08-14 21:13:07 -04:00
alias ror='rails'
alias rorc='_rails-command console'
alias rordc='_rails-command dbconsole'
alias rordm='rake db:migrate'
alias rordM='rake db:migrate db:test:clone'
alias rordr='rake db:rollback'
alias rorg='_rails-command generate'
alias rorl='tail -f log/development.log'
alias rorlc='rake log:clear'
alias rorp='_rails-command plugin'
alias rorr='_rails-command runner'
alias rors='_rails-command server'
alias rorsd='_rails-command server --debugger'
alias rorx='_rails-command destroy'
2012-08-04 14:48:32 -04:00
#
2011-08-30 23:16:15 -04:00
# Functions
2012-08-04 14:48:32 -04:00
#
function _rails-command {
2011-08-30 23:16:15 -04:00
if [[ -e "script/server" ]]; then
ruby script/"$@"
2013-11-23 21:14:23 -05:00
elif [[ -e "bin/rails" ]]; then
ruby bin/rails "$@"
2011-08-30 23:16:15 -04:00
else
ruby script/rails "$@"
fi
}
2011-08-30 23:16:15 -04:00