* lib/pp.rb (PP::PPMethods#object_address_group): adjust address format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3be312869d
commit
5a6ed851fe
@ -1,3 +1,7 @@
|
|||||||
|
Mon Nov 28 20:24:22 2005 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* lib/pp.rb (PP::PPMethods#object_address_group): adjust address format.
|
||||||
|
|
||||||
Mon Nov 28 18:55:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Nov 28 18:55:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (init_inetsock_internal): remove setting
|
* ext/socket/socket.c (init_inetsock_internal): remove setting
|
||||||
|
@ -150,8 +150,15 @@ class PP < PrettyPrint
|
|||||||
group(1, '#<' + obj.class.name, '>', &block)
|
group(1, '#<' + obj.class.name, '>', &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
case Object.new.inspect
|
||||||
|
when /\A\#<Object:0x([0-9a-f]+)>\z/
|
||||||
|
PointerFormat = "%0#{$1.length}x"
|
||||||
|
else
|
||||||
|
PointerFormat = "%x"
|
||||||
|
end
|
||||||
|
|
||||||
def object_address_group(obj, &block)
|
def object_address_group(obj, &block)
|
||||||
id = "%x" % (obj.__id__ * 2)
|
id = PointerFormat % (obj.__id__ * 2)
|
||||||
id.sub!(/\Af(?=[[:xdigit:]]{2}+\z)/, '') if id.sub!(/\A\.\./, '')
|
id.sub!(/\Af(?=[[:xdigit:]]{2}+\z)/, '') if id.sub!(/\A\.\./, '')
|
||||||
group(1, "\#<#{obj.class}:0x#{id}", '>', &block)
|
group(1, "\#<#{obj.class}:0x#{id}", '>', &block)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user