From 7661ba82a3c765d4bf8a400a3c770f351c541f96 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Mon, 3 Jan 2011 16:28:24 -0800 Subject: maint: Prune #inspect methods on various objects Ruby's default #inspect method can lead to printing factorial-order output for large graphs of objects. Since we have large graphs of objects, this is not optimal. This patch replaces a few well-connected objects' #inspect methods with methods that produce reduced output, and are thus much faster. Paired-With: Nick Lewis --- lib/puppet/parser/ast.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 54e034acb..a5aaeddc4 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -19,6 +19,10 @@ class Puppet::Parser::AST attr_accessor :parent, :scope + def inspect + "( #{self.class} #{self.to_s} #{@children.inspect} )" + end + # don't fetch lexer comment by default def use_docs self.class.use_docs -- cgit