File Coverage

blib/lib/Duadua/Parser/Browser/GoogleApp.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::GoogleApp;
2 6     6   735 use strict;
  6         13  
  6         164  
3 6     6   26 use warnings;
  6         11  
  6         127  
4 6     6   25 use Duadua::Util qw//;
  6         12  
  6         903  
5              
6             sub try {
7 138     138 1 310 my ($class, $d) = @_;
8              
9 138 100 100     296 if ( index($d->ua, ' AppleWebKit/') > -1 && index($d->ua, ') GSA/') > -1 ) {
10 2         7 my $h = {
11             name => 'Google App',
12             };
13              
14 2 100       8 if ($d->opt_version) {
15 1         3 my ($version) = ($d->ua =~ m!\) GSA/([\d.]+)!);
16 1 50       5 $h->{version} = $version if $version;
17             }
18              
19 2         6 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__