From: Vincent Pit Date: Sat, 24 Aug 2013 22:01:32 +0000 (-0300) Subject: Switch qw delimiters to <> X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=80656eec9bd2400f8db71d0d10d7d0be54139667;p=perl%2Fmodules%2Frgit.git Switch qw delimiters to <> --- diff --git a/bin/rgit b/bin/rgit index 36737b2..cb9d31e 100755 --- a/bin/rgit +++ b/bin/rgit @@ -3,12 +3,12 @@ use strict; use warnings; -use Carp qw/croak/; -use Config qw/%Config/; -use Cwd qw/cwd/; +use Carp qw; +use Config qw<%Config>; +use Cwd qw; use App::Rgit; -use App::Rgit::Utils qw/:levels/; +use App::Rgit::Utils qw<:levels>; use App::Rgit::Policy; our $VERSION; diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index f0bbdde..ef56f6c 100644 --- a/lib/App/Rgit.pm +++ b/lib/App/Rgit.pm @@ -86,7 +86,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/config command/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head1 SEE ALSO diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index b4d78dd..8761da3 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -5,7 +5,7 @@ use warnings; use Carp (); -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; =head1 NAME @@ -39,7 +39,7 @@ Creates a new command object for C<$cmd> that is bound to be called with argumen =cut my %commands; -__PACKAGE__->action($_ => 'Once') for qw/daemon gui help init version/, ' '; +__PACKAGE__->action($_ => 'Once') for qw, ' '; sub new { my $class = shift; @@ -120,7 +120,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/cmd args policy/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head2 C diff --git a/lib/App/Rgit/Command/Each.pm b/lib/App/Rgit/Command/Each.pm index b50e180..fc5f10d 100644 --- a/lib/App/Rgit/Command/Each.pm +++ b/lib/App/Rgit/Command/Each.pm @@ -3,10 +3,10 @@ package App::Rgit::Command::Each; use strict; use warnings; -use base qw/App::Rgit::Command/; +use base qw; use App::Rgit::Guard; -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; =head1 NAME diff --git a/lib/App/Rgit/Command/Once.pm b/lib/App/Rgit/Command/Once.pm index 630f252..bcba756 100644 --- a/lib/App/Rgit/Command/Once.pm +++ b/lib/App/Rgit/Command/Once.pm @@ -3,7 +3,7 @@ package App::Rgit::Command::Once; use strict; use warnings; -use base qw/App::Rgit::Command/; +use base qw; =head1 NAME diff --git a/lib/App/Rgit/Config.pm b/lib/App/Rgit/Config.pm index c384203..7e5fa8f 100644 --- a/lib/App/Rgit/Config.pm +++ b/lib/App/Rgit/Config.pm @@ -8,7 +8,7 @@ use Cwd (); # cwd use File::Spec (); # canonpath, catfile, path use App::Rgit::Repository; -use App::Rgit::Utils qw/:levels/; # :levels, abs_path +use App::Rgit::Utils qw<:levels>; # :levels, abs_path use constant IS_WIN32 => $^O eq 'MSWin32'; @@ -68,7 +68,7 @@ sub new { if (IS_WIN32) { my @acc; for my $c (@candidates) { - push @acc, $c, map "$c.$_", qw/exe com bat cmd/; + push @acc, $c, map "$c.$_", qw; } @candidates = @acc; } @@ -148,7 +148,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/root git cwd_repo debug/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head1 SEE ALSO diff --git a/lib/App/Rgit/Config/Default.pm b/lib/App/Rgit/Config/Default.pm index a1bfc77..b9c28c6 100644 --- a/lib/App/Rgit/Config/Default.pm +++ b/lib/App/Rgit/Config/Default.pm @@ -3,9 +3,9 @@ package App::Rgit::Config::Default; use strict; use warnings; -use File::Find qw/find/; +use File::Find qw; -use base qw/App::Rgit::Config/; +use base qw; use App::Rgit::Repository; diff --git a/lib/App/Rgit/Policy/Default.pm b/lib/App/Rgit/Policy/Default.pm index 5c8203b..f1b71fe 100644 --- a/lib/App/Rgit/Policy/Default.pm +++ b/lib/App/Rgit/Policy/Default.pm @@ -3,9 +3,9 @@ package App::Rgit::Policy::Default; use strict; use warnings; -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; -use base qw/App::Rgit::Policy/; +use base qw; =head1 NAME diff --git a/lib/App/Rgit/Policy/Interactive.pm b/lib/App/Rgit/Policy/Interactive.pm index 27e12c9..5b1a63d 100644 --- a/lib/App/Rgit/Policy/Interactive.pm +++ b/lib/App/Rgit/Policy/Interactive.pm @@ -5,9 +5,9 @@ use warnings; use Cwd (); -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; -use base qw/App::Rgit::Policy/; +use base qw; =head1 NAME diff --git a/lib/App/Rgit/Policy/Keep.pm b/lib/App/Rgit/Policy/Keep.pm index 82b6a48..43f125f 100644 --- a/lib/App/Rgit/Policy/Keep.pm +++ b/lib/App/Rgit/Policy/Keep.pm @@ -3,9 +3,9 @@ package App::Rgit::Policy::Keep; use strict; use warnings; -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; -use base qw/App::Rgit::Policy/; +use base qw; =head1 NAME diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index f1dc149..8356f24 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -214,7 +214,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/fake repo bare name work/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head1 SEE ALSO diff --git a/lib/App/Rgit/Utils.pm b/lib/App/Rgit/Utils.pm index ee1fdd3..c858f53 100644 --- a/lib/App/Rgit/Utils.pm +++ b/lib/App/Rgit/Utils.pm @@ -101,13 +101,13 @@ C, C, C and C are only exported on request, either by the =cut -use base qw/Exporter/; +use base qw; our @EXPORT = (); our %EXPORT_TAGS = ( - funcs => [ qw/abs_path/ ], - codes => [ qw/SAVE NEXT REDO LAST/ ], - levels => [ qw/INFO WARN ERR CRIT/ ], + funcs => [ qw ], + codes => [ qw ], + levels => [ qw ], ); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; diff --git a/t/16-levels.t b/t/16-levels.t index 38e126a..240ded6 100644 --- a/t/16-levels.t +++ b/t/16-levels.t @@ -8,7 +8,7 @@ use warnings; use Test::More tests => 4; use App::Rgit::Config; -use App::Rgit::Utils qw/:levels/; +use App::Rgit::Utils qw<:levels>; local $SIG{__WARN__} = sub { diag 'warning:', @_ }; local $SIG{__DIE__} = sub { diag 'exception:', @_ }; @@ -33,7 +33,7 @@ for my $l (0 .. $#levels) { my $buf = ''; close STDERR; open STDERR, '>', \$buf or die "open(STDERR, '>', \\\$buf): $!"; - $arc->$_($_) for qw/info warn err crit/; + $arc->$_($_) for qw; is $buf, join('', @levels[$l .. $#levels]), "level $l ok"; } diff --git a/t/20-each.t b/t/20-each.t index ed1c0c2..a5ac4d3 100644 --- a/t/20-each.t +++ b/t/20-each.t @@ -3,18 +3,18 @@ use strict; use warnings; -use Cwd qw/cwd abs_path/; +use Cwd qw; use File::Spec (); # catdir, catfile -use File::Temp qw/tempfile tempdir/; +use File::Temp qw; use Test::More; -use App::Rgit::Utils qw/:codes/; +use App::Rgit::Utils qw<:codes>; use App::Rgit; use lib 't/lib'; -use App::Rgit::TestUtils qw/can_run_git/; +use App::Rgit::TestUtils qw; use App::Rgit::Policy::Callback; my ($can_run, $reason) = can_run_git; @@ -132,7 +132,7 @@ sub try { git => 't/bin/git', root => $tmpdir, cmd => $cmd, - args => [ abs_path($filename), $cmd, qw/%n %g %w %b %G %W %B %R %%n %x/ ], + args => [ abs_path($filename), $cmd, qw<%n %g %w %b %G %W %B %R %%n %x> ], policy => $policy, ); isa_ok $ar, 'App::Rgit', "each $cmd is an App::Rgit object"; diff --git a/t/21-once.t b/t/21-once.t index 46c6975..51224ab 100644 --- a/t/21-once.t +++ b/t/21-once.t @@ -3,15 +3,15 @@ use strict; use warnings; -use Cwd qw/abs_path/; -use File::Temp qw/tempfile/; +use Cwd qw; +use File::Temp qw; use Test::More; use App::Rgit; use lib 't/lib'; -use App::Rgit::TestUtils qw/can_run_git/; +use App::Rgit::TestUtils qw; my ($can_run, $reason) = can_run_git; if ($can_run) { @@ -21,20 +21,20 @@ if ($can_run) { } my @expected = ( - ([ [ qw/%n %g %w %b %%/ ] ]) x 5 + ([ [ qw<%n %g %w %b %%> ] ]) x 5 ); local $ENV{GIT_DIR} = 't'; local $ENV{GIT_EXEC_PATH} = 't/bin/git'; -for my $cmd (qw/daemon gui help init version/) { +for my $cmd (qw) { my ($fh, $filename) = tempfile(UNLINK => 1); my $ar = App::Rgit->new( git => $ENV{GIT_EXEC_PATH}, root => $ENV{GIT_DIR}, cmd => $cmd, - args => [ abs_path($filename), $cmd, qw/%n %g %w %b %%/ ], + args => [ abs_path($filename), $cmd, qw<%n %g %w %b %%> ], ); isa_ok $ar, 'App::Rgit', "once $cmd is an App::Rgit object"; @@ -45,7 +45,7 @@ for my $cmd (qw/daemon gui help init version/) { is @lines, 1, "once $cmd visited only one repo"; my $r = [ split /\|/, defined $lines[0] ? $lines[0] : '' ]; - my $e = [ $cmd, qw/%n %g %w %b %%/ ]; + my $e = [ $cmd, qw<%n %g %w %b %%> ]; s/[\r\n]*$// for @$r; for (0 .. 5) { is $r->[$_], $e->[$_], "once $cmd argument $_ is ok"; diff --git a/t/lib/App/Rgit/Policy/Callback.pm b/t/lib/App/Rgit/Policy/Callback.pm index 3b6feb9..56c6879 100644 --- a/t/lib/App/Rgit/Policy/Callback.pm +++ b/t/lib/App/Rgit/Policy/Callback.pm @@ -3,7 +3,7 @@ package App::Rgit::Policy::Callback; use strict; use warnings; -use base qw/App::Rgit::Policy/; +use base qw; sub new { my $class = shift; @@ -21,7 +21,7 @@ sub new { } BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/callback/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } sub handle { diff --git a/t/lib/App/Rgit/TestUtils.pm b/t/lib/App/Rgit/TestUtils.pm index 321f964..b736a5d 100644 --- a/t/lib/App/Rgit/TestUtils.pm +++ b/t/lib/App/Rgit/TestUtils.pm @@ -3,10 +3,10 @@ package App::Rgit::TestUtils; use strict; use warnings; -use Cwd qw/abs_path/; -use File::Temp qw/tempfile/; +use Cwd qw; +use File::Temp qw; use File::Spec (); # curdir, catfile -use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG/; +use POSIX qw; BEGIN { no warnings 'redefine'; @@ -16,9 +16,9 @@ BEGIN { *WTERMSIG = sub { shift() & 127 } unless eval { WTERMSIG(0); 1 }; } -use base qw/Exporter/; +use base qw; -our @EXPORT_OK = (qw/can_run_git/); +our @EXPORT_OK = (qw); sub can_run_git { my ($fh, $filename) = tempfile(UNLINK => 1); @@ -32,7 +32,7 @@ TRY: 'version', ); - my $git = File::Spec->catfile(File::Spec->curdir, qw/t bin git/); + my $git = File::Spec->catfile(File::Spec->curdir, qw); if ($^O eq 'MSWin32') { unless (-x $git) { $git .= '.bat';