Badge-Depot-Plugin-Cpantesters
view release on metacpan or search on metacpan
lib/Badge/Depot/Plugin/Cpantesters.pm view on Meta::CPAN
use 5.10.0;
use strict;
use warnings;
package Badge::Depot::Plugin::Cpantesters;
# ABSTRACT: CPAN testers plugin for Badge::Depot
our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
our $VERSION = '0.0102';
use Moose;
use namespace::autoclean;
use MooseX::AttributeShortcuts;
use Types::Standard qw/Str HashRef/;
use Types::URI qw/Uri/;
use JSON::MaybeXS 'decode_json';
use Path::Tiny;
with 'Badge::Depot';
has dist => (
is => 'ro',
isa => Str,
lazy => 1,
default => sub {
my $self = shift;
if($self->get_meta('dist')) {
return $self->_meta->{'dist'};
}
},
);
has version => (
is => 'ro',
isa => Str,
lazy => 1,
default => sub {
my $self = shift;
if($self->get_meta('version')) {
return $self->_meta->{'version'};
}
},
);
has base_url => (
is => 'ro',
isa => Uri,
coerce => 1,
lazy => 1,
default => 'http://badgedepot.code301.com',
);
has custom_image_url => (
is => 'ro',
isa => Uri,
coerce => 1,
lazy => 1,
builder => 1,
);
sub _build_custom_image_url {
my $self = shift;
return sprintf '%s/badge/cpantesters/%s/%s', $self->base_url, $self->dist, $self->version;
}
has _meta => (
is => 'ro',
isa => HashRef,
traits => ['Hash'],
lazy => 1,
predicate => 'has_meta',
builder => '_build_meta',
handles => {
get_meta => 'get',
},
);
( run in 0.653 second using v1.01-cache-2.11-cpan-9581c071862 )