lib/librarian/puppet/dsl.rb in librarian-puppet-1.0.5 vs lib/librarian/puppet/dsl.rb in librarian-puppet-1.0.6

- old
+ new

@@ -43,9 +43,17 @@ File.read(Pathname.new(specfile).parent.join('Modulefile')).lines.each do |line| regexp = /\s*dependency\s+('|")([^'"]+)\1\s*(?:,\s*('|")([^'"]+)\3)?/ regexp =~ line && mod($2, $4) end end + + # implement the 'metadata' syntax for Puppetfile + def metadata + dependencyList = JSON.parse(File.read(Pathname.new(specfile).parent.join('metadata.json')))['dependencies'] + dependencyList.each do |d| + mod(d['name'], d['version_requirement']) + end + end end end end end