Commits

Burak Gürsoy  committed 5cdb36a

Just use SPEC

  • Participants
  • Parent commits dd9b666

Comments (0)

Files changed (3)

File Build.PL

-use strict;
-use warnings;
-use lib qw( builder );
-use Build;
-
-my $mb = Build->new;
-$mb->change_versions( 1 );
-$mb->copyright_first_year( '2011' );
-$mb->add_pod_author_copyright_license( 1 );
-$mb->create_build_script;
-
-1;
             repository => 'http://bitbucket.org/burak/cpan-file-tailx/',
         },
     },
+    BUILDER => {
+        change_versions                  => 1,
+        copyright_first_year             => '2011',
+        add_pod_author_copyright_license => 1,
+    },
 }

File lib/File/Tailx.pm

 use constant LEGACY_PERL          => $] < 5.006;
 use constant IS_WINDOWS           => $^O =~ m{ \A MSWin }xmsi;
 use constant CALLER_SUB           => 3;
-use constant LOG_LINE             => IS_WINDOWS ? '%s' : "\033[7m %s \033[0m";
+use constant LOG_LINE             =>  ( IS_WINDOWS || $ENV{FILE_TAILX_NO_COLOR} )
+                                            ? '%s'
+					    : "\033[7m %s \033[0m";
 use constant LOG_CALLER           => '% -27s';
 
 use constant CALCLEN_BUFFER       =>   1024;
     my $prev = $self->{errormode};
     return $prev if ! $mode;
 
-    if ( ref $mode eq 'CODE' ) {
-        $self->{errormode} = $mode;
+    if ( ref $mode eq 'ARRAY' && ref $mode->[0] ne 'CODE' ) {
+        croak 'bad errmode: first item in list must be a code ref';
     }
-    elsif ( ref $mode eq 'ARRAY' ) {
-        if ( ref $mode->[0] ne 'CODE' ) {
-            croak 'bad errmode: first item in list must be a code ref';
-        }
-        $self->{errormode} = $mode;
-    }
-    else {
-        $self->{errormode} = lc $mode;
-    }
+
+    $self->{errormode} = ref $mode ? $mode : lc $mode;
+
     return $self->{errormode};
 }