File Coverage

blib/lib/Duadua/Parser/Browser/Yandex.pm
Criterion Covered Total %
statement 16 16 100.0
branch 5 6 83.3
condition 2 3 66.6
subroutine 4 4 100.0
pod 1 1 100.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Duadua::Parser::Browser::Yandex;
2 6     6   40 use strict;
  6         11  
  6         154  
3 6     6   25 use warnings;
  6         16  
  6         130  
4 6     6   25 use Duadua::Util qw//;
  6         13  
  6         930  
5              
6             sub try {
7 134     134 1 282 my ($class, $d) = @_;
8              
9 134 100 66     325 if ( index($d->ua, ' YaBrowser/') > -1 && index($d->ua, 'Mozilla/') > -1 ) {
10 2         17 my $h = {
11             name => 'Yandex Browser',
12             };
13              
14 2 100       8 if ($d->opt_version) {
15 1         3 my ($version) = ($d->ua =~ m! YaBrowser/([\d.]+)!);
16 1 50       5 $h->{version} = $version if $version;
17             }
18              
19 2         12 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__