diff options
author | Luke Kanies <luke@madstop.com> | 2008-03-31 23:56:09 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-03-31 23:56:09 -0500 |
commit | 88dc49cb7b0efe757c92ce28c807b91335acb07a (patch) | |
tree | 13fe4561f1f524f97a8bb2c1ff84c1ef981d0241 /lib/puppet/parser/ast/astarray.rb | |
parent | 4165edaeb71ee2883b1bb85ff39a52d5628b259f (diff) | |
parent | a8592f1009040ebf30a98268610915cc33bb3f63 (diff) | |
download | puppet-88dc49cb7b0efe757c92ce28c807b91335acb07a.tar.gz puppet-88dc49cb7b0efe757c92ce28c807b91335acb07a.tar.xz puppet-88dc49cb7b0efe757c92ce28c807b91335acb07a.zip |
Merge branch 'master' into master_no_global_resources
Conflicts:
lib/puppet/node/catalog.rb
lib/puppet/type/pfile.rb
lib/puppet/type/pfilebucket.rb
lib/puppet/util/filetype.rb
spec/unit/node/catalog.rb
spec/unit/other/transbucket.rb
spec/unit/ral/provider/mount/parsed.rb
spec/unit/ral/types/file.rb
spec/unit/ral/types/interface.rb
spec/unit/ral/types/mount.rb
spec/unit/ral/types/package.rb
spec/unit/ral/types/schedule.rb
spec/unit/ral/types/service.rb
test/language/compile.rb
test/language/lexer.rb
test/language/snippets.rb
test/lib/puppettest.rb
test/ral/types/basic.rb
test/ral/types/cron.rb
test/ral/types/exec.rb
test/ral/types/file.rb
test/ral/types/file/target.rb
test/ral/types/filebucket.rb
test/ral/types/fileignoresource.rb
test/ral/types/filesources.rb
test/ral/types/group.rb
test/ral/types/host.rb
test/ral/types/parameter.rb
test/ral/types/sshkey.rb
test/ral/types/tidy.rb
test/ral/types/user.rb
test/ral/types/yumrepo.rb
Diffstat (limited to 'lib/puppet/parser/ast/astarray.rb')
-rw-r--r-- | lib/puppet/parser/ast/astarray.rb | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/lib/puppet/parser/ast/astarray.rb b/lib/puppet/parser/ast/astarray.rb index 5f1e838d0..8f09aa922 100644 --- a/lib/puppet/parser/ast/astarray.rb +++ b/lib/puppet/parser/ast/astarray.rb @@ -15,18 +15,7 @@ class Puppet::Parser::AST end # Evaluate our children. - def evaluate(hash) - scope = hash[:scope] - rets = nil - # We basically always operate declaratively, and when we - # do we need to evaluate the settor-like statements first. This - # is basically variable and type-default declarations. - # This is such a stupid hack. I've no real idea how to make a - # "real" declarative language, so I hack it so it looks like - # one, yay. - settors = [] - others = [] - + def evaluate(scope) # Make a new array, so we don't have to deal with the details of # flattening and such items = [] @@ -35,23 +24,15 @@ class Puppet::Parser::AST @children.each { |child| if child.instance_of?(AST::ASTArray) child.each do |ac| - if ac.class.settor? - settors << ac - else - others << ac - end + items << ac end else - if child.class.settor? - settors << child - else - others << child - end + items << child end } - rets = [settors, others].flatten.collect { |child| - child.safeevaluate(:scope => scope) + rets = items.flatten.collect { |child| + child.safeevaluate(scope) } return rets.reject { |o| o.nil? } end |