ruby-changes:48827
From: mame <ko1@a...>
Date: Thu, 30 Nov 2017 10:31:09 +0900 (JST)
Subject: [ruby-changes:48827] mame:r60944 (trunk): prelude.rb: Add Kernel#pp, a trigger for lib/pp.rb
mame 2017-11-30 10:31:00 +0900 (Thu, 30 Nov 2017) New Revision: 60944 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60944 Log: prelude.rb: Add Kernel#pp, a trigger for lib/pp.rb [Feature #14123] Modified files: trunk/NEWS trunk/lib/pp.rb trunk/prelude.rb Index: prelude.rb =================================================================== --- prelude.rb (revision 60943) +++ prelude.rb (revision 60944) @@ -141,3 +141,13 @@ class Binding https://github.com/ruby/ruby/blob/trunk/prelude.rb#L141 irb end end + +module Kernel + # prints arguments in pretty form. + # + # pp returns argument(s). + def pp(*objs) + require 'pp' + pp(objs) + end +end Index: lib/pp.rb =================================================================== --- lib/pp.rb (revision 60943) +++ lib/pp.rb (revision 60944) @@ -17,6 +17,7 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/pp.rb#L17 # prints arguments in pretty form. # # pp returns argument(s). + undef pp if method_defined?(:pp) def pp(*objs) objs.each {|obj| PP.pp(obj) Index: NEWS =================================================================== --- NEWS (revision 60943) +++ NEWS (revision 60944) @@ -76,6 +76,7 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L76 * Kernel * Kernel#yield_self [Feature #6721] + * Kernel#pp [Feature #14123] * Module * Module#attr, attr_accessor, attr_reader, attr_writer are now public [#14132] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/