Sha256: c90e93f2d0ff53de286b3b9a0671fe0259c1e1e499f802fb02b5fd4bd06cbda4
Contents?: true
Size: 694 Bytes
Versions: 3
Compression:
Stored size: 694 Bytes
Contents
module RockConfig class Manager def initialize(configuration, scanner = Scanner) @scanner = scanner.new(configuration) @configs = initialize_configs end def fetch(config_name, environment) if config = @configs[config_name] if config_for_environment = config[environment] return config_for_environment else raise EnvironmentNotFoundError, 'Environment "%s" not found for config file "%s"' % [environment, config_name] end end end def initialize_configs Hash.new do |hash, key| if config = @scanner.find(key) hash[key] = config end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rock_config-0.0.7 | lib/rock_config/manager.rb |
rock_config-0.0.6 | lib/rock_config/manager.rb |
rock_config-0.0.5 | lib/rock_config/manager.rb |