Sha256: 23d5f88593823b49d8ddb30e2fb40e03331063d5810de000e02f4d2293d3fb72

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

module Appsignal
  class Config
    attr_accessor :root_path, :rails_env

    def initialize(root_path, rails_env, logger=Appsignal.logger)
      @root_path = root_path
      @rails_env = rails_env
      @logger = logger
    end

    def load
      file = File.join(@root_path, 'config/appsignal.yml')
      unless File.exists?(file)
        @logger.error "config not found at: #{file}"
        return
      end

      config = YAML.load_file(file)[@rails_env]
      unless config
        @logger.error "config for '#{@rails_env}' not found"
        return
      end

      config = {:ignore_exceptions => [],
        :endpoint => 'https://push.appsignal.com/1',
        :slow_request_threshold => 200
      }.merge(config.symbolize_keys)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
appsignal-0.4.6 lib/appsignal/config.rb
appsignal-0.4.5 lib/appsignal/config.rb
appsignal-0.4.4 lib/appsignal/config.rb
appsignal-0.4.3 lib/appsignal/config.rb
appsignal-0.4.0 lib/appsignal/config.rb