summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pp.rb13
1 files changed, 13 insertions, 0 deletions
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