added option to force polling instead of messing with the detection

This commit is contained in:
Sam
2013-05-01 10:29:39 +10:00
parent 2c4bd484af
commit 8b419794f9
2 changed files with 17 additions and 14 deletions

View File

@ -4,6 +4,15 @@
desc "Run all specs automatically as needed"
task "autospec" => :environment do
puts "If file watching is not working you can force polling with: bundle exec rake autospec p l=3"
require 'autospec/runner'
Autospec::Runner.run
force_polling = ARGV.any?{|a| a == "p" || a == "polling"}
latency = (ARGV.find{|a| a =~ /l=|latency=/}.split("=")[1] || 3).to_i
if force_polling
puts "polling has been forced (slower) checking every #{latency} #{"second".pluralize(latency)}"
end
Autospec::Runner.run(force_polling: force_polling, latency: latency)
end