class Librarian::Puppet::Dsl::Receiver
Attributes
Public Instance Methods
Source
# File lib/librarian/puppet/dsl.rb, line 88 def metadata f = working_path.join('metadata.json') raise Error, "Metadata file does not exist: #{f}" unless File.exist?(f) begin json = JSON.parse(File.read(f)) rescue JSON::ParserError => e raise Error, "Unable to parse json file #{f}: #{e}" end dependencyList = json['dependencies'] dependencyList.each do |d| mod(d['name'], d['version_requirement']) end end
implement the ‘metadata’ syntax for Puppetfile
Source
# File lib/librarian/puppet/dsl.rb, line 81 def run(specfile = nil) @working_path = specfile.is_a?(Pathname) ? specfile.parent : Pathname.new(Dir.pwd) @specfile = specfile super end
save the specfile and call librarian
Calls superclass method