End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
PrettyPrint.format
format(output=''.dup, maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n}) { |q| ... }
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/prettyprint.rb, line 45
def PrettyPrint.format(output=''.dup, maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
q = PrettyPrint.new(output, maxwidth, newline, &genspace)
yield q
q.flush
output
end
This is a convenience method which is same as follows:
Example
begin q = PrettyPrint.new(output, maxwidth, newline, &genspace) ... q.flush output end