Class: VagrantPlugins::LibrarianPuppet::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::LibrarianPuppet::Config
- Defined in:
- lib/vagrant-librarian-puppet/config.rb
Instance Attribute Summary collapse
-
#placeholder_filename ⇒ Object
Returns the value of attribute placeholder_filename.
-
#puppetfile_dir ⇒ Object
Returns the value of attribute puppetfile_dir.
-
#resolve_options ⇒ Object
Returns the value of attribute resolve_options.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #puppetfile_path ⇒ Object
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 8 def initialize @puppetfile_dir = UNSET_VALUE @placeholder_filename = UNSET_VALUE @resolve_options = UNSET_VALUE end |
Instance Attribute Details
#placeholder_filename ⇒ Object
Returns the value of attribute placeholder_filename.
5 6 7 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 5 def placeholder_filename @placeholder_filename end |
#puppetfile_dir ⇒ Object
Returns the value of attribute puppetfile_dir.
4 5 6 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 4 def puppetfile_dir @puppetfile_dir end |
#resolve_options ⇒ Object
Returns the value of attribute resolve_options.
6 7 8 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 6 def @resolve_options end |
Instance Method Details
#finalize! ⇒ Object
14 15 16 17 18 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 14 def finalize! @puppetfile_dir = '.' if @puppetfile_dir == UNSET_VALUE @placeholder_filename = '.PLACEHOLDER' if @placeholder_filename == UNSET_VALUE @resolve_options = {} if @resolve_options == UNSET_VALUE end |
#puppetfile_path ⇒ Object
28 29 30 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 28 def puppetfile_path @puppetfile_path ||= @puppetfile_dir ? File.join(@puppetfile_dir, 'Puppetfile') : 'Puppetfile' end |
#validate(machine) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/vagrant-librarian-puppet/config.rb', line 20 def validate(machine) errors = [] if not @resolve_options.kind_of?(Hash) errors << '`resolve_options` must be a hash' end return { 'vagrant-librarian-puppet' => errors } end |