Sha256: f2ebeaeef14569720b1f867050e3f84b8e84a7df4537df48c6f329ad97ec8f56

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

module Equestreum
  class Config
    include Singleton

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

    def config
      @config
    end

    def fetch_yaml file
      YAML.load File.open file
    rescue Errno::ENOENT
      {}
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
equestreum-0.1.1 lib/equestreum/config.rb