prelude.rb: Add Kernel#pp, a trigger for lib/pp.rb
[Feature #14123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87bcbf9ef5
commit
23c1fccf83
1
NEWS
1
NEWS
@ -76,6 +76,7 @@ with all sufficient information, see the ChangeLog file or Redmine
|
|||||||
* Kernel
|
* Kernel
|
||||||
|
|
||||||
* Kernel#yield_self [Feature #6721]
|
* Kernel#yield_self [Feature #6721]
|
||||||
|
* Kernel#pp [Feature #14123]
|
||||||
|
|
||||||
* Module
|
* Module
|
||||||
* Module#attr, attr_accessor, attr_reader, attr_writer are now public [#14132]
|
* Module#attr, attr_accessor, attr_reader, attr_writer are now public [#14132]
|
||||||
|
@ -17,6 +17,7 @@ module Kernel
|
|||||||
# prints arguments in pretty form.
|
# prints arguments in pretty form.
|
||||||
#
|
#
|
||||||
# pp returns argument(s).
|
# pp returns argument(s).
|
||||||
|
undef pp if method_defined?(:pp)
|
||||||
def pp(*objs)
|
def pp(*objs)
|
||||||
objs.each {|obj|
|
objs.each {|obj|
|
||||||
PP.pp(obj)
|
PP.pp(obj)
|
||||||
|
10
prelude.rb
10
prelude.rb
@ -141,3 +141,13 @@ class Binding
|
|||||||
irb
|
irb
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module Kernel
|
||||||
|
# prints arguments in pretty form.
|
||||||
|
#
|
||||||
|
# pp returns argument(s).
|
||||||
|
def pp(*objs)
|
||||||
|
require 'pp'
|
||||||
|
pp(objs)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user