Class: Vx::Builder::BuildConfiguration::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/vx/builder/build_configuration/deploy.rb,
lib/vx/builder/build_configuration/deploy/base.rb,
lib/vx/builder/build_configuration/deploy/shell.rb

Defined Under Namespace

Classes: Base, Shell

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_env) ⇒ Deploy

Returns a new instance of Deploy.



20
21
22
# File 'lib/vx/builder/build_configuration/deploy.rb', line 20

def initialize(new_env)
  normalize(new_env)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



18
19
20
# File 'lib/vx/builder/build_configuration/deploy.rb', line 18

def attributes
  @attributes
end

Class Method Details

.restore_modules(values) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/vx/builder/build_configuration/deploy.rb', line 7

def restore_modules(values)
  (values || []).inject([]) do |ac, pair|
    k = pair.keys.first
    if it = Base.module_by_key(k)
      ac << it.new(pair)
    end
    ac
  end
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/vx/builder/build_configuration/deploy.rb', line 28

def empty?
  attributes.empty?
end

#find_modules(branch) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/vx/builder/build_configuration/deploy.rb', line 32

def find_modules(branch)
  modules = []

  Base.loaded.each do |l|
    attributes.each do |attr|
      if l.detect(attr)
        modules << l.new(attr)
      end
    end
  end
  modules.select{ |m| m.branch?(branch) }
end