lib/beanstalk-client-rspec.rb in beanstalk-client-rspec-0.0.3 vs lib/beanstalk-client-rspec.rb in beanstalk-client-rspec-0.0.4

- old
+ new

@@ -24,10 +24,13 @@ # TODO Put on to reservation queue and deal with bury etc def reserve(timeout=nil) job = nil @watch_list.each do |tube_name| begin + if @tubes[tube_name].nil? + next + end job = @tubes[tube_name]['ready'].pop(false) rescue ThreadError next end @@ -47,10 +50,10 @@ end private def interact(cmd, rfmt) case cmd - when /^watch/ + when /^watch (\S+)/ [@watch_list.size] when /^ignore/ [@watch_list.size] when /^use (\S+)/ [$1]