Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
168 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ use App::Cmd::Setup 0.307 -app; | |
sub default_command { 'dist' } | ||
|
||
qq[Meep]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,44 @@ | ||
package Dist::Zooky::App::Command::dist; | ||
|
||
# ABSTRACT: The one command that Dist::Zooky uses | ||
|
||
use strict; | ||
use warnings; | ||
use Dist::Zooky::App -command; | ||
|
||
sub abstract { 'Dist::Zooky!' } | ||
|
||
sub opt_spec { | ||
return ( | ||
[ 'make=s', 'Specify make utility to use', ], | ||
); | ||
} | ||
|
||
sub execute { | ||
my ($self, $opt, $args) = @_; | ||
require Dist::Zooky; | ||
my $zooky = Dist::Zooky->new(); | ||
my $zooky = Dist::Zooky->new( ( defined $opt->{make} ? ( make => $opt->{make} ) : () ) ); | ||
$zooky->examine; | ||
return; | ||
} | ||
|
||
qq[Lighten up and play]; | ||
|
||
=pod | ||
=head1 DESCRIPTION | ||
Dist::Zooky has but one command, this is it. And it is the default so | ||
you should never need to specify it. | ||
=head1 METHOD | ||
=over | ||
=item C<execute> | ||
This runs L<Dist::Zooky> for you. | ||
=back | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package Dist::Zooky::Core::ModBuild; | ||
|
||
use strict; | ||
use warnings; | ||
use Moose; | ||
use IPC::Cmd qw[run can_run]; | ||
|
||
with 'Dist::Zooky::Role::Core'; | ||
with 'Dist::Zooky::Role::Meta'; | ||
|
||
sub examine { | ||
my $self = shift; | ||
|
||
{ | ||
local $ENV{PERL_MM_USE_DEFAULT} = 1; | ||
|
||
my $cmd = [ $^X, 'Build.PL' ]; | ||
run ( command => $cmd, verbose => 0 ); | ||
} | ||
|
||
if ( -e 'MYMETA.yml' ) { | ||
|
||
my $struct = $self->meta_from_file( 'MYMETA.yml' ); | ||
$self->_set_name( $struct->{name} ); | ||
$self->_set_author( $struct->{author} ); | ||
$self->_set_license( $struct->{license} ); | ||
$self->_set_version( $struct->{version} ); | ||
$self->_set_prereqs( $struct->{prereqs} ); | ||
|
||
} | ||
else { | ||
|
||
die "Couldn\'t find a 'MYMETA.yml' file, giving up\n"; | ||
|
||
} | ||
|
||
{ | ||
my $cmd = [ $^X, 'Build', 'distclean' ]; | ||
run( command => $cmd, verbose => 0 ); | ||
} | ||
|
||
return; | ||
} | ||
|
||
sub return_meta { | ||
my $self = shift; | ||
return { map { ( $_, $self->$_ ) } qw(author name version license Prereq) }; | ||
} | ||
|
||
__PACKAGE__->meta->make_immutable; | ||
no Moose; | ||
|
||
qq[MakeMaker]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters