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

Returns a new instance of Config.



16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-orchestrate/config.rb', line 16

def initialize
  @filter_managed_commands = UNSET_VALUE
  @strategy = UNSET_VALUE
  @force_push = UNSET_VALUE
  @tracker_host = UNSET_VALUE
  @tracker_logging_enabled = UNSET_VALUE
  @disable_commit_guard = UNSET_VALUE
  @take_synced_folder_ownership = UNSET_VALUE
  @credentials = Credentials.new
end

Instance Attribute Details

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

Returns the value of attribute credentials.

Yields:



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

def credentials
  @credentials
end

#disable_commit_guardObject

Returns the value of attribute disable_commit_guard.



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

def disable_commit_guard
  @disable_commit_guard
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

#take_synced_folder_ownershipObject

Returns the value of attribute take_synced_folder_ownership.



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

def take_synced_folder_ownership
  @take_synced_folder_ownership
end

#tracker_hostObject

Returns the value of attribute tracker_host.



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

def tracker_host
  @tracker_host
end

#tracker_logging_enabledObject

Returns the value of attribute tracker_logging_enabled.



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

def tracker_logging_enabled
  @tracker_logging_enabled
end

Instance Method Details

#finalize!Object

rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/vagrant-orchestrate/config.rb', line 48

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
  @tracker_host = nil if @tracker_host == UNSET_VALUE
  @tracker_logging_enabled = true if @tracker_logging_enabled == UNSET_VALUE
  @disable_commit_guard = false if @disable_commit_guard == UNSET_VALUE
  @take_synced_folder_ownership = true if @take_synced_folder_ownership == 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



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

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