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   41 use strict;
  6         11  
  6         175  
3 6     6   28 use warnings;
  6         15  
  6         988  
4              
5             sub try {
6 177     177 1 363 my ($class, $d) = @_;
7              
8 177 100       343 if ( index($d->ua, '(Applebot/') > -1 ) {
9 2         20 my $h = {
10             name => 'Applebot',
11             is_bot => 1,
12             };
13              
14 2 100       7 if ($d->opt_version) {
15 1         10 my ($version) = ($d->ua =~ m!Applebot/([\d.]+)!);
16 1 50       7 $h->{version} = $version if $version;
17             }
18              
19 2         8 return $h;
20             }
21             }
22              
23             1;
24              
25             __END__