Class: Puppet::ModuleTool::InstalledModules::ModuleRelease Private

Inherits:
SemanticPuppet::Dependency::ModuleRelease
  • Object
show all
Defined in:
lib/puppet/module_tool/installed_modules.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, mod) ⇒ ModuleRelease

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ModuleRelease.

API:

  • private



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/puppet/module_tool/installed_modules.rb', line 58

def initialize(source, mod)
  @mod = mod
   = mod.
  name = mod.forge_name.tr('/', '-')
  begin
    version = SemanticPuppet::Version.parse(mod.version)
  rescue SemanticPuppet::Version::ValidationFailure
    Puppet.warning _("%{module_name} (%{path}) has an invalid version number (%{version}). The version has been set to 0.0.0. If you are the maintainer for this module, please update the metadata.json with a valid Semantic Version (http://semver.org).") % { module_name: mod.name, path: mod.path, version: mod.version }
    version = SemanticPuppet::Version.parse("0.0.0")
  end
  release = "#{name}@#{version}"

  super(source, name, version, {})

  if mod.dependencies
    mod.dependencies.each do |dependency|
      results = Puppet::ModuleTool.parse_module_dependency(release, dependency)
      dep_name, parsed_range, range = results

      add_constraint('initialize', dep_name, range.to_s) do |node|
        parsed_range === node.version
      end
    end
  end
end

Instance Attribute Details

#metadataObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



56
57
58
# File 'lib/puppet/module_tool/installed_modules.rb', line 56

def 
  
end

#modObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



56
57
58
# File 'lib/puppet/module_tool/installed_modules.rb', line 56

def mod
  @mod
end

Instance Method Details

#install(dir) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



88
89
90
# File 'lib/puppet/module_tool/installed_modules.rb', line 88

def install(dir)
  # If we're already installed, there's no need for us to faff about.
end

#install_dirObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



84
85
86
# File 'lib/puppet/module_tool/installed_modules.rb', line 84

def install_dir
  Pathname.new(@mod.path).dirname
end

#prepareObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



92
93
94
# File 'lib/puppet/module_tool/installed_modules.rb', line 92

def prepare
  # We're already installed; what preparation remains?
end