Issue #7656 has been updated by vbatts (Vincent Batts).


interesting, doing a little bootleg debugging
<patch>
diff --git a/lib/pp.rb b/lib/pp.rb
index 6e0c797..681956d 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -145,13 +145,16 @@ class PP < PrettyPrint
     def pp(obj)
       id = obj.object_id
 
+      puts check_inspect_key(id)
       if check_inspect_key(id)
         group {obj.pretty_print_cycle self}
         return
       end
 
       begin
-        push_inspect_key(id)
+        puts push_inspect_key(id)
+        puts check_inspect_key(id)
+        p Thread.current[:__recursive_key__][:inspect]
         group {obj.pretty_print self}
       ensure
         pop_inspect_key(id) unless PP.sharing_detection
</patch>

and running
<~/foo.rb>
class Foo
  def pretty_print(q)
    q.text 'foo'
  end
end

f = Foo.new
pp f
</~/foo.rb>

I get the following results:

vbatts@satellite ~/src/ruby (trunk) $ ruby -I./lib -r pp  ~/foo.rb
false
true
true
{67976200=>true, 67976030=>true}
foo


----------------------------------------
Bug #7656: Handful of documentations
https://bugs.ruby-lang.org/issues/7656#change-35842

Author: vbatts (Vincent Batts)
Status: Feedback
Priority: Normal
Assignee: vbatts (Vincent Batts)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-08) [i686-linux]


This fixes documentation in ENV, adds a little for debug.rb, and completes PP


-- 
http://bugs.ruby-lang.org/