lib/guard/rails/runner.rb in guard-rails-0.2.1 vs lib/guard/rails/runner.rb in guard-rails-0.2.2
- old
+ new
@@ -21,11 +21,11 @@
pid = File.read(pid_file).strip
system %{kill -SIGINT #{pid}}
wait_for_no_pid if $?.exitstatus == 0
# If you lost your pid_file, you are already died.
- system %{kill -KILL #{pid} > /dev/null 2>&1}
+ system %{kill -KILL #{pid} > /dev/null}
FileUtils.rm pid_file, :force => true
end
end
def restart
@@ -41,12 +41,13 @@
options[:daemon] ? '-d' : '',
options[:debugger] ? '-u' : '',
options[:server].nil? ? '' : options[:server],
]
- rails_runner = options[:zeus] ? 'zeus' : 'rails'
+ # omit env when use zeus
+ rails_runner = options[:zeus] ? 'zeus' : "RAILS_ENV=#{options[:environment]} rails"
- %{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_runner} s #{rails_options.join(' ')} &'}
+ %{sh -c 'cd #{Dir.pwd} && #{rails_runner} server #{rails_options.join(' ')} &'}
end
def pid_file
File.expand_path(options[:pid_file] || "tmp/pids/#{options[:environment]}.pid")
end