lib/page_magic/drivers.rb in page_magic-1.0.0.alpha21 vs lib/page_magic/drivers.rb in page_magic-1.0.0

- old
+ new

@@ -5,16 +5,10 @@ class Drivers def all @all ||= [] end - # Make a driver available for selection when creating calling {PageMagic.session} - # @param [Driver] driver driver definition - def register(driver) - all << driver - end - # Find a driver definition based on its registered name # @param [Symbol] browser registered name of the required browser def find(browser) all.find { |driver| driver.support?(browser) } end @@ -27,9 +21,15 @@ Dir["#{path}/*.rb"].each do |driver_file| require driver_file driver_name = File.basename(driver_file)[/(.*)\.rb$/, 1] register self.class.const_get(driver_name.classify) end + end + + # Make a driver available for selection when creating calling {PageMagic.session} + # @param [Driver] driver driver definition + def register(driver) + all << driver end # returns true if this driver instance is equal to the supplied object # @param [Object] other subject of equality check # @return [Boolean] true if the object is a match