lib/deputy.rb in deputy-0.1.1 vs lib/deputy.rb in deputy-0.1.2
- old
+ new
@@ -46,11 +46,12 @@
def self.sheriff_url
config['sheriff_url'].sub(%r{/$},'')
end
def self.config
- file = File.expand_path('~/.deputy.yml')
- YAML.load(File.read(file))
- rescue => e
- e.message << " -- do you have a #{file} ?"
+ home = File.expand_path('~')
+ ["#{home}/.deputy.yml", '/etc/deputy.yml'].each do |file|
+ return YAML.load(File.read(file)) if File.exist?(file)
+ end
+ raise "No deputy.yml found in /etc or #{home}"
end
end
\ No newline at end of file