diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-04 15:14:39 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-04 15:14:39 -0500 |
| commit | 11b127bd6708a18b512ca5b3018ccff1200cc47a (patch) | |
| tree | 55d6f42b78404d6e6058f5bef2e50b6bf06b7105 /lib/puppet/parser/ast | |
| parent | 3b2efd2a4b32478b6c6a71e1421061405a0bb11e (diff) | |
| download | puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.tar.gz puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.tar.xz puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.zip | |
Successfully modified all tests and code so that all language tests pass again. This is the majority of the work necessary to make the separate "configuration" object work.
Diffstat (limited to 'lib/puppet/parser/ast')
| -rw-r--r-- | lib/puppet/parser/ast/definition.rb | 11 | ||||
| -rw-r--r-- | lib/puppet/parser/ast/node.rb | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/puppet/parser/ast/definition.rb b/lib/puppet/parser/ast/definition.rb index 9ad1f539d..1cdaa6431 100644 --- a/lib/puppet/parser/ast/definition.rb +++ b/lib/puppet/parser/ast/definition.rb @@ -37,12 +37,12 @@ class Puppet::Parser::AST # Additionally, add a tag for whatever kind of class # we are if @classname != "" and ! @classname.nil? - @classname.split(/::/).each { |tag| scope.tag(tag) } + @classname.split(/::/).each { |tag| scope.resource.tag(tag) } end [resource.name, resource.title].each do |str| unless str.nil? or str =~ /[^\w]/ or str == "" - scope.tag(str) + scope.resource.tag(str) end end @@ -123,10 +123,7 @@ class Puppet::Parser::AST end # Create a new subscope in which to evaluate our code. - def subscope(scope, resource = nil) - unless resource - raise ArgumentError, "Resources are required when creating subscopes" - end + def subscope(scope, resource) args = { :resource => resource, :keyword => self.keyword, @@ -192,7 +189,7 @@ class Puppet::Parser::AST # [default.inspect, arg.inspect, @name.inspect] else parsefail "Must pass %s to %s of type %s" % - [arg,title,@classname] + [arg, resource.title, @classname] end end } diff --git a/lib/puppet/parser/ast/node.rb b/lib/puppet/parser/ast/node.rb index 20c03f4ce..a296e43ba 100644 --- a/lib/puppet/parser/ast/node.rb +++ b/lib/puppet/parser/ast/node.rb @@ -19,7 +19,7 @@ class Puppet::Parser::AST # We don't have to worry about the declarativeness of node parentage, # because the entry point is always a single node definition. if parent = self.parentobj - scope = parent.safeevaluate :scope => scope + scope = parent.safeevaluate :scope => scope, :resource => options[:resource] end scope = scope.newscope( |
