File Coverage

blib/lib/Mojolicious/Plugin/LinkEmbedder/Link/Text/Metacpan.pm
Criterion Covered Total %
statement 3 9 33.3
branch 0 4 0.0
condition 0 6 0.0
subroutine 1 3 33.3
pod 0 1 0.0
total 4 23 17.3


line stmt bran cond sub pod time code
1             package Mojolicious::Plugin::LinkEmbedder::Link::Text::Metacpan;
2 1     1   3021 use Mojo::Base 'Mojolicious::Plugin::LinkEmbedder::Link::Text::HTML';
  1         3  
  1         5  
3              
4 0     0 0   sub provider_name {'Metacpan'}
5              
6             sub _learn_from_dom {
7 0     0     my ($self, $dom) = @_;
8              
9 0 0 0       if (my $e = $dom->at('.author-pic > a > img') || $dom->at('link[rel="apple-touch-icon"]')) {
10 0   0       my $url = $e->{src} || $e->{href};
11 0 0         $self->image($url =~ /^https?:/ ? $url : "//metacpan.org$url");
12             }
13              
14 0           $self->SUPER::_learn_from_dom($dom);
15             }
16              
17             1;