Badge-Depot-Plugin-Travis
view release on metacpan or search on metacpan
lib/Badge/Depot/Plugin/Travis.pm view on Meta::CPAN
return {
username => $1,
repo => $2,
};
}
sub BUILD {
my $self = shift;
$self->link_url(sprintf 'https://travis-ci.org/%s/%s', $self->user, $self->repo);
$self->image_url(sprintf 'https://api.travis-ci.org/%s/%s.svg?branch=%s', $self->user, $self->repo, $self->branch);
$self->image_alt('Travis status');
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Badge::Depot::Plugin::Travis - Travis plugin for Badge::Depot
=begin html
<p>
<img src="https://img.shields.io/badge/perl-5.10+-blue.svg" alt="Requires Perl 5.10+" />
<a href="https://travis-ci.org/Csson/p5-Badge-Depot-Plugin-Travis"><img src="https://api.travis-ci.org/Csson/p5-Badge-Depot-Plugin-Travis.svg?branch=master" alt="Travis status" /></a>
<a href="http://cpants.cpanauthors.org/dist/Badge-Depot-Plugin-Travis-0.0203"><img src="https://badgedepot.code301.com/badge/kwalitee/Badge-Depot-Plugin-Travis/0.0203" alt="Distribution kwalitee" /></a>
<a href="http://matrix.cpantesters.org/?dist=Badge-Depot-Plugin-Travis%200.0203"><img src="https://badgedepot.code301.com/badge/cpantesters/Badge-Depot-Plugin-Travis/0.0203" alt="CPAN Testers result" /></a>
<img src="https://img.shields.io/badge/coverage-67.3%-red.svg" alt="coverage 67.3%" />
</p>
=end html
=head1 VERSION
Version 0.0203, released 2016-04-09.
=head1 SYNOPSIS
use Badge::Depot::Plugin::Travis;
my $badge = Badge::Depot::Plugin::Travis->new(user => 'my_name', repo => 'the_repo', branch => 'master');
print $badge->to_html;
# prints '<a href="https://travis-ci.org/my_name/my_repo"><img src="https://api.travis-ci.org/my_name/my_repo.svg?branch=master" /></a>'
=head1 DESCRIPTION
Create a L<Travis|https://travis-ci.org> badge for a github repository.
This class consumes the L<Badge::Depot> role.
=head1 ATTRIBUTES
The C<user> and C<repo> attributes are required or optional, depending on your configuration. It looks for the C<resources/repository/web> setting in C<META.json>:
=over 4
=item *
If C<META.json> doesn't exist in the dist root, C<user> and C<repo> are required.
=item *
If C<resources/repository/web> doesn't exist (or is not a github url), C<user> and C<repo> are required.
=back
=head2 user
Github username.
=head2 repo
Github repository.
=head2 branch
Github branch. Optional, C<master> by default.
=head1 SEE ALSO
=over 4
=item *
L<Badge::Depot>
=back
=head1 SOURCE
L<https://github.com/Csson/p5-Badge-Depot-Plugin-Travis>
=head1 HOMEPAGE
L<https://metacpan.org/release/Badge-Depot-Plugin-Travis>
=head1 AUTHOR
Erik Carlsson <info@code301.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 0.410 second using v1.01-cache-2.11-cpan-5e09290becf )