lib/vagrant-orchestrate/config.rb in vagrant-orchestrate-0.6.5 vs lib/vagrant-orchestrate/config.rb in vagrant-orchestrate-0.7.0.pre

- old
+ new

@@ -5,16 +5,18 @@ module Orchestrate class Config < Vagrant.plugin(2, :config) attr_accessor :filter_managed_commands attr_accessor :strategy attr_accessor :force_push + attr_accessor :tracker_host attr_accessor :credentials def initialize @filter_managed_commands = UNSET_VALUE @strategy = UNSET_VALUE @force_push = UNSET_VALUE + @tracker_host = UNSET_VALUE @credentials = Credentials.new end def credentials yield @credentials if block_given? @@ -34,16 +36,19 @@ result.credentials = @credentials.merge(new_config.credentials) end end end + # rubocop:disable Metrics/CyclomaticComplexity 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 @credentials = nil if @credentials.unset? @credentials.finalize! if @credentials end + # rubocop:enable Metrics/CyclomaticComplexity class Credentials # Same as Vagrant does to distinguish uninitialized variables and intentional assignments # to Ruby's nil, we just have to define ourselves because we're in different scope UNSET_VALUE = ::Vagrant::Plugin::V2::Config::UNSET_VALUE