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   40 use strict;
  6         12  
  6         169  
3 6     6   30 use warnings;
  6         12  
  6         128  
4 6     6   26 use Duadua::Util;
  6         13  
  6         1215  
5              
6             sub try {
7 307     307 1 622 my ($class, $d) = @_;
8              
9 307 100 100     572 if ( index($d->ua, 'Mozilla/') == 0 && index($d->ua, ' YJApp-') > -1 ) {
10 4         28 my $h = {
11             name => 'Browser of Yahoo! JAPAN App',
12             };
13              
14 4 100       13 if ($d->opt_version) {
15 2         5 my ($version) = ($d->ua =~ m! jp\.co\.yahoo\.[^/\s]+/([\d.]+)!);
16 2 50       13 $h->{version} = $version if $version;
17             }
18              
19 4         17 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__