summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/pp.rb13
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 91a7ecbab6..3c5ca3a7af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 7 21:57:25 2003 Tanaka Akira <akr@m17n.org>
+
+ * lib/pp.rb (Kernel.pp): module function.
+ (MatchData#pretty_print): new method.
+
Fri Mar 7 20:27:19 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ext/tcltklib/extconf.rb (find_tcl, find_tk): return true if
diff --git a/lib/pp.rb b/lib/pp.rb
index b14611ff05..2d09af4344 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -127,6 +127,7 @@ module Kernel
}
nil
end
+ module_function :pp
end
class PP < PrettyPrint
@@ -410,6 +411,18 @@ class File
end
end
+class MatchData
+ def pretty_print(pp)
+ pp.object_group(self) {
+ pp.breakable
+ 1.upto(self.size) {|i|
+ pp.breakable unless pp.first?
+ pp.pp self[i-1]
+ }
+ }
+ end
+end
+
class Object
include PP::ObjectMixin
end