diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2011-01-03 16:28:24 -0800 |
|---|---|---|
| committer | Jesse Wolfe <jes5199@gmail.com> | 2011-01-03 16:28:24 -0800 |
| commit | 7661ba82a3c765d4bf8a400a3c770f351c541f96 (patch) | |
| tree | 89e9736c4357dd17ef6bc128af11890a5f93a64e /lib/puppet/parser | |
| parent | 10f89de6e55429fcb055b15a513d01e6e20f03b9 (diff) | |
| download | puppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.tar.gz puppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.tar.xz puppet-7661ba82a3c765d4bf8a400a3c770f351c541f96.zip | |
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 <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/ast.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |
