Sha256: 6e8b5a618219ea468cb2c42f82a16d730269977fc1e5e42d63e92097420c5ec6

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

require 'logger'

module CypressDev
  class Configuration
    attr_accessor :cypress_folder
    attr_accessor :use_middleware
    attr_accessor :logger

    def initialize
      reset
    end

    alias :use_middleware? :use_middleware

    def reset
      self.cypress_folder = 'spec/cypress'
      self.use_middleware = true
      self.logger = Logger.new(STDOUT)
    end

    def tagged_logged
      if logger.respond_to?(:tagged)
        logger.tagged('CY_DEV') { yield }
      else
        yield
      end
    end
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration if block_given?
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cypress-on-rails-1.3.0 lib/cypress_dev/configuration.rb
cypress-on-rails-1.2.1 lib/cypress_dev/configuration.rb
cypress-on-rails-1.2.0 lib/cypress_dev/configuration.rb
cypress-on-rails-1.1.1 lib/cypress_dev/configuration.rb
cypress-on-rails-1.1.0 lib/cypress_dev/configuration.rb
cypress-on-rails-1.0.1 lib/cypress_dev/configuration.rb
cypress-on-rails-1.0.0 lib/cypress_dev/configuration.rb
cypress-on-rails-1.0.0.beta2 lib/cypress_dev/configuration.rb