diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-20 19:17:15 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-20 19:17:15 +0000 |
commit | d0ea0b4a8dd44a90bdd3cd83ac94fe1ba4aea440 (patch) | |
tree | 53ff6469a06d46510037997c40f5e1018dbf8eee | |
parent | f345126746242a7269654a0d9db64f0518462f41 (diff) | |
download | ruby-d0ea0b4a8dd44a90bdd3cd83ac94fe1ba4aea440.tar.gz |
refine previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/pp.rb | 21 |
2 files changed, 4 insertions, 24 deletions
@@ -1,7 +1,8 @@ -Tue Jan 21 02:55:10 2003 Tanaka Akira <akr@m17n.org> +Tue Jan 21 04:15:50 2003 Tanaka Akira <akr@m17n.org> - * lib/pp.rb: Don't redefine `inspect'. - (pretty_print_inspect): new method. + * lib/pp.rb: Use redefined `to_s' as well as `inspect'. + Useless `pretty_print' methods removed. + (PP::ObjectMixin#pretty_print_inspect): new method. Mon Jan 20 21:48:43 2003 Akinori MUSHA <knu@iDaemons.org> @@ -242,7 +242,6 @@ class PP < PrettyPrint # 3. generic pretty_print def pretty_print(pp) - # specific pretty_print is not defined, try specific inspect. if /\(Kernel\)#/ !~ method(:inspect).inspect || /\(Kernel\)#/ !~ method(:to_s).inspect pp.text inspect @@ -271,14 +270,6 @@ class PP < PrettyPrint end end -[Numeric, FalseClass, TrueClass, Module].each {|c| - c.class_eval { - def pretty_print(pp) - pp.text self.to_s - end - } -} - class Array def pretty_print(pp) pp.group(1, '[', ']') { @@ -419,22 +410,10 @@ class File end end -class << ARGF - def pretty_print(pp) - pp.text self.to_s - end -end - class Object include PP::ObjectMixin end -[Numeric, Symbol, FalseClass, TrueClass, NilClass, Module].each {|c| - c.class_eval { - alias :pretty_print_cycle :pretty_print - } -} - if __FILE__ == $0 require 'runit/testcase' require 'runit/cui/testrunner' |