[Rake-devel] rake task descriptions and display width

Jason LaPier jason.lapier at gmail.com
Wed May 21 10:01:21 EDT 2008

I wrote a patch for basically the same thing (size based on an
environment variable) a couple months back, and included a test:

Alex Chaffee came up with a different approach that's meant to
identify your terminal width:

I think Jim was trying to decide the best way to go about it, and it's
going to be fixed one way or another in the next release.

- Jason L.

On Wed, May 21, 2008 at 4:48 AM, James Tucker <jftucker at gmail.com> wrote:
> Hi anyone/all,
> Minor one, but it's been bugging me for a while. I want to see the full
> descriptions of rake tasks sometimes, or at least, a lot more of the
> description than 60 something chars. I had a look in rake.rb around the
> various things, spotted the fact that there is code for full descriptions,
> but that it's currently defaulted to false, I think all the time.
> Anyway, more useful than this, to me at least, is to be able to use a known
> width of the screen where possible, so I added the following code starting
> at line 2012 of rake.rb. I would have provided a patch (and test cases), but
> I threw this together fast and dirty (inside the gem install), so the
> procedure would have been significantly longer.
> The following code is useful under environments where the user has:
>  * shopt -s checkwinsize (bash, or some other equivalent in other shells
> (sets COLUMNS and ROWS)).
>  * export COLUMNS
> It works as it previously did under conditions where the environment
> variable is not available.
> Thanks for Rake, it's awesome,
> James.
> Code:
> =====
>        # if ENV['COLUMNS'] is nil, we want to supply 80 to Integer(), else
> we get 0 for nil.
>        # if ENV['COLUMNS'] if for some reason 'foo', we need to rescue and
> return 80.
>        display_cols = Integer(ENV['COLUMNS'] || 80) rescue 80
>        max_column = display_cols - name.size - width - 7
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel

My Rails and Linux Blog: http://offtheline.net

More information about the Rake-devel mailing list