Project

General

Profile

Bug #5430 ยป 0001-Put-PP-documentation-visible.patch

sdaubert (Sylvain Daubert), 10/10/2011 01:37 AM

View differences:

lib/pp.rb
require 'prettyprint'
module Kernel
# returns a pretty printed object as a string.
def pretty_inspect
PP.pp(self, '')
end
private
# prints arguments in pretty form.
#
# pp returns argument(s).
def pp(*objs) # :doc:
objs.each {|obj|
PP.pp(obj)
}
objs.size <= 1 ? objs.first : objs
end
module_function :pp
end
# == Pretty-printer for Ruby objects.
#
# = Which seems better?
......
#
# = Author
# Tanaka Akira <akr@m17n.org>
require 'prettyprint'
module Kernel
# returns a pretty printed object as a string.
def pretty_inspect
PP.pp(self, '')
end
private
# prints arguments in pretty form.
#
# pp returns argument(s).
def pp(*objs) # :doc:
objs.each {|obj|
PP.pp(obj)
}
objs.size <= 1 ? objs.first : objs
end
module_function :pp
end
class PP < PrettyPrint
# Outputs +obj+ to +out+ in pretty printed format of
# +width+ columns in width.
    (1-1/1)