line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
package WWW::StatusBadge; |
3
|
|
|
|
|
|
|
$WWW::StatusBadge::VERSION = '0.0.2'; |
4
|
134
|
|
|
134
|
|
1459678
|
use strict; |
|
134
|
|
|
|
|
318
|
|
|
134
|
|
|
|
|
6227
|
|
5
|
134
|
|
|
134
|
|
681
|
use warnings; |
|
134
|
|
|
|
|
227
|
|
|
134
|
|
|
|
|
4418
|
|
6
|
|
|
|
|
|
|
|
7
|
134
|
|
|
134
|
|
619
|
use Carp (); |
|
134
|
|
|
|
|
212
|
|
|
134
|
|
|
|
|
1784
|
|
8
|
134
|
|
|
134
|
|
100309
|
use Hash::Util::FieldHash (); |
|
134
|
|
|
|
|
132476
|
|
|
134
|
|
|
|
|
3820
|
|
9
|
134
|
|
|
134
|
|
59545
|
use Module::Pluggable::Object (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Hash::Util::FieldHash::fieldhash my %Arg; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
|
|
|
|
|
|
my $class = shift; |
15
|
|
|
|
|
|
|
my %arg = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $self = do { |
18
|
|
|
|
|
|
|
my $o; bless \( $o ), ref $class || $class || __PACKAGE__ |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$Arg{ $self } = { %arg }; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub args { return %{ $Arg{ shift() } }; } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $package = __PACKAGE__; |
29
|
|
|
|
|
|
|
my $finder = Module::Pluggable::Object->new( |
30
|
|
|
|
|
|
|
'package' => $package, 'require' => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
no strict 'refs'; |
35
|
|
|
|
|
|
|
for my $plugin ( $finder->plugins ) { |
36
|
|
|
|
|
|
|
my $service = $plugin->can('service') |
37
|
|
|
|
|
|
|
|| next; |
38
|
|
|
|
|
|
|
my $method = join( '_', ( split '::', lc $plugin )[3,] ); |
39
|
|
|
|
|
|
|
*{ sprintf '%s::%s', $package, $method } = $service; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
# ABSTRACT: Plugin based Status Badge generator |
45
|
|
|
|
|
|
|
# vim:ts=4:sw=4:syn=perl |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |