lib/automateit/plugin/manager.rb in automateit-0.71102 vs lib/automateit/plugin/manager.rb in automateit-0.71103

- old
+ new

@@ -197,15 +197,10 @@ # Get the most suitable driver for this +method+ and +args+. Uses # automatic-detection routines and returns the most suitable driver # instance found, else raises a NotImplementedError if no suitable driver # is found. def driver_for(method, *args, &block) - begin - driver, level = driver_suitability_levels_for(method, *args, &block).sort_by{|k,v| v}.last - rescue IndexError - driver = nil - level = -1 - end + driver, level = driver_suitability_levels_for(method, *args, &block).sort_by{|k,v| v}.last if driver and level > 0 return @drivers[driver] else raise NotImplementedError.new("can't find driver for method '#{method}' with arguments: #{args.inspect}") end