Class: VagrantPlugins::PuppetInstall::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::PuppetInstall::Config
- Defined in:
- lib/vagrant-puppet-install/config.rb
Instance Attribute Summary collapse
-
#version ⇒ String
The version of Chef to install.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
30 31 32 |
# File 'lib/vagrant-puppet-install/config.rb', line 30 def initialize @version = UNSET_VALUE end |
Instance Attribute Details
#version ⇒ String
Returns The version of Chef to install.
28 29 30 |
# File 'lib/vagrant-puppet-install/config.rb', line 28 def version @version end |
Instance Method Details
#finalize! ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/vagrant-puppet-install/config.rb', line 34 def finalize! if @version == UNSET_VALUE @version = nil elsif @version.to_s == 'latest' # resolve `latest` to a real version @version = retrieve_latest_puppet_version end end |
#validate(machine) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vagrant-puppet-install/config.rb', line 43 def validate(machine) errors = [] unless valid_chef_version?(chef_version) msg = "'#{chef_version}' is not a valid version of Chef." msg << "\n\n A list of valid versions can be found at: http://www.opscode.com/chef/install/" errors << msg end { "Omnibus Plugin" => errors } end |