diff --git a/lib/Dist/Zilla/Plugin/FFI.pm b/lib/Dist/Zilla/Plugin/FFI.pm index 5750bc3..192c8e1 100644 --- a/lib/Dist/Zilla/Plugin/FFI.pm +++ b/lib/Dist/Zilla/Plugin/FFI.pm @@ -1,8 +1,9 @@ -package Dist::Zilla::Plugin::FFI { +use strict; +use warnings; +use 5.020; +use true; - use strict; - use warnings; - use 5.020; +package Dist::Zilla::Plugin::FFI { # ABSTRACT: FFI related Dist::Zilla plugins @@ -31,6 +32,4 @@ Add L checks into your C. =cut -} - -1; +} \ No newline at end of file diff --git a/lib/Dist/Zilla/Plugin/FFI/Build.pm b/lib/Dist/Zilla/Plugin/FFI/Build.pm index 3e71b0a..842251e 100644 --- a/lib/Dist/Zilla/Plugin/FFI/Build.pm +++ b/lib/Dist/Zilla/Plugin/FFI/Build.pm @@ -1,7 +1,10 @@ +use 5.020; +use true; + package Dist::Zilla::Plugin::FFI::Build { - use 5.020; use Moose; + use experimental qw( signatures ); use List::Util qw( first ); # ABSTRACT: Add FFI::Build to your Makefile.PL @@ -125,9 +128,8 @@ EOF2 isa => 'Maybe[Str]', ); - sub munge_files + sub munge_files ($self) { - my($self) = @_; my $file = first { $_->name eq 'Makefile.PL' } @{ $self->zilla->files }; $self->log_fatal("unable to find Makefile.PL") unless $file; @@ -139,8 +141,7 @@ EOF2 $file->content($content); } - sub register_prereqs { - my ($self) = @_; + sub register_prereqs ($self) { $self->zilla->register_prereqs( +{ phase => 'configure', type => 'requires', @@ -170,17 +171,14 @@ EOF2 } - sub metadata + sub metadata ($self) { - my($self) = @_; my %meta = ( dynamic_config => 1 ); \%meta; } - sub prune_files + sub prune_files ($self) { - my($self) = @_; - my $lang = $self->lang; foreach my $file ((), @{ $self->zilla->files }) @@ -203,6 +201,4 @@ EOF2 } __PACKAGE__->meta->make_immutable; -} - -1; +} \ No newline at end of file diff --git a/lib/Dist/Zilla/Plugin/FFI/CheckLib.pm b/lib/Dist/Zilla/Plugin/FFI/CheckLib.pm index 7b71951..639dd6c 100644 --- a/lib/Dist/Zilla/Plugin/FFI/CheckLib.pm +++ b/lib/Dist/Zilla/Plugin/FFI/CheckLib.pm @@ -1,12 +1,13 @@ -package Dist::Zilla::Plugin::FFI::CheckLib { +use 5.020; +use true; - use strict; - use warnings; - use 5.020; +package Dist::Zilla::Plugin::FFI::CheckLib { # ABSTRACT: FFI::CheckLib alternative to Dist::Zilla::Plugin::CheckLib use Moose; + use experimental qw( signatures ); + with 'Dist::Zilla::Role::FileMunger', 'Dist::Zilla::Role::InstallTool', @@ -52,8 +53,7 @@ package Dist::Zilla::Plugin::FFI::CheckLib { $config }; - sub register_prereqs { - my ($self) = @_; + sub register_prereqs ($self) { $self->zilla->register_prereqs( +{ phase => 'configure', type => 'requires', @@ -63,9 +63,7 @@ package Dist::Zilla::Plugin::FFI::CheckLib { } my %files; - sub munge_files { - my ($self) = @_; - + sub munge_files ($self) { my @mfpl = grep {; $_->name eq 'Makefile.PL' or $_->name eq 'Build.PL' } @{ $self->zilla->files }; @@ -79,9 +77,7 @@ package Dist::Zilla::Plugin::FFI::CheckLib { () } - sub setup_installer { - my ($self) = @_; - + sub setup_installer ($self) { my @mfpl = grep {; $_->name eq 'Makefile.PL' or $_->name eq 'Build.PL' } @{ $self->zilla->files }; @@ -103,9 +99,7 @@ package Dist::Zilla::Plugin::FFI::CheckLib { () } - sub _munge_file { - my ($self, $file) = @_; - + sub _munge_file ($self, $file) { my $orig_content = $file->content; $self->log_fatal('could not find position in ' . $file->name . ' to modify!') unless $orig_content =~ m/use strict;\nuse warnings;\n\n/g; diff --git a/t/00_diag.t b/t/00_diag.t index ace4889..dc6a579 100644 --- a/t/00_diag.t +++ b/t/00_diag.t @@ -23,7 +23,9 @@ $modules{$_} = $_ for qw( Path::Tiny Test2::V0 Test::DZil + experimental namespace::autoclean + true );