CC: | pedros [...] berkeley.edu |
Subject: | is_interactive() call should honor Term::ProgressBar's 'fh' field |
If Term::ProgressBar's configuration hash includes the 'fh' (filehandle)
field, the respective value should be passed on to
IO::Interactive::is_interactive(), otherwise Term::ProgressBar::Quiet is
broken on STDOUT redirection. Small patch attached.
Subject: | Quiet.pm.0.31.patch |
*** Quiet.pm 2010-05-29 23:26:17.000000000 -0700
--- Quiet.pm.new 2010-05-29 23:28:25.000000000 -0700
***************
*** 8,14 ****
sub new {
my $class = shift;
! if ( is_interactive ) {
return Term::ProgressBar->new(@_);
} else {
my $mock = Test::MockObject->new();
--- 8,14 ----
sub new {
my $class = shift;
! if ( is_interactive( $_[0]->{fh} if $_[0]->{fh} ) ) {
return Term::ProgressBar->new(@_);
} else {
my $mock = Test::MockObject->new();