Class: R10kDiff::PuppetfileDSL
- Inherits:
-
Object
- Object
- R10kDiff::PuppetfileDSL
- Defined in:
- lib/r10kdiff.rb
Instance Attribute Summary collapse
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
Instance Method Summary collapse
- #forge(name) ⇒ Object
-
#initialize(puppetfile_text) ⇒ PuppetfileDSL
constructor
A new instance of PuppetfileDSL.
- #mod(name, args = {}) ⇒ Object
Constructor Details
#initialize(puppetfile_text) ⇒ PuppetfileDSL
Returns a new instance of PuppetfileDSL.
6 7 8 9 10 |
# File 'lib/r10kdiff.rb', line 6 def initialize(puppetfile_text) @forge = 'forge.puppetlabs.com' @modules = {} eval(puppetfile_text) end |
Instance Attribute Details
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
11 12 13 |
# File 'lib/r10kdiff.rb', line 11 def modules @modules end |
Instance Method Details
#forge(name) ⇒ Object
13 14 15 |
# File 'lib/r10kdiff.rb', line 13 def forge(name) @forge = name end |
#mod(name, args = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/r10kdiff.rb', line 17 def mod(name, args={}) args = {:ref => args} if args.is_a? String args[:ref] = "master" unless args[:ref] args[:forge] = "https://#{@forge}/#{name}" @modules[name] = PuppetModule.new name, args end |