Top Level Namespace

Defined Under Namespace

Modules: HerokuHelper

Instance Method Summary collapse

Instance Method Details

#after(command, &block) ⇒ Object



23
24
25
# File 'lib/heroku-helper/deployment_configuration.rb', line 23

def after(command, &block)
  hook(:after, command, &block)
end

#before(command, &block) ⇒ Object



19
20
21
# File 'lib/heroku-helper/deployment_configuration.rb', line 19

def before(command, &block)
  hook(:before, command, &block)
end

#environment(env, &block) ⇒ Object



1
2
3
4
5
6
# File 'lib/heroku-helper/deployment_configuration.rb', line 1

def environment(env, &block)
  HerokuHelper::DeploymentConfiguration.current_environment        = env
  HerokuHelper::DeploymentConfiguration.configuration[env]         = {}
  HerokuHelper::DeploymentConfiguration.configuration[env][:hooks] = {}
  block.call
end

#hook(stage, command, &block) ⇒ Object



13
14
15
16
17
# File 'lib/heroku-helper/deployment_configuration.rb', line 13

def hook(stage, command, &block)
  configuration = HerokuHelper::DeploymentConfiguration.configuration[HerokuHelper::DeploymentConfiguration.current_environment]
  configuration[:hooks][command]      ||= {}
  configuration[:hooks][command][stage] = block
end

#set(name, value) ⇒ Object



8
9
10
11
# File 'lib/heroku-helper/deployment_configuration.rb', line 8

def set(name, value)
  HerokuHelper::DeploymentConfiguration.
    configuration[HerokuHelper::DeploymentConfiguration.current_environment][name] = value
end