Module: Purgeable

Defined in:
lib/purgeable.rb,
lib/purgeable/client.rb,
lib/purgeable/railtie.rb,
lib/purgeable/version.rb,
lib/purgeable/settings.rb,
lib/purgeable/http/purge.rb,
lib/purgeable/http_resource.rb,
lib/generators/purgeable/install_generator.rb

Defined Under Namespace

Modules: HTTP, HttpResource Classes: Client, InstallGenerator, Railtie

Constant Summary collapse

VERSION =
version.gsub(/^v?([^\+]+)\+?\d*$/, '\1')
SETTINGS =
{}.extend ::Methodize

Class Method Summary collapse

Class Method Details

.load_settings(file_path, env) ⇒ Object



9
10
11
12
13
14
# 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)
  normalize_settings
end