App-Deps-Verify

 view release on metacpan or  search on metacpan

lib/App/Deps/Verify/App/VerifyDeps/Command/plinst.pm  view on Meta::CPAN

package App::Deps::Verify::App::VerifyDeps::Command::plinst;
$App::Deps::Verify::App::VerifyDeps::Command::plinst::VERSION = '0.12.2';
use App::Deps::Verify::App::VerifyDeps -command;

use strict;
use warnings;

use Path::Tiny        qw/ path /;
use App::Deps::Verify ();

sub abstract { "install perl5 dependencies from CPAN" }

sub description { return abstract(); }

sub opt_spec
{
    return (
        [ "input|i=s\@", "the input files" ],
        [ "notest",      "speed up installation by skipping the tests" ],
    );
}

sub validate_args
{
    my ( $self, $opt, $args ) = @_;

    # no args allowed but options!
    $self->usage_error("No args allowed") if @$args;
}

sub execute
{
    my ( $self, $opt, $args ) = @_;

    exit(
        system(
            "cpanm",
            ( $opt->{notest} ? ('--notest') : () ),
            "--",
            grep { /\A[A-Za-z0-9_:]+\z/ }
                @{ App::Deps::Verify->new->list_perl5_modules_in_yamls(
                    +{ filenames => [ @{ $opt->{input} }, ] }
                )->{perl5_modules}
                }
        )
    );

    return;
}

1;

__END__

=pod

=encoding UTF-8

=head1 VERSION

version 0.12.2

=for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan

=head1 SUPPORT

=head2 Websites

The following websites have more information about this module, and may be of help to you. As always,
in addition to those websites please use your favorite search engine to discover more resources.

=over 4

=item *

MetaCPAN

A modern, open-source CPAN search engine, useful to view POD in HTML format.

L<https://metacpan.org/release/App-Deps-Verify>

=item *



( run in 1.022 second using v1.01-cache-2.11-cpan-140bd7fdf52 )