Module: Borg::Configuration::Stages

Included in:
Borg::Configuration
Defined in:
lib/borg/configuration/stages.rb

Defined Under Namespace

Classes: Stage

Instance Method Summary collapse

Instance Method Details

#stage(app, name, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/borg/configuration/stages.rb', line 4

def stage(app, name, &block)
  app = app.to_sym
  name = name.to_sym
  application app unless @applications[app]

  namespace app do
    desc "Load Application #{app} and Stage #{name}"
    task name do
      @applications[app].stages[name].execute
    end
  end
  @applications[app].stages[name] ||= Stage.new(name, @applications[app])
  @applications[app].stages[name].execution_blocks << block if block_given?
end