Commit 7fd064ac043c1fdd0bd599e30f80473566f32123
1 parent
70a1fe47
Exists in
master
make File.read OpenURI.open().read. This allows for people to reference a remot…
…e settings file, which is really handy when using on heroku.
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
lib/settingslogic.rb
1 | 1 | require "yaml" |
2 | 2 | require "erb" |
3 | +require 'open-uri' | |
3 | 4 | |
4 | 5 | # A simple settings solution using a YAML file. See README for more information. |
5 | 6 | class Settingslogic < Hash |
... | ... | @@ -110,7 +111,7 @@ class Settingslogic < Hash |
110 | 111 | when Hash |
111 | 112 | self.replace hash_or_file |
112 | 113 | else |
113 | - hash = YAML.load(ERB.new(File.read(hash_or_file)).result).to_hash | |
114 | + hash = YAML.load(ERB.new(open(hash_or_file).read).result).to_hash | |
114 | 115 | if self.class.namespace |
115 | 116 | hash = hash[self.class.namespace] or return missing_key("Missing setting '#{self.class.namespace}' in #{hash_or_file}") |
116 | 117 | end | ... | ... |