File Coverage

blib/lib/Duadua/Parser/Browser/YahooJapanAppBrowser.pm
Criterion Covered Total %
statement 16 16 100.0
branch 5 6 83.3
condition 3 3 100.0
subroutine 4 4 100.0
pod 1 1 100.0
total 29 30 96.6


line stmt bran cond sub pod time code
1             package Duadua::Parser::Browser::YahooJapanAppBrowser;
2 6     6   731 use strict;
  6         18  
  6         162  
3 6     6   28 use warnings;
  6         11  
  6         116  
4 6     6   27 use Duadua::Util;
  6         10  
  6         1026  
5              
6             sub try {
7 306     306 1 651 my ($class, $d) = @_;
8              
9 306 100 100     591 if ( index($d->ua, 'Mozilla/') == 0 && index($d->ua, ' YJApp-') > -1 ) {
10 4         14 my $h = {
11             name => 'Browser of Yahoo! JAPAN App',
12             };
13              
14 4 100       11 if ($d->opt_version) {
15 2         5 my ($version) = ($d->ua =~ m! jp\.co\.yahoo\.[^/\s]+/([\d.]+)!);
16 2 50       10 $h->{version} = $version if $version;
17             }
18              
19 4         18 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__