summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/pp.rb10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index aba5ea1..e408104 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jun 17 02:01:00 2006 Tanaka Akira <akr@m17n.org>
+
+ * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
+ string.
+
Sat Jun 17 00:23:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
diff --git a/lib/pp.rb b/lib/pp.rb
index 81c8f48..540320f 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -46,8 +46,16 @@
require 'prettyprint'
module Kernel
+ # returns a pretty printed object as a string.
+ def pretty_inspect
+ PP.pp(self, '')
+ end
+
private
- def pp(*objs)
+ # prints arguments in pretty form.
+ #
+ # pp returns nil.
+ def pp(*objs) # :doc:
objs.each {|obj|
PP.pp(obj)
}