Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 93538
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: cpan [...] lxxi.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 5.90063



Subject: PATCH: fix Catalyst::Utils::term-width
diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 3f594e6..109a45d 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -393,9 +393,8 @@ sub term_width { my $width; eval ' - require Term::Size::Any; - my ($columns, $rows) = Term::Size::Any::chars; - $width = $columns; + use Term::Size::Any; + ($width, undef) = Term::Size::Any::chars; 1; ' or do { $width = $ENV{COLUMNS}
Subject: Re: [rt.cpan.org #93538] PATCH: fix Catalyst::Utils::term-width
Date: Wed, 5 Mar 2014 09:11:18 -0800
To: Manni Heumann via RT <bug-Catalyst-Runtime [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
Is there a bug that this patch is solving? It looks to me that the outcome is the same - $width gets the value of Term::Size::Any::chars. On Wed, Mar 05, 2014 at 04:48:27AM -0500, Manni Heumann via RT wrote: Show quoted text
> diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm > index 3f594e6..109a45d 100644 > --- a/lib/Catalyst/Utils.pm > +++ b/lib/Catalyst/Utils.pm > @@ -393,9 +393,8 @@ sub term_width { > > my $width; > eval ' > - require Term::Size::Any; > - my ($columns, $rows) = Term::Size::Any::chars; > - $width = $columns; > + use Term::Size::Any; > + ($width, undef) = Term::Size::Any::chars; > 1; > ' or do { > $width = $ENV{COLUMNS}
On Wed Mar 05 12:11:33 2014, ETHER wrote: Show quoted text
> > Is there a bug that this patch is solving? It looks to me that the outcome > is the same - $width gets the value of Term::Size::Any::chars.
Yes, this fixes a bug. Term::Size::Any does all its magic in its import() routine. Using only "require" would make the call to chars() fail which was nicely hidden by the string eval. So the import change here is from "require" to "use".
On Thu Mar 06 03:39:56 2014, MANNI wrote: Show quoted text
> So the import change here is from "require" to "use".
Sorry, "important" is what I really wanted to say.
This is fixed in the latest release.