Sha256: 85d94d8dae7c3fa9280538aa97dc30a55c7322c6d8fc42b51c5b1364f51f2e1e

Contents?: true

Size: 1.31 KB

Versions: 13

Compression:

Stored size: 1.31 KB

Contents

module VagrantVbguest

  class Config < Vagrant::Config::Base

    module Attributes
      attr_accessor :iso_path, :auto_update, :auto_reboot, :no_install, :no_remote
    end

    class << self
      include Attributes

      def auto_update; @auto_update.nil? ? true  : @auto_update end
      def auto_reboot; @auto_reboot.nil? ? true  : @auto_reboot end
      def no_install;  @no_install.nil?  ? false : @no_install  end
      def no_remote;   @no_remote.nil?   ? false : @no_remote   end

      def iso_path
        return nil if !@iso_path || @iso_path == :auto
        @iso_path
      end
    end

    include Attributes

    def auto_update; @auto_update.nil? ? self.class.auto_update : @auto_update end
    def auto_reboot; @auto_reboot.nil? ? self.class.auto_reboot : @auto_reboot end
    def no_install;  @no_install.nil?  ? self.class.no_install  : @no_install  end
    def no_remote;   @no_remote.nil?   ? self.class.no_remote   : @no_remote   end

    def iso_path
      return self.class.iso_path if !@iso_path || @iso_path == :auto
      @iso_path
    end

    # explicit hash, to get symbols in hash keys
    def to_hash
      {
        :iso_path => iso_path,
        :auto_update => auto_update,
        :auto_reboot => auto_reboot,
        :no_install => no_install,
        :no_remote => no_remote
      }
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vagrant-vbguest-0.6.3 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.2 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.1 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre6 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre5 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre4 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre3 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre2 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre1 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.6.0.pre0 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.5.1 lib/vagrant-vbguest/config.rb
vagrant-vbguest-0.5.0 lib/vagrant-vbguest/config.rb