Permalink
Browse files

replace circumfix deref with postfix

  • Loading branch information...
1 parent 08dc1f9 commit f48dcea1c2182b50933cfc5d3b27c829215543c9 @rjbs committed Jul 16, 2013
View
@@ -419,11 +419,11 @@ has files => (
sub prune_file {
my ($self, $file) = @_;
- my @files = @{ $self->files };
+ my @files = $self->files->@*;
for my $i (0 .. $#files) {
next unless $file == $files[ $i ];
- splice @{ $self->files }, $i, 1;
+ splice $self->files->@*, $i, 1;
return;
}
@@ -607,7 +607,7 @@ sub _check_dupe_files {
for my $name (@dupes) {
$self->log("attempt to add $name multiple times; added by: "
- . join('; ', map { $_->added_by } @{ $files_named{ $name } })
+ . join('; ', map { $_->added_by } $files_named{ $name }->@*)
);
}
View
@@ -14,7 +14,7 @@ sub global_opt_spec {
return (
[ "verbose|v:s@", "log additional output" ],
[ "lib-inc|I=s@", "additional \@INC dirs", {
- callbacks => { 'always fine' => sub { unshift @INC, @{$_[0]}; } }
+ callbacks => { 'always fine' => sub { unshift @INC, $_[0]->@*; } }
} ]
);
}
@@ -87,7 +87,7 @@ sub chrome {
$self->{__chrome__} = Dist::Zilla::Chrome::Term->new;
my @v_plugins = $self->global_options->verbose
- ? grep { length } @{ $self->global_options->verbose }
+ ? grep { length } $self->global_options->verbose->@*
: ();
my $verbose = $self->global_options->verbose && ! @v_plugins;
@@ -104,7 +104,7 @@ sub zilla {
return $self->{'' . __PACKAGE__}{zilla} ||= do {
my @v_plugins = $self->global_options->verbose
- ? grep { length } @{ $self->global_options->verbose }
+ ? grep { length } $self->global_options->verbose->@*
: ();
my $verbose = $self->global_options->verbose && ! @v_plugins;
@@ -66,7 +66,7 @@ sub execute {
for my $name ( @$arg ) {
my $factory = $minter->plugin_named(':DefaultModuleMaker');
$factory->make_module({ name => $name });
- for my $file ( @{ $factory->zilla->files} ) {
+ for my $file ($factory->zilla->files->@*) {
$zilla->_write_out_file($file, $root);
}
}
@@ -56,11 +56,11 @@ sub opt_spec {
sub prereqs {
my ($self, $zilla) = @_;
- $_->before_build for @{ $zilla->plugins_with(-BeforeBuild) };
- $_->gather_files for @{ $zilla->plugins_with(-FileGatherer) };
- $_->prune_files for @{ $zilla->plugins_with(-FilePruner) };
- $_->munge_files for @{ $zilla->plugins_with(-FileMunger) };
- $_->register_prereqs for @{ $zilla->plugins_with(-PrereqSource) };
+ $_->before_build for $zilla->plugins_with(-BeforeBuild)->@*;
+ $_->gather_files for $zilla->plugins_with(-FileGatherer)->@*;
+ $_->prune_files for $zilla->plugins_with(-FilePruner)->@*;
+ $_->munge_files for $zilla->plugins_with(-FileMunger)->@*;
+ $_->register_prereqs for $zilla->plugins_with(-PrereqSource)->@*;
my $prereqs = $zilla->prereqs;
}
@@ -71,7 +71,7 @@ sub test_dzil {
sub log_messages {
my ($self) = @_;
- [ map {; $_->{message} } @{ $self->app->zilla->logger->logger->events } ];
+ [ map {; $_->{message} } $self->app->zilla->logger->logger->events->@* ];
}
}
@@ -107,7 +107,7 @@ sub _setup_default_plugins {
style => 'list',
code => sub {
my $plugins = $_[0]->zilla->plugins_with(-ExecFiles);
- my @files = map {; @{ $_->find_files } } @$plugins;
+ my @files = map {; $_->find_files->@* } @$plugins;
return \@files;
},
@@ -632,7 +632,7 @@ sub install {
## no critic Punctuation
my $wd = File::pushd::pushd($target);
my @cmd = $arg->{install_command}
- ? @{ $arg->{install_command} }
+ ? $arg->{install_command}->@*
: ($^X => '-MCPAN' =>
$^O eq 'MSWin32' ? q{-e"install '.'"} : '-einstall "."');
@@ -87,7 +87,7 @@ sub gather_files {
my $content = '';
$content .= sprintf "name = %s\n", $zilla->name;
- $content .= sprintf "author = %s\n", $_ for @{ $zilla->authors };
+ $content .= sprintf "author = %s\n", $_ for $zilla->authors->@*;
$content .= sprintf "license = %s\n", $license;
$content .= sprintf "copyright_holder = %s\n", $zilla->copyright_holder;
$content .= sprintf "copyright_year = %s\n", (localtime)[5] + 1900;
@@ -110,11 +110,11 @@ sub find_files {
my $self = shift;
my $skip = _join_re($self->skips);
- my $dir = _join_re([ map { qr!^\Q$_/! } @{ $self->dirs } ]);
+ my $dir = _join_re([ map { qr!^\Q$_/! } $self->dirs->@* ]);
my $match = _join_re([
(map { my $re = glob_to_regex_string($_); qr!(?:\A|/)$re\z! }
- @{ $self->files }),
- @{ $self->matches }
+ $self->files->@*),
+ $self->matches->@*
]);
my $files = $self->zilla->files;
@@ -63,7 +63,7 @@ sub find_files {
my $files = $self->found_files;
- foreach my $re (@{ $self->skips }) {
+ foreach my $re ($self->skips->@*) {
@$files = grep { $_->name !~ $re } @$files;
}
@@ -38,7 +38,7 @@ sub metadata {
version => $],
};
- for my $plugin (@{ $self->zilla->plugins }) {
+ for my $plugin ($self->zilla->plugins->@*) {
my $config = $plugin->dump_config;
push @plugins, {
@@ -46,7 +46,7 @@ sub mvp_aliases {
my %alias_for;
for my $key (keys %ATTR_ALIAS) {
- $alias_for{ $_ } = $key for @{ $ATTR_ALIAS{$key} };
+ $alias_for{ $_ } = $key for $ATTR_ALIAS{$key}->@*;
}
return \%alias_for;
@@ -96,7 +96,7 @@ sub section_header {
sub munge_files {
my ($self) = @_;
- my ($file) = grep { $_->name eq $self->filename } @{ $self->zilla->files };
+ my ($file) = grep { $_->name eq $self->filename } $self->zilla->files->@*;
return unless $file;
my $content = $self->fill_in_string(
@@ -34,7 +34,7 @@ typically used when doing monkey patching or other tricky things.
sub munge_files {
my ($self) = @_;
- $self->munge_file($_) for @{ $self->found_files };
+ $self->munge_file($_) for $self->found_files->@*;
}
sub munge_file {
@@ -47,7 +47,7 @@ typically used when doing monkey patching or other tricky things.
sub munge_files {
my ($self) = @_;
- $self->munge_file($_) for @{ $self->found_files };
+ $self->munge_file($_) for $self->found_files->@*;
}
sub munge_file {
@@ -22,7 +22,7 @@ will not be added.
sub munge_files {
my ($self) = @_;
- $self->munge_file($_) for @{ $self->found_files };
+ $self->munge_file($_) for $self->found_files->@*;
}
sub munge_file {
@@ -102,7 +102,7 @@ parameter method => (
role {
my ($p) = @_;
- my ($finder_arg, @finder_arg_aliases) = @{ $p->finder_arg_names };
+ my ($finder_arg, @finder_arg_aliases) = $p->finder_arg_names->@*;
confess "no finder arg names given!" unless $finder_arg;
around mvp_multivalue_args => sub {
@@ -131,14 +131,14 @@ role {
has $finder_arg => (
is => 'ro',
isa => 'ArrayRef[Str]',
- default => sub { [ @{ $p->default_finders } ] },
+ default => sub { [ $p->default_finders->@* ] },
);
method $p->method => sub {
my ($self) = @_;
my @filesets = map {; $self->zilla->find_files($_) }
- @{ $self->$finder_arg };
+ $self->$finder_arg->@*;
my %by_name = map {; $_->name, $_ } map { @$_ } @filesets;
View
@@ -54,7 +54,7 @@ sub minter { 'Dist::Zilla::Tester::_Minter' }
sub log_messages {
my ($self) = @_;
- [ map {; $_->{message} } @{ $self->chrome->logger->events } ];
+ [ map {; $_->{message} } $self->chrome->logger->events->@* ];
}
sub slurp_file {
@@ -108,7 +108,7 @@ sub minter { 'Dist::Zilla::Tester::_Minter' }
dircopy($source, $root);
if ($tester_arg->{also_copy}) {
- while (my ($src, $dest) = each %{ $tester_arg->{also_copy} }) {
+ while (my ($src, $dest) = each $tester_arg->{also_copy}->%* ) {
dircopy($src, $tempdir->subdir($dest));
}
}
@@ -12,8 +12,8 @@ sub format_author_deps {
my ($reqs, $versions) = @_;
my $formatted = '';
- foreach my $rec (@{ $reqs }) {
- my ($mod, $ver) = each(%{ $rec });
+ foreach my $rec ($reqs->@*) {
+ my ($mod, $ver) = each $rec->%*;
$formatted .= $versions ? "$mod = $ver\n" : "$mod\n";
}
chomp($formatted);
@@ -82,7 +82,7 @@ sub extract_author_deps {
my $vermap = $reqs->as_string_hash;
# Add the other requirements
- push(@packages, sort keys %{ $vermap });
+ push @packages, sort keys $vermap->%*;
# Move inc:: first in list as they may impact the loading of other
# plugins (in particular local ones).
View
@@ -115,7 +115,7 @@ sub _build_ini_builder {
for my $key (keys %$core_config) {
my @values = ref $core_config->{ $key }
- ? @{ $core_config->{ $key } }
+ ? $core_config->{ $key }->@*
: $core_config->{ $key };
$config .= "$key = $_\n" for grep {defined} @values;
@@ -137,7 +137,7 @@ sub _build_ini_builder {
for my $key (keys %$payload) {
my @values = ref $payload->{ $key }
- ? @{ $payload->{ $key } }
+ ? $payload->{ $key }->@*
: $payload->{ $key };
$config .= "$key = $_\n" for grep {defined} @values;
@@ -20,7 +20,7 @@ sub new_tzil {
}
sub release_happened {
- scalar grep({/Fake release happening/i} @{ shift->log_messages }),;
+ scalar grep {; /Fake release happening/i } (shift)->log_messages->@*;
}
my $release_aborted = qr/aborting release/i;
View
@@ -33,7 +33,7 @@ use YAML::Tiny;
$tzil->build;
- my @files = map {; $_->name } @{ $tzil->files };
+ my @files = map {; $_->name } $tzil->files->@*;
my %meta;
@@ -104,7 +104,7 @@ use YAML::Tiny;
$tzil->build;
- my @files = map {; $_->name } @{ $tzil->files };
+ my @files = map {; $_->name } $tzil->files->@*;
my %meta;
View
@@ -38,7 +38,7 @@ my $tzil = Builder->from_config(
$tzil->build;
-my @files = map {; $_->name } @{ $tzil->files };
+my @files = map {; $_->name } $tzil->files->@*;
is_deeply(
[ sort @files ],
View
@@ -20,7 +20,7 @@ use Test::Fatal qw(exception);
$tzil->release;
ok(
- grep({ /fake release happen/i } @{ $tzil->log_messages }),
+ grep({ /fake release happen/i } $tzil->log_messages->@*),
"we log a fake release when we fake release",
);
}
@@ -43,7 +43,7 @@ use Test::Fatal qw(exception);
$tzil->release;
ok(
- grep({ /fake release happen/i } @{ $tzil->log_messages }),
+ grep({ /fake release happen/i } $tzil->log_messages->@* ),
"we log a fake release when we fake release",
);
}
View
@@ -73,7 +73,7 @@ sub make_tzil {
);
# Don't bother building anything, we just need a list of filenames:
- @{ $tzil->files } = @dist_files;
+ $tzil->files->@* = @dist_files;
}
#---------------------------------------------------------------------
View
@@ -32,7 +32,7 @@ my $tzil = Builder->from_config(
$tzil->build;
-my @files = map {; $_->name } @{ $tzil->files };
+my @files = map {; $_->name } $tzil->files->@*;
is_filelist(
[ @files ],
View
@@ -43,7 +43,7 @@ my $tzil = Builder->from_config(
$tzil->build;
-my @files = map {; $_->name } @{ $tzil->files };
+my @files = map {; $_->name } $tzil->files->@*;
is_filelist(
[ @files ],
View
@@ -60,7 +60,7 @@ END_CHANGES
);
ok(
- grep({ /fake release happen/i } @{ $tzil->log_messages }),
+ (grep {; /fake release happen/i } $tzil->log_messages->@*),
"we log a fake release when we fake release",
);
View
@@ -123,7 +123,7 @@ unlike(
ok(
grep({ m(skipping lib/DZT/WVer\.pm: assigns to \$DIST) }
- @{ $tzil->log_messages }),
+ $tzil->log_messages->@*),
"we report the reason for no updateing WVer",
);
@@ -139,7 +139,7 @@ unlike(
);
ok(
- grep({ m(skipping .+ DZT::TP2) } @{ $tzil->log_messages }),
+ grep({ m(skipping .+ DZT::TP2) } $tzil->log_messages->@*),
"we report the reason for not updating Monkey",
);
View
@@ -162,7 +162,7 @@ unlike(
ok(
grep({ m(skipping lib/DZT/WVer\.pm: assigns to \$VERSION) }
- @{ $tzil->log_messages }),
+ $tzil->log_messages->@*),
"we report the reason for no updateing WVer",
);
@@ -178,7 +178,7 @@ unlike(
);
ok(
- grep({ m(skipping .+ DZT::TP2) } @{ $tzil->log_messages }),
+ grep({ m(skipping .+ DZT::TP2) } $tzil->log_messages->@*),
"we report the reason for not updating Monkey",
);
Oops, something went wrong.

0 comments on commit f48dcea

Please sign in to comment.