# File lib/puppet/dsl.rb, line 251 251: def scope 252: unless defined?(@scope) 253: # Set the code to something innocuous; we just need the 254: # scopes, not the interpreter. Hackish, but true. 255: Puppet[:code] = " " 256: @interp = Puppet::Parser::Interpreter.new 257: require 'puppet/node' 258: @node = Puppet::Node.new(Facter.value(:hostname)) 259: if env = Puppet[:environment] and env == "" 260: env = nil 261: end 262: @node.parameters = Facter.to_hash 263: @compile = Puppet::Parser::Compiler.new(@node, @interp.send(:parser, env)) 264: @scope = @compile.topscope 265: end 266: @scope 267: end