Module: SimpleDeploy::Configuration

Extended by:
Configuration
Included in:
Configuration
Defined in:
lib/simple_deploy/configuration.rb

Defined Under Namespace

Classes: Config

Instance Method Summary collapse

Instance Method Details

#configure(environment, custom_config = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/simple_deploy/configuration.rb', line 6

def configure(environment, custom_config = {})
  if custom_config.has_key?(:config)
    env_config    = custom_config[:config]['environments'][environment]
    notifications = custom_config[:config]['notifications']
  else
    env_config, notifications = load_appropriate_config(environment)
  end
  Config.new env_config, notifications
end

#environments(custom_config = {}) ⇒ Object



16
17
18
19
# File 'lib/simple_deploy/configuration.rb', line 16

def environments(custom_config = {})
  raw_config = custom_config.fetch(:config) { load_config_file }
  raw_config['environments']
end