Method: Puppet::Parser::ScriptCompiler#newscope
- Defined in:
- lib/puppet/parser/script_compiler.rb
#newscope(parent, options = {}) ⇒ Object
Having multiple named scopes hanging from top scope is not supported when scripting in the regular compiler this is used to create one named scope per class. When scripting, the “main class” is just a container of the top level code to evaluate and it is not evaluated as a class added to a catalog. Since classes are not supported there is no need to support the concept of “named scopes” as all variables are local
- or in the top scope itself (notably, the $settings
-
namespace is initialized
as just a set of variables in that namespace - there is no named scope for ‘settings’ when scripting.
Keeping this method here to get specific error as being unsure if there are functions/logic that will call this. The AbstractCompiler defines this method, but maybe it does not have to (TODO).
111 112 113 |
# File 'lib/puppet/parser/script_compiler.rb', line 111 def newscope(parent, = {}) raise _('having multiple named scopes is not supported when scripting') end |