Sha256: 8298220ff2c29eed0e8b098173a082087df637a97b46549ba22812e81c71695b

Contents?: true

Size: 395 Bytes

Versions: 3

Compression:

Stored size: 395 Bytes

Contents

module Equestreum
  class Config
    include Singleton

    def initialize
      @config = fetch_yaml File.join(File.dirname(__FILE__), '..', '..', 'config/equestreum.yml')
      @config.merge! fetch_yaml "#{ENV['HOME']}/.equestreum/config.yaml"
    end

    def config
      @config
    end

    def fetch_yaml file
      YAML.load_file file
    rescue Errno::ENOENT
      {}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
equestreum-0.1.4 lib/config.rb
equestreum-0.1.3 lib/config.rb
equestreum-0.1.2 lib/config.rb