summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--lib/pp.rb1
-rw-r--r--prelude.rb10
3 files changed, 12 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index cdd293c822..7450f9c19f 100644
--- a/NEWS
+++ b/NEWS
@@ -76,6 +76,7 @@ with all sufficient information, see the ChangeLog file or Redmine
* Kernel
* Kernel#yield_self [Feature #6721]
+ * Kernel#pp [Feature #14123]
* Module
* Module#attr, attr_accessor, attr_reader, attr_writer are now public [#14132]
diff --git a/lib/pp.rb b/lib/pp.rb
index 7d1c502817..0e737d23f6 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -17,6 +17,7 @@ module Kernel
# prints arguments in pretty form.
#
# pp returns argument(s).
+ undef pp if method_defined?(:pp)
def pp(*objs)
objs.each {|obj|
PP.pp(obj)
diff --git a/prelude.rb b/prelude.rb
index 7b98e28285..c8833a3ae6 100644
--- a/prelude.rb
+++ b/prelude.rb
@@ -141,3 +141,13 @@ class Binding
irb
end
end
+
+module Kernel
+ # prints arguments in pretty form.
+ #
+ # pp returns argument(s).
+ def pp(*objs)
+ require 'pp'
+ pp(objs)
+ end
+end