This has largely been replaced by Puppet::Type.metaparameters, which returns an array instead of yielding the parameters individually.
Signed-off-by: Luke Kanies <[email protected]> --- Local-branch: refactor/master/8233-refactor_parameter_management lib/puppet/parser/compiler.rb | 6 +++--- lib/puppet/parser/resource.rb | 6 +++--- lib/puppet/type.rb | 4 ---- test/language/snippets.rb | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index c1daade..5df8631 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -372,9 +372,9 @@ class Puppet::Parser::Compiler end names = [] - Puppet::Type.eachmetaparam do |name| - next if Puppet::Parser::Resource.relationship_parameter?(name) - names << name + Puppet::Type.metaparameters.each do |param| + next if Puppet::Parser::Resource.relationship_parameter?(param.name) + names << param.name end data = {} diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index 3bb5f86..08bd615 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -272,9 +272,9 @@ class Puppet::Parser::Resource < Puppet::Resource def add_metaparams compat_mode = metaparam_compatibility_mode? - Puppet::Type.eachmetaparam do |name| - next unless self.class.relationship_parameter?(name) - add_backward_compatible_relationship_param(name) if compat_mode + Puppet::Type.metaparameters.each do |param| + next unless self.class.relationship_parameter?(param.name) + add_backward_compatible_relationship_param(param.name) if compat_mode end end diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index f6844f3..6a7f193 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -278,10 +278,6 @@ class Type parameters.find_all { |p| p.property? } end - def self.eachmetaparam - parameters.each { |p| yield p.name } - end - def self.validattr?(name) valid_parameter?(name) end diff --git a/test/language/snippets.rb b/test/language/snippets.rb index bfc14fa..5ac69c1 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -104,8 +104,8 @@ class TestSnippets < Test::Unit::TestCase def metaparams(type) mparams = [] - Puppet::Type.eachmetaparam { |param| - mparams.push param + Puppet::Type.metaparameters.each { |param| + mparams.push param.name } mparams -- 1.7.3.1 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
