Module: ConfigManager

Defined in:
lib/configmanager.rb,
lib/configmanager/loaders.rb,
lib/configmanager/version.rb,
lib/configmanager/exceptions.rb,
lib/configmanager/configuration.rb,
lib/configmanager/interpolators.rb,
lib/configmanager/combined_configuration.rb

Overview

20 Jul 2012

Defined Under Namespace

Classes: CircularReferenceError, CombinedConfiguration, Configuration, DefaultInterpolator, JavaPropertiesLoader, KeyError, PropertyNotFoundError, YAMLPropertiesLoader

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.load_from_file(file_path, loader = YAMLPropertiesLoader, configuration = ConfigManager::Configuration.new()) ⇒ ConfigManager::Configuration

Loads properties from the specified file.

Parameters:

  • file_path (String)

    the file to load properties from.

  • loader (Object) (defaults to: YAMLPropertiesLoader)

    any object that can respond to the ‘load_properties(file_path, configuration)’ method and return a hash.

  • configuration (ConfigManager::Configuration) (defaults to: ConfigManager::Configuration.new())

    the configuration to load the properties into.

Returns:



23
24
25
26
# File 'lib/configmanager.rb', line 23

def self.load_from_file(file_path, loader = YAMLPropertiesLoader, configuration = ConfigManager::Configuration.new())
  loader.load_properties(file_path, configuration)
  configuration
end