Class: Puppet::ModuleTool::InstalledModules::ModuleRelease
Instance Attribute Summary collapse
#name, #version
Instance Method Summary
collapse
#<=>, #priority, #to_s
#<<, #<=>, #add_constraint, #add_dependency, #children, #constraints, #constraints_for, #dependencies, #dependency_names, #name, #populate_children, #satisfied?, #satisfies_constraints?, #satisfies_dependency?
Constructor Details
#initialize(source, mod) ⇒ ModuleRelease
Returns a new instance of ModuleRelease.
57
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
83
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 57
def initialize(source, mod)
@mod = mod
@metadata = mod.metadata
name = mod.forge_name.tr('/', '-')
begin
version = Semantic::Version.parse(mod.version)
rescue Semantic::Version::ValidationFailure => e
Puppet.warning "#{mod.name} (#{mod.path}) has an invalid version number (#{mod.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)."
version = Semantic::Version.parse("0.0.0")
end
release = "#{name}@#{version}"
super(source, name, version, {})
if mod.dependencies
mod.dependencies.each do |dep|
results = Puppet::ModuleTool.parse_module_dependency(release, dep)
dep_name, parsed_range, range = results
dep.tap do |dep|
add_constraint('initialize', dep_name, range.to_s) do |node|
parsed_range === node.version
end
end
end
end
end
|
Instance Attribute Details
55
56
57
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 55
def metadata
@metadata
end
|
55
56
57
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 55
def mod
@mod
end
|
Instance Method Details
#install(dir) ⇒ Object
89
90
91
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 89
def install(dir)
end
|
#install_dir ⇒ Object
85
86
87
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 85
def install_dir
Pathname.new(@mod.path).dirname
end
|
93
94
95
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 93
def prepare
end
|