File Coverage

lib/Egg/Plugin/HTTP/BrowserDetect.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition 0 3 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 13 18 72.2


line stmt bran cond sub pod time code
1             package Egg::Plugin::HTTP::BrowserDetect;
2             #
3             # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
4             #
5             # $Id: BrowserDetect.pm 337 2008-05-14 12:30:09Z lushe $
6             #
7 1     1   322 use strict;
  1         1  
  1         25  
8 1     1   5 use warnings;
  1         2  
  1         20  
9 1     1   3323 use HTTP::BrowserDetect;
  1         20535  
  1         21  
10              
11             our $VERSION = '3.00';
12              
13 0   0 0 1   sub browser { shift->{plugin_browser} ||= HTTP::BrowserDetect->new(@_) }
14              
15             1;
16              
17             __END__
18              
19             =head1 NAME
20              
21             Egg::Plugin::HTTP::BrowserDetect - Plugin for HTTP::BrowserDetect.
22              
23             =head1 SYNOPSIS
24              
25             use Egg qw/ HTTP::BrowserDetect /;
26            
27             if ($e->browser->windows) {
28             # OS is Windows.
29             } elsif ($e->browser->mac) {
30             # OS is Macintosh.
31             } elsif ($e->browser->unix) {
32             # OS is Unix.
33             } else {
34             # Other OS.
35             }
36              
37             =head1 DESCRIPTION
38              
39             Information on a browser etc. that the client uses is examined.
40              
41             see L<HTTP::BrowserDetect>.
42              
43             =head1 METHODS
44              
45             =head2 browser ([USER_AGENT])
46              
47             The object of L<HTTP::BrowserDetect> is returned.
48              
49             It is not necessary usually though USER_AGENT can be passed to the argument.
50              
51             my $browser= $e->browser;
52              
53             =head1 SEE ALSO
54              
55             L<HTTP::BrowserDetect>,
56             L<Egg::Release>,
57              
58             =head1 AUTHOR
59              
60             Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
61              
62             =head1 COPYRIGHT
63              
64             Copyright (C) 2007 by Bee Flag, Corp. E<lt>http://egg.bomcity.com/E<gt>.
65              
66             This library is free software; you can redistribute it and/or modify
67             it under the same terms as Perl itself, either Perl version 5.8.6 or,
68             at your option, any later version of Perl 5 you may have available.
69              
70             =cut
71