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
|
# 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 |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
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
87
88
89
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 87
def install(dir)
end
|
#install_dir ⇒ Object
83
84
85
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 83
def install_dir
Pathname.new(@mod.path).dirname
end
|
91
92
93
|
# File 'lib/puppet/module_tool/installed_modules.rb', line 91
def prepare
end
|