refactory build_rails_command

This commit is contained in:
Ranmocy 2013-01-19 23:44:22 +08:00
parent fb398d172a
commit 082b8f650b

View File

@ -35,13 +35,12 @@ module Guard
rails_options = [
'-e', options[:environment],
'-p', options[:port],
'--pid', options[:pid_file] || pid_file
'--pid', options[:pid_file] || pid_file,
options[:daemon] ? '-d' : '',
options[:debugger] ? '-u' : '',
options[:server].nil? ? '' : options[:server],
]
rails_options << '-d' if options[:daemon]
rails_options << '-u' if options[:debugger]
rails_options << options[:server] if options[:server]
rails_command = options[:zeus] ? 'zeus' : 'rails'
%{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_command} s #{rails_options.join(' ')} &'}