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