File Coverage

blib/lib/Duadua/Parser/Bot/ClaudeBot.pm
Criterion Covered Total %
statement 13 13 100.0
branch 4 6 66.6
condition 4 6 66.6
subroutine 3 3 100.0
pod 1 1 100.0
total 25 29 86.2


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::ClaudeBot;
2 11     11   86 use strict;
  11         139  
  11         430  
3 11     11   53 use warnings;
  11         17  
  11         2735  
4              
5             sub try {
6 36     36 1 99 my ($class, $d) = @_;
7              
8 36 50 66     100 if ( $d->_contain('ClaudeBot/')
      66        
9             && $d->_contain('+claudebot@anthropic.com')
10             && $d->_contain_mozilla ) {
11 2         10 my $h = {
12             name => 'ClaudeBot',
13             is_bot => 1,
14             };
15              
16 2 100       6 if ($d->opt_version) {
17 1         4 my ($version) = ($d->ua =~ m!ClaudeBot/([\d.]+)!);
18 1 50       9 $h->{version} = $version if $version;
19             }
20              
21 2         9 return $h;
22             }
23             }
24              
25              
26             1;
27              
28             __END__