Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #32 from maxwell/open_uri

Allow settingslogic to open a remote yml file
  • Loading branch information...
commit 4884d455bf18d92723cb8190cfd2dbf87f3aafd5 2 parents 70a1fe4 + 7fd064a
@binarylogic authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/settingslogic.rb
View
3  lib/settingslogic.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.