| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #!/usr/bin/perl | 
| 2 |  |  |  |  |  |  | package WWW::StatusBadge; | 
| 3 |  |  |  |  |  |  | $WWW::StatusBadge::VERSION = '0.0.1'; | 
| 4 | 134 |  |  | 134 |  | 1222478 | use strict; | 
|  | 134 |  |  |  |  | 353 |  | 
|  | 134 |  |  |  |  | 5428 |  | 
| 5 | 134 |  |  | 134 |  | 678 | use warnings; | 
|  | 134 |  |  |  |  | 203 |  | 
|  | 134 |  |  |  |  | 4149 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 134 |  |  | 134 |  | 579 | use Carp (); | 
|  | 134 |  |  |  |  | 185 |  | 
|  | 134 |  |  |  |  | 1598 |  | 
| 8 | 134 |  |  | 134 |  | 101926 | use Hash::Util::FieldHash (); | 
|  | 134 |  |  |  |  | 121590 |  | 
|  | 134 |  |  |  |  | 3367 |  | 
| 9 | 134 |  |  | 134 |  | 56316 | 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__ |