Module: CukeFig
Defined Under Namespace
Classes: Config
Instance Method Summary collapse
- #config ⇒ Object
- #expand_config_files(common, env_config: nil, override: nil) ⇒ Object
- #setup(common, environment: nil, env_configs: nil, override: nil) ⇒ Object
Instance Method Details
#config ⇒ Object
42 43 44 |
# File 'lib/cuke_fig.rb', line 42 def config Config.get end |
#expand_config_files(common, env_config: nil, override: nil) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/cuke_fig.rb', line 46 def (common, env_config: nil, override: nil) = [] .concat common unless common.nil? .concat env_config unless env_config.nil? .concat override unless override.nil? end |
#setup(common, environment: nil, env_configs: nil, override: nil) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/cuke_fig.rb', line 54 def setup(common, environment: nil, env_configs: nil, override: nil) config.clear env_config = env_configs[environment] unless env_configs.nil? || environment.nil? config_files = common, env_config: env_config, override: override config.set(:env, environment) config.load(config_files) config.methods.each do |method| define_method method do |*args, &block| config.send method, *args, &block end end end |