File Coverage

blib/lib/Duadua/Parser/Bot/Netcraft.pm
Criterion Covered Total %
statement 16 16 100.0
branch 5 6 83.3
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::Netcraft;
2 11     11   892 use strict;
  11         24  
  11         421  
3 11     11   66 use warnings;
  11         18  
  11         621  
4 11     11   68 use Duadua::Util qw//;
  11         20  
  11         2647  
5              
6             sub try {
7 53     53 1 132 my ($class, $d) = @_;
8              
9 53 100       124 if ( $d->_contain(' NetcraftSurveyAgent/') ) {
10 2         13 my $h = {
11             name => 'NetcraftSurveyAgent',
12             is_bot => 1,
13             };
14              
15 2 100       11 if ($d->opt_version) {
16 1         6 my ($version) = ($d->ua =~ m! NetcraftSurveyAgent/([\d.]+)!);
17 1 50       9 $h->{version} = $version if $version;
18             }
19              
20 2         13 return Duadua::Util->set_os($d, $h);
21             }
22             }
23              
24             1;
25              
26             __END__