Method: Puppet::Parser::Parser#parse_ruby_file
- Defined in:
- lib/vendor/puppet/parser/parser_support.rb
#parse_ruby_file ⇒ Object
187 188 189 190 191 192 193 194 195 |
# File 'lib/vendor/puppet/parser/parser_support.rb', line 187 def parse_ruby_file # Execute the contents of the file inside its own "main" object so # that it can call methods in the resource type API. main_object = Puppet::DSL::ResourceTypeAPI.new main_object.instance_eval(File.read(self.file)) # Then extract any types that were created. Puppet::Parser::AST::ASTArray.new :children => main_object.instance_eval { @__created_ast_objects__ } end |