line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
15209
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Badge::Depot::Plugin::Gratipay; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
490
|
use Moose; |
|
1
|
|
|
|
|
348732
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
6117
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1146
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
549
|
use Types::Standard qw/Str/; |
|
1
|
|
|
|
|
48212
|
|
|
1
|
|
|
|
|
10
|
|
9
|
1
|
|
|
1
|
|
1056
|
use Types::URI qw/Uri/; |
|
1
|
|
|
|
|
104851
|
|
|
1
|
|
|
|
|
12
|
|
10
|
|
|
|
|
|
|
with 'Badge::Depot'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.0101'; # VERSION |
13
|
|
|
|
|
|
|
# ABSTRACT: Gratipay plugin for Badge::Depot |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has user => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => Str, |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
has custom_image_url => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => Uri, |
23
|
|
|
|
|
|
|
coerce => 1, |
24
|
|
|
|
|
|
|
default => 'https://img.shields.io/gratipay/%s.svg', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub BUILD { |
29
|
2
|
|
|
2
|
0
|
7301
|
my $self = shift; |
30
|
2
|
|
|
|
|
76
|
$self->link_url(sprintf 'https://gratipay.com/%s', $self->user); |
31
|
2
|
|
|
|
|
242
|
$self->image_url(sprintf $self->custom_image_url, $self->user); |
32
|
2
|
|
|
|
|
275
|
$self->image_alt('Gratipay'); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Badge::Depot::Plugin::Gratipay - Gratipay plugin for Badge::Depot |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Version 0.0101, released 2015-03-05. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
use Badge::Depot::Plugin::Gratipay; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $badge = Badge::Depot::Plugin::Gratipay->new(user => 'my_name'); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
print $badge->to_html; |
58
|
|
|
|
|
|
|
# prints '<a href="https://gratipay.com/my_name"><img src="https://img.shields.io/my_name.svg" /></a>' |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Create a L<Gratipay|https://gratipay.com> badge for a Gratipay user. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This class consumes the L<Badge::Depot> role. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 user |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
The Gratipay user name. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 custom_image_url |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
By default, this module shows an image from L<shields.io|https://shields.io>. Use this attribute to override that with a custom url. Use a C<%s> placeholder where the user name should be inserted. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SEE ALSO |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 4 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
L<Badge::Depot> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=back |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SOURCE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-Badge-Depot-Plugin-Gratipay> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 HOMEPAGE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L<https://metacpan.org/release/Badge-Depot-Plugin-Gratipay> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Erik Carlsson <info@code301.com>. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
103
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |