minor refactoring

This commit is contained in:
Sam 2013-08-06 06:34:42 +10:00
parent 11dca1fd92
commit 628ec101c7
1 changed files with 25 additions and 22 deletions

View File

@ -19,7 +19,7 @@ class Autospec::Runner
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
@ -85,7 +85,18 @@ class Autospec::Runner
end
while spork_running
process_queue
end
puts "Spork has been terminated, exiting"
rescue => e
puts e
puts e.backtrace
stop_spork
end
def process_queue
STDIN.gets
if @queue.length == 0
@ -108,14 +119,6 @@ class Autospec::Runner
end
end
puts "Spork has been terminated, exiting"
rescue => e
puts e
puts e.backtrace
stop_spork
end
def wait_for(timeout_milliseconds)
timeout = (timeout_milliseconds + 0.0) / 1000
finish = Time.now + timeout