module Mvnizer::Configuration

Public Instance Methods

conf(options) click to toggle source

Loads configuration from config/default.yml and merges the values into the passed options hash.

# File lib/mvnizer/configuration.rb, line 7
def conf(options)
  config_file = File.join(File.dirname(__FILE__), "..", "..", "conf", "default.yml")

  default_config = YAML.load_file(config_file)
  symbolize_keys(default_config.merge(symbolize_keys(options)))
end

Private Instance Methods

symbolize_keys(hash) click to toggle source

Transforms all the keys in the hash into symbols

# File lib/mvnizer/configuration.rb, line 16
def symbolize_keys(hash)
  h = hash.dup
  h.keys.each do |key|
    h[(key.to_sym rescue key) || key] = h.delete(key)
  end
  h
end