From: trans Date: 2009-09-24T23:03:22+09:00 Subject: Re: How do you limit the line length of the output commands? Where is pqueue library documented? On Sep 23, 5:59 pm, Mason Kelsey wrote: > There must be an easy way to solve the problem of controlling the length of > the output line, forcing the rest into a line break.  In the puts code > example below, I want to break between every 10 methods or just go to a new > line after every 60 characters that get displayed so they don't run off the > screen. > > First Question: What is an easy way to modify the below puts code to control > line length without truncation? > > require "pqueue" > pq=PQueue.new(proc{|x,y| x[0][0] puts pq.methods.join(', ')  # Displays the methods of PQueue Class > > I've a tried puts, print, and p and they never do a word wrap or such.  Is > there a secret parameter for controlling the line length before word wrap > occurs in these commands? > > Second question: The pqueue library is not documented inhttp://www.ruby-doc.org/stdlib/.  Is there a > reason for that?  Or is it cleverly hidden in a class that doesn't seem to > have anything to do with priority queues? I've been transitioning to GitHub, and thanks to your question, this morning I got the Grancher plugin for my build system running, so now you can find it here: http://rubyworks.github.com/pqueue/ Thanks, T.