Class: PuppetLibrary::ModuleMetadata
- Inherits:
-
Object
- Object
- PuppetLibrary::ModuleMetadata
- Defined in:
- lib/puppet_library/server.rb
Instance Method Summary collapse
- #author ⇒ Object
- #dependencies ⇒ Object
- #dependency_names ⇒ Object
- #full_name ⇒ Object
-
#initialize(metadata) ⇒ ModuleMetadata
constructor
A new instance of ModuleMetadata.
- #name ⇒ Object
- #to_info ⇒ Object
- #to_version ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(metadata) ⇒ ModuleMetadata
Returns a new instance of ModuleMetadata.
38 39 40 |
# File 'lib/puppet_library/server.rb', line 38 def initialize() = end |
Instance Method Details
#author ⇒ Object
42 43 44 |
# File 'lib/puppet_library/server.rb', line 42 def ["name"][/^[^-]+/] end |
#dependencies ⇒ Object
58 59 60 |
# File 'lib/puppet_library/server.rb', line 58 def dependencies ["dependencies"] end |
#dependency_names ⇒ Object
62 63 64 |
# File 'lib/puppet_library/server.rb', line 62 def dependency_names dependencies.map {|d| d["name"]} end |
#full_name ⇒ Object
50 51 52 |
# File 'lib/puppet_library/server.rb', line 50 def full_name ["name"].sub("-", "/") end |
#name ⇒ Object
46 47 48 |
# File 'lib/puppet_library/server.rb', line 46 def name ["name"].sub(/^[^-]+-/, "") end |
#to_info ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/puppet_library/server.rb', line 66 def to_info { "author" => , "full_name" => full_name, "name" => name, "desc" => ["description"], "releases" => [ { "version" => version } ] } end |
#to_version ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/puppet_library/server.rb', line 76 def to_version { "file" => "/modules/#{author}-#{name}-#{version}.tar.gz", "version" => version, "dependencies" => dependencies.map {|m| [ m["name"], m["version_requirement"] ]} } end |
#version ⇒ Object
54 55 56 |
# File 'lib/puppet_library/server.rb', line 54 def version ["version"] end |