Class: Puppet::ModuleTool::LocalTarball::ModuleRelease
- Inherits:
-
SemanticPuppet::Dependency::ModuleRelease
- Object
- SemanticPuppet::Dependency::ModuleRelease
- Puppet::ModuleTool::LocalTarball::ModuleRelease
- Defined in:
- lib/puppet/module_tool/local_tarball.rb
Instance Attribute Summary collapse
-
#install_dir ⇒ Object
readonly
Returns the value of attribute install_dir.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
Attributes inherited from SemanticPuppet::Dependency::ModuleRelease
Instance Method Summary collapse
-
#initialize(source, mod) ⇒ ModuleRelease
constructor
A new instance of ModuleRelease.
- #install(dir) ⇒ Object
- #prepare ⇒ Object
Methods inherited from SemanticPuppet::Dependency::ModuleRelease
#<=>, #eql?, #hash, #priority, #to_s
Methods included from SemanticPuppet::Dependency::GraphNode
#<<, #<=>, #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.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 46 def initialize(source, mod) @mod = mod @metadata = mod. name = mod.forge_name.tr('/', '-') version = SemanticPuppet::Version.parse(mod.version) release = "#{name}@#{version}" if mod.dependencies dependencies = mod.dependencies.map do |dep| Puppet::ModuleTool.parse_module_dependency(release, dep, mod.strict_semver?)[0..1] end dependencies = Hash[dependencies] end super(source, name, version, dependencies || {}) end |
Instance Attribute Details
#install_dir ⇒ Object (readonly)
Returns the value of attribute install_dir.
44 45 46 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 44 def install_dir @install_dir end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
44 45 46 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 44 def @metadata end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
44 45 46 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 44 def mod @mod end |
Instance Method Details
#install(dir) ⇒ Object
63 64 65 66 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 63 def install(dir) @source.install(self, dir) @install_dir = dir end |
#prepare ⇒ Object
68 69 70 |
# File 'lib/puppet/module_tool/local_tarball.rb', line 68 def prepare @source.prepare(self) end |