Class: PuppetLibrary::ModuleMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_library/server.rb

Instance Method Summary collapse

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

#authorObject



42
43
44
# File 'lib/puppet_library/server.rb', line 42

def author
    ["name"][/^[^-]+/]
end

#dependenciesObject



58
59
60
# File 'lib/puppet_library/server.rb', line 58

def dependencies
    ["dependencies"]
end

#dependency_namesObject



62
63
64
# File 'lib/puppet_library/server.rb', line 62

def dependency_names
    dependencies.map {|d| d["name"]}
end

#full_nameObject



50
51
52
# File 'lib/puppet_library/server.rb', line 50

def full_name
    ["name"].sub("-", "/")
end

#nameObject



46
47
48
# File 'lib/puppet_library/server.rb', line 46

def name
    ["name"].sub(/^[^-]+-/, "")
end

#to_infoObject



66
67
68
69
70
71
72
73
74
# File 'lib/puppet_library/server.rb', line 66

def to_info
    {
        "author" => author,
        "full_name" => full_name,
        "name" => name,
        "desc" => ["description"],
        "releases" => [ { "version" => version } ]
    }
end

#to_versionObject



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

#versionObject



54
55
56
# File 'lib/puppet_library/server.rb', line 54

def version
    ["version"]
end