Module: Borg::Configuration::Applications

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

Defined Under Namespace

Classes: Application

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#applicationsObject (readonly)

Returns the value of attribute applications.



8
9
10
# File 'lib/borg/configuration/applications.rb', line 8

def applications
  @applications
end

Class Method Details

.included(base) ⇒ Object

:nodoc:



4
5
6
7
# File 'lib/borg/configuration/applications.rb', line 4

def self.included(base) #:nodoc:
  base.send :alias_method, :initialize_without_applications, :initialize
  base.send :alias_method, :initialize, :initialize_with_applications
end

Instance Method Details

#application(name, &block) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/borg/configuration/applications.rb', line 16

def application(name, &block)
  name = name.to_sym
  namespace name do
    desc "Load Application #{name} (All Stages if any)"
    task :default do
      @applications[name].execute
    end
  end
  @applications[name] ||= Application.new(name, @namespaces[name])
  @applications[name].execution_blocks << block if block_given?
end