Class: VagrantPlugins::PuppetModules::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-puppet-modules/plugin.rb

Constant Summary collapse

VAGRANT_VERSION_REQUIREMENT =
'>= 1.1.0'

Class Method Summary collapse

Class Method Details

.check_vagrant_version(*requirements) ⇒ Boolean

Returns true if the Vagrant version fulfills the requirements

Parameters:

  • requirements (String, Array<String>)

    the version requirement

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/vagrant-puppet-modules/plugin.rb', line 15

def self.check_vagrant_version(*requirements)
    Gem::Requirement.new(*requirements).satisfied_by?(
        Gem::Version.new(Vagrant::VERSION)
    )
end

.check_vagrant_version!Object

Verifies that the Vagrant version fulfills the requirements

version

Raises:

  • (VagrantPlugins::ProxyConf::VagrantVersionError)

    if this plugin is incompatible with the Vagrant



25
26
27
28
29
30
31
# File 'lib/vagrant-puppet-modules/plugin.rb', line 25

def self.check_vagrant_version!
    unless check_vagrant_version(VAGRANT_VERSION_REQUIREMENT)
        msg = "vagrant-puppet-modules requires Vagrant version " << VAGRANT_VERSION_REQUIREMENT
        $stderr.puts msg
        fail msg
    end
end