Sha256: dd53100caa791e3bae17fbeb685a00601fabe3c950677bfdf6bd4afb842adb1c

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

require 'singleton'

module PageModels  
  class Configuration
    include Singleton
    attr_writer :driver
    
    def initialize
      @driver = :capybara
      @frameworks = []
    end
        
    def integrate(framework)
      @frameworks << framework
    end
    
    def integrate!      
      @frameworks.each { |framework| require "page_models/integration/#{framework}" }
    end
    
    def driver
      case @driver
        when :capybara
          Capybara.current_session
        else
          raise ConfigurationError.new("No driver configured.")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pagemodels-0.1.1 lib/page_models/configuration.rb
pagemodels-0.1.0 lib/page_models/configuration.rb