lib/guard/rails/runner.rb in guard-rails-0.4.3 vs lib/guard/rails/runner.rb in guard-rails-0.4.4
- old
+ new
@@ -22,11 +22,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} >&2 2>/dev/null"
+ system "kill -KILL #{pid} >&2 2>#{::Guard::DEV_NULL}"
FileUtils.rm pid_file, :force => true
end
end
def restart
@@ -36,11 +36,11 @@
def build_command
command = build_cli_command if options[:CLI]
command ||= build_zeus_command if options[:zeus]
command ||= build_rails_command
- "sh -c 'cd \"#{@root}\" && #{command} &'"
+ "#{environment.collect {|k,v| "#{k}=#{v} "}.join} cd \"#{@root}\" && #{command}"
end
def environment
rails_env = if options[:zeus]
nil
@@ -94,10 +94,10 @@
def build_rails_command
"rails server #{build_options}"
end
def run_rails_command!
- system "#{environment.collect {|k,v| "#{k}=#{v} "}.join} #{build_command}"
+ system "sh -c 'cd \"#{@root}\" && #{build_command} &'"
end
def has_pid?
File.file?(pid_file)
end