Sha256: e2d1bbd9657a30e1803355846048dd1f8a393f5e4099d8d90d71636ecb416759
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require "rock_config/version" require "rock_config/environment_detector" require "rock_config/configuration" require "rock_config/manager" require "rock_config/scanner" require "rock_config/yaml_loader" require "rock_config/config" module RockConfig class ConfigNotFound < Exception; end class << self def for(config_name, environment = detect_environment) manager.fetch(config_name, environment) end def configure yield configuration if block_given? @manager = nil end private def detect_environment @detected_environment ||= lambda do detector = EnvironmentDetector.new(ENV) detector.detect end.call end def configuration @configuration ||= initialize_configuration end def initialize_configuration configuration = Configuration.new configuration.scanned_directories << File.join(Dir.pwd, "config") configuration.config_loaders << YamlLoader.new configuration end def manager @manager ||= Manager.new(configuration) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rock_config-0.0.1 | lib/rock_config.rb |