refactory build_rails_command
This commit is contained in:
parent
fb398d172a
commit
082b8f650b
@ -35,13 +35,12 @@ module Guard
|
|||||||
rails_options = [
|
rails_options = [
|
||||||
'-e', options[:environment],
|
'-e', options[:environment],
|
||||||
'-p', options[:port],
|
'-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'
|
rails_command = options[:zeus] ? 'zeus' : 'rails'
|
||||||
|
|
||||||
%{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_command} s #{rails_options.join(' ')} &'}
|
%{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_command} s #{rails_options.join(' ')} &'}
|
||||||
|
Loading…
Reference in New Issue
Block a user