Sha256: 3c998b68c2375e68c7f8c3fad38ebf4e278b4f3fae1dc525a938f3146a56168d

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

module BenchmarkToJs
  class Configuration
    attr_accessor :run_in_environments, :pretty, :orange_threshold, :red_threshold

    def initialize
      self.run_in_environments = [:development]
      self.pretty = true
      self.orange_threshold = 100
      self.red_threshold = 500
    end

    def run?
      @run ||= begin
        defined?(Rails) && Array(self.run_in_environments).map(&:to_s).include?(Rails.env)
      end
    end
  end

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

  def self.configure
    yield(configuration) if block_given?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
benchmark_to_js-0.2.0 lib/benchmark_to_js/configuration.rb