Sha256: 2c1cd99341209fcc2447defd00ebba7d36560fc7b4ce7244edb8f738a2359439

Contents?: true

Size: 996 Bytes

Versions: 9

Compression:

Stored size: 996 Bytes

Contents

module VagrantPlugins
  module LibrarianPuppet
    class Config < Vagrant.plugin(2, :config)
      attr_accessor :puppetfile_dir
      attr_accessor :placeholder_filename
      attr_accessor :resolve_options

      def initialize
        @puppetfile_dir = UNSET_VALUE
        @placeholder_filename = UNSET_VALUE
        @resolve_options = UNSET_VALUE
      end

      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

      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

      def puppetfile_path
        @puppetfile_path ||= @puppetfile_dir ? File.join(@puppetfile_dir, 'Puppetfile') : 'Puppetfile'
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
outoftime-vagrant-librarian-puppet-0.7.1.1416968000 lib/vagrant-librarian-puppet/config.rb
outoftime-vagrant-librarian-puppet-0.7.1 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.7.1 lib/vagrant-librarian-puppet/config.rb
mojolingo-vagrant-librarian-puppet-0.7.1 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.7.0 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.6.0 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.5.0 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.4.0 lib/vagrant-librarian-puppet/config.rb
vagrant-librarian-puppet-0.3.1 lib/vagrant-librarian-puppet/config.rb