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   907 use strict;
  6         19  
  6         169  
3 6     6   32 use warnings;
  6         9  
  6         140  
4 6     6   27 use Duadua::Util qw//;
  6         10  
  6         1029  
5              
6             sub try {
7 134     134 1 249 my ($class, $d) = @_;
8              
9 134 100 66     281 if ( index($d->ua, ' YaBrowser/') > -1 && index($d->ua, 'Mozilla/') > -1 ) {
10 2         9 my $h = {
11             name => 'Yandex Browser',
12             };
13              
14 2 100       6 if ($d->opt_version) {
15 1         7 my ($version) = ($d->ua =~ m! YaBrowser/([\d.]+)!);
16 1 50       5 $h->{version} = $version if $version;
17             }
18              
19 2         11 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__