зеркало из https://github.com/github/ruby.git
* lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
53a31d9df4
Коммит
eeda97f8e3
|
@ -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>
|
Sat Jun 17 00:23:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
|
* parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
|
||||||
|
|
10
lib/pp.rb
10
lib/pp.rb
|
@ -46,8 +46,16 @@
|
||||||
require 'prettyprint'
|
require 'prettyprint'
|
||||||
|
|
||||||
module Kernel
|
module Kernel
|
||||||
|
# returns a pretty printed object as a string.
|
||||||
|
def pretty_inspect
|
||||||
|
PP.pp(self, '')
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def pp(*objs)
|
# prints arguments in pretty form.
|
||||||
|
#
|
||||||
|
# pp returns nil.
|
||||||
|
def pp(*objs) # :doc:
|
||||||
objs.each {|obj|
|
objs.each {|obj|
|
||||||
PP.pp(obj)
|
PP.pp(obj)
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче