File Coverage

blib/lib/Duadua/Parser/Bot/Applebot.pm
Criterion Covered Total %
statement 13 13 100.0
branch 5 6 83.3
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::Applebot;
2 6     6   750 use strict;
  6         15  
  6         151  
3 6     6   28 use warnings;
  6         12  
  6         886  
4              
5             sub try {
6 177     177 1 371 my ($class, $d) = @_;
7              
8 177 100       444 if ( index($d->ua, '(Applebot/') > -1 ) {
9 2         21 my $h = {
10             name => 'Applebot',
11             is_bot => 1,
12             };
13              
14 2 100       8 if ($d->opt_version) {
15 1         4 my ($version) = ($d->ua =~ m!Applebot/([\d.]+)!);
16 1 50       5 $h->{version} = $version if $version;
17             }
18              
19 2         9 return $h;
20             }
21             }
22              
23             1;
24              
25             __END__