Class: PuppetfileResolver::Puppetfile::Parser::R10KEval::DSL
- Inherits:
-
Object
- Object
- PuppetfileResolver::Puppetfile::Parser::R10KEval::DSL
- Defined in:
- lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb
Instance Method Summary collapse
- #forge(location) ⇒ Object
-
#initialize(puppetfile_document) ⇒ DSL
constructor
A new instance of DSL.
-
#method_missing(method_name, *_args) ⇒ Object
rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing.
- #mod(name, args = nil) ⇒ Object
- #moduledir(_location) ⇒ Object
Constructor Details
#initialize(puppetfile_document) ⇒ DSL
Returns a new instance of DSL.
10 11 12 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb', line 10 def initialize(puppetfile_document) @document = puppetfile_document end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *_args) ⇒ Object
rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
36 37 38 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb', line 36 def method_missing(method_name, *_args) # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing raise NoMethodError, "Unknown method #{method_name}" end |
Instance Method Details
#forge(location) ⇒ Object
28 29 30 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb', line 28 def forge(location) @document.forge_uri = location end |
#mod(name, args = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb', line 16 def mod(name, args = nil) # Get the module object mod = PuppetModule.from_puppetfile(name, args) # Inject the file location line_num = find_load_line_number mod.location.start_line = line_num mod.location.end_line = line_num # Append to the list of modules @document.add_module(mod) end |
#moduledir(_location) ⇒ Object
33 34 |
# File 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/dsl.rb', line 33 def moduledir(_location) end |