App-cpanminus-reporter
view release on metacpan or search on metacpan
lib/App/cpanminus/reporter.pm view on Meta::CPAN
package App::cpanminus::reporter;
use warnings;
use strict;
our $VERSION = '0.22';
use Carp ();
use File::Spec 3.19;
use Test::Reporter 1.54;
use CPAN::Testers::Common::Client 0.13;
use CPAN::Testers::Common::Client::Config;
use Parse::CPAN::Meta;
use CPAN::Meta::Converter;
use Try::Tiny;
use URI;
use Metabase::Resource;
use Capture::Tiny qw(capture);
use IO::Prompt::Tiny ();
sub new {
my ($class, %params) = @_;
my $self = bless {}, $class;
$self->config(
CPAN::Testers::Common::Client::Config->new(
prompt => sub { local %ENV; IO::Prompt::Tiny::prompt(@_) },
)
);
if ($params{cpanm}) {
my $cpanm = $self->_cpanm( $params{cpanm} );
$params{only} =~ s/-\d+(\.\d+)*$//; # strip version from cpanm's "only" data
# FIXME: cpanm doesn't provide an accessor here, so
# we break encapsulation in order to make sure we
# always have the right paths.
$params{build_dir} = $cpanm->{home};
$params{build_logfile} = $cpanm->{log};
}
$self->build_dir(
$params{build_dir}
|| File::Spec->catdir( _home(), '.cpanm' )
);
$self->build_logfile(
$params{build_logfile}
|| File::Spec->catfile( $self->build_dir, 'build.log' )
);
$self->max_age($params{max_age} || 30);
foreach my $option ( qw(quiet verbose force exclude only dry-run skip-history ignore-versions all) ) {
my $method = $option;
$method =~ s/\-/_/g;
$self->$method( $params{$option} ) if exists $params{$option};
}
return $self;
}
sub setup { shift->config->setup }
## basic accessors ##
sub author {
my ($self, $author) = @_;
$self->{_author} = $author if $author;
return $self->{_author};
}
sub distfile {
my ($self, $distfile) = @_;
$self->{_distfile} = $distfile if $distfile;
( run in 1.443 second using v1.01-cache-2.11-cpan-0b5f733616e )