Permalink
Browse files

make File.read OpenURI.open().read. This allows for people to referen…

…ce a remote settings file, which is really handy when using on heroku.
  • Loading branch information...
1 parent 70a1fe4 commit 7fd064ac043c1fdd0bd599e30f80473566f32123 @maxwell maxwell committed Jan 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/settingslogic.rb
View
@@ -1,5 +1,6 @@
require "yaml"
require "erb"
+require 'open-uri'
# A simple settings solution using a YAML file. See README for more information.
class Settingslogic < Hash
@@ -110,7 +111,7 @@ def initialize(hash_or_file = self.class.source, section = nil)
when Hash
self.replace hash_or_file
else
- hash = YAML.load(ERB.new(File.read(hash_or_file)).result).to_hash
+ hash = YAML.load(ERB.new(open(hash_or_file).read).result).to_hash
if self.class.namespace
hash = hash[self.class.namespace] or return missing_key("Missing setting '#{self.class.namespace}' in #{hash_or_file}")
end

0 comments on commit 7fd064a

Please sign in to comment.