Module: Purgeable
- Defined in:
- lib/purgeable.rb,
lib/purgeable/client.rb,
lib/purgeable/settings.rb,
lib/purgeable/http/purge.rb,
lib/purgeable/http_resource.rb
Defined Under Namespace
Modules: HTTP, HttpResource Classes: Client
Constant Summary collapse
- SETTINGS =
{}.extend ::Methodize
Class Method Summary collapse
Class Method Details
.load_settings(file_path, env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/purgeable/settings.rb', line 9 def self.load_settings file_path, env raise "Invalid config location: #{file_path.inspect}" unless File.exists? file_path config = YAML.load(ERB.new(File.read(file_path)).result)[env] SETTINGS.merge! config if config.is_a?(Hash) if defined? ::MethodizedHash SETTINGS.http_cache.each do |cfg| cfg.extend ::Methodize unless cfg.kind_of?(MethodizedHash) end end end |