Sha256: 87094baf690b9b0c29be559fdc9bf3add10aa84c9afee7cb73debef8046df22b

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

require 'yaml'

module StatsWhisper
  module Config

    def config
      @config ||= load_config
    end

    def whitelist
      config['whitelist'] || []
    end

    def app_name
      config['app_name'] || 'foo'
    end

    private

    def load_config
      begin
        YAML.load(ERB.new(File.new(Rails.root.join("config", "whisper_config.yml")).read).result)
      rescue Errno::ENOENT
        {}
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stats_whisper-0.2.3 lib/stats_whisper/config.rb
stats_whisper-0.2.2.1 lib/stats_whisper/config.rb