Class: VagrantPlugins::Orchestrate::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-orchestrate/config.rb

Defined Under Namespace

Classes: Credentials

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig



12
13
14
15
16
17
# File 'lib/vagrant-orchestrate/config.rb', line 12

def initialize
  @filter_managed_commands = UNSET_VALUE
  @strategy = UNSET_VALUE
  @force_push = UNSET_VALUE
  @credentials = Credentials.new
end

Instance Attribute Details

#credentials {|@credentials| ... } ⇒ Object

Returns the value of attribute credentials.

Yields:



10
11
12
# File 'lib/vagrant-orchestrate/config.rb', line 10

def credentials
  @credentials
end

#filter_managed_commandsObject

Returns the value of attribute filter_managed_commands.



7
8
9
# File 'lib/vagrant-orchestrate/config.rb', line 7

def filter_managed_commands
  @filter_managed_commands
end

#force_pushObject

Returns the value of attribute force_push.



9
10
11
# File 'lib/vagrant-orchestrate/config.rb', line 9

def force_push
  @force_push
end

#strategyObject

Returns the value of attribute strategy.



8
9
10
# File 'lib/vagrant-orchestrate/config.rb', line 8

def strategy
  @strategy
end

Instance Method Details

#finalize!Object



39
40
41
42
43
44
45
# File 'lib/vagrant-orchestrate/config.rb', line 39

def finalize!
  @filter_managed_commands = false if @filter_managed_commands == UNSET_VALUE
  @strategy = :serial if @strategy == UNSET_VALUE
  @force_push = false if @force_push == UNSET_VALUE
  @credentials = nil if @credentials.unset?
  @credentials.finalize! if @credentials
end

#merge(new_config) ⇒ Object

It was a little hard to dig up, but this method gets called on the more general config object, with the more specific config as the argument. github.com/mitchellh/vagrant/blob/master/lib/vagrant/config/v2/loader.rb



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/vagrant-orchestrate/config.rb', line 27

def merge(new_config)
  super.tap do |result|
    if new_config.credentials.unset?
      result.credentials = @credentials
    elsif @credentials.unset?
      result.credentials = new_config.credentials
    else
      result.credentials = @credentials.merge(new_config.credentials)
    end
  end
end