lib/equestreum/config.rb in equestreum-0.1.1 vs lib/equestreum/config.rb in equestreum-0.1.2

- old
+ new

@@ -1,20 +1,18 @@ 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 + def initialize + @config = fetch_yaml File.join(File.dirname(__FILE__), '..', '..', 'config/equestreum.yml') + @config.merge! fetch_yaml 'config/equestreum.yml' if File.exists? 'config/equestreum.yml' end def config @config end def fetch_yaml file - YAML.load File.open file - rescue Errno::ENOENT - {} + YAML.load_file file end end end