class MetaCommit::Configuration

Public Instance Methods

fill_from_hash(hash) click to toggle source

Fill config values from yaml file @param [Hash] hash @return [MetaCommit::Configuration]

# File lib/meta_commit/configuration.rb, line 21
def fill_from_hash(hash)
  hash.each {|key, value| set(key.to_sym, value)}
  self
end
fill_from_yaml_file(path) click to toggle source

Fill config values from yaml file @param [String] path @return [MetaCommit::Configuration]

# File lib/meta_commit/configuration.rb, line 29
def fill_from_yaml_file(path)
  fill_from_hash read_from_yaml(path)
end
get(key) click to toggle source

Get the configuration value by key @param key [Symbol] configuration key @return [Object] configuration value

# File lib/meta_commit/configuration.rb, line 14
def get(key)
  self[key]
end
set(key, value) click to toggle source

Set the configuration key @param key [Symbol] configuration key @param value [Object] configuration value

# File lib/meta_commit/configuration.rb, line 7
def set(key, value)
  self[key] = value
end

Protected Instance Methods

read_from_yaml(path) click to toggle source

@param [String] path @return [Hash]

# File lib/meta_commit/configuration.rb, line 35
def read_from_yaml(path)
  begin
    YAML::load_file(path)
  rescue Errno::ENOENT => e
    raise MetaCommit::Errors::MissingConfigError
  end
end