Class: Librarian::Puppet::Dsl::Receiver
- Inherits:
-
Dsl::Receiver
- Object
- Dsl::Receiver
- Librarian::Puppet::Dsl::Receiver
- Defined in:
- lib/librarian/puppet/dsl.rb
Instance Attribute Summary collapse
-
#specfile ⇒ Object
readonly
Returns the value of attribute specfile.
Instance Method Summary collapse
-
#modulefile ⇒ Object
implement the ‘modulefile’ syntax for Puppetfile.
-
#run(specfile = nil) ⇒ Object
save the specfile and call librarian.
Instance Attribute Details
#specfile ⇒ Object (readonly)
Returns the value of attribute specfile.
33 34 35 |
# File 'lib/librarian/puppet/dsl.rb', line 33 def specfile @specfile end |
Instance Method Details
#modulefile ⇒ Object
implement the ‘modulefile’ syntax for Puppetfile
42 43 44 45 46 47 |
# File 'lib/librarian/puppet/dsl.rb', line 42 def modulefile 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 |
#run(specfile = nil) ⇒ Object
save the specfile and call librarian
36 37 38 39 |
# File 'lib/librarian/puppet/dsl.rb', line 36 def run(specfile = nil) @specfile = specfile super end |