better running of rails

This commit is contained in:
John Bintz 2011-05-28 18:35:01 -04:00
parent 526f25ba9d
commit 70e1f110f9
1 changed files with 5 additions and 3 deletions

View File

@ -36,9 +36,11 @@ module Guard
end
def start_rails
system %{sh -c 'rails s -d -e #{options[:environment]} -p #{options[:port]} --pid #{pid_file}'}
sleep 2
UI.info "Rails running, PID #{File.read(pid_file)}"
system %{sh -c 'cd #{Dir.pwd} && rails s -e #{options[:environment]} -p #{options[:port]} --pid #{pid_file} &'}
while !File.file?(pid_file)
sleep 0.5
end
UI.info "Rails restarted, pid #{File.read(pid_file)}"
end
def stop_rails