support zeus to boost rails init

This commit is contained in:
Ranmocy 2013-01-19 23:38:58 +08:00
parent 58f1523edb
commit fb398d172a
2 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ Lots of fun options!
* `:timeout` waits this number of seconds when restarting the Rails server before reporting there's a problem (default `20`).
* `:server` lets you specify the webserver engine to use (try `:server => :thin`).
* `:pid_file` specify your pid_file, so that maybe you can run multiple instances with same rails_env (default `tmp/pids/[RAILS_ENV].pid`)
* `:zeus` support [zeus](https://github.com/burke/zeus) to boost rails init speed.
This is super-alpha, but it works for me! Only really hand-tested in Mac OS X. Feel free to fork'n'fix for other
OSes, and to add some more real tests.

View File

@ -42,7 +42,9 @@ module Guard
rails_options << '-u' if options[:debugger]
rails_options << options[:server] if options[:server]
%{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} rails s #{rails_options.join(' ')} &'}
rails_command = options[:zeus] ? 'zeus' : 'rails'
%{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_command} s #{rails_options.join(' ')} &'}
end
def pid_file