Class: VagrantPlugins::Orchestrate::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Orchestrate::Config
- Defined in:
- lib/vagrant-orchestrate/config.rb
Defined Under Namespace
Classes: Credentials
Instance Attribute Summary collapse
-
#credentials {|@credentials| ... } ⇒ Object
Returns the value of attribute credentials.
-
#disable_commit_guard ⇒ Object
Returns the value of attribute disable_commit_guard.
-
#filter_managed_commands ⇒ Object
Returns the value of attribute filter_managed_commands.
-
#force_push ⇒ Object
Returns the value of attribute force_push.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#tracker_host ⇒ Object
Returns the value of attribute tracker_host.
-
#tracker_logging_enabled ⇒ Object
Returns the value of attribute tracker_logging_enabled.
Instance Method Summary collapse
-
#finalize! ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#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.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
15 16 17 18 19 20 21 22 23 |
# File 'lib/vagrant-orchestrate/config.rb', line 15 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 @credentials = Credentials.new end |
Instance Attribute Details
#credentials {|@credentials| ... } ⇒ Object
Returns the value of attribute credentials.
12 13 14 |
# File 'lib/vagrant-orchestrate/config.rb', line 12 def credentials @credentials end |
#disable_commit_guard ⇒ Object
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_commands ⇒ Object
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_push ⇒ Object
Returns the value of attribute force_push.
9 10 11 |
# File 'lib/vagrant-orchestrate/config.rb', line 9 def force_push @force_push end |
#strategy ⇒ Object
Returns the value of attribute strategy.
8 9 10 |
# File 'lib/vagrant-orchestrate/config.rb', line 8 def strategy @strategy end |
#tracker_host ⇒ Object
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_enabled ⇒ Object
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
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vagrant-orchestrate/config.rb', line 46 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 @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
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vagrant-orchestrate/config.rb', line 33 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 |