37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/vendor/puppet/module_tool/applications/application.rb', line 37
def metadata(require_modulefile = false)
unless @metadata
unless @path
raise ArgumentError, "Could not determine module path"
end
@metadata = Puppet::ModuleTool::Metadata.new
contents = ContentsDescription.new(@path)
contents.annotate(@metadata)
checksums = Checksums.new(@path)
checksums.annotate(@metadata)
modulefile_path = File.join(@path, 'Modulefile')
if File.file?(modulefile_path)
Puppet::ModuleTool::ModulefileReader.evaluate(@metadata, modulefile_path)
elsif require_modulefile
raise ArgumentError, "No Modulefile found."
end
end
@metadata
end
|