r62002 - in /trunk/libhttp-browserdetect-perl: ./ debian/ lib/HTTP/ t/

poisonbit-guest at users.alioth.debian.org poisonbit-guest at users.alioth.debian.org
Tue Aug 24 20:25:28 UTC 2010


Author: poisonbit-guest
Date: Tue Aug 24 20:25:11 2010
New Revision: 62002

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62002
Log:
New upstream version.

Added:
    trunk/libhttp-browserdetect-perl/t/create_config.pl
      - copied unchanged from r61998, branches/upstream/libhttp-browserdetect-perl/current/t/create_config.pl
Modified:
    trunk/libhttp-browserdetect-perl/Build.PL
    trunk/libhttp-browserdetect-perl/Changes
    trunk/libhttp-browserdetect-perl/INSTALL
    trunk/libhttp-browserdetect-perl/MANIFEST
    trunk/libhttp-browserdetect-perl/META.yml
    trunk/libhttp-browserdetect-perl/Makefile.PL
    trunk/libhttp-browserdetect-perl/README
    trunk/libhttp-browserdetect-perl/debian/changelog
    trunk/libhttp-browserdetect-perl/debian/control
    trunk/libhttp-browserdetect-perl/debian/copyright
    trunk/libhttp-browserdetect-perl/dist.ini
    trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm
    trunk/libhttp-browserdetect-perl/t/01-detect.t
    trunk/libhttp-browserdetect-perl/t/author-critic.t
    trunk/libhttp-browserdetect-perl/t/useragents.yaml

Modified: trunk/libhttp-browserdetect-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/Build.PL?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Build.PL (original)
+++ trunk/libhttp-browserdetect-perl/Build.PL Tue Aug 24 20:25:11 2010
@@ -23,7 +23,7 @@
     'Olaf Alders <olaf at wundercounter.com> (current maintainer)'
   ],
   'dist_name' => 'HTTP-BrowserDetect',
-  'dist_version' => '1.13',
+  'dist_version' => '1.16',
   'license' => 'perl',
   'module_name' => 'HTTP::BrowserDetect',
   'recommends' => {},

Modified: trunk/libhttp-browserdetect-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/Changes?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Changes (original)
+++ trunk/libhttp-browserdetect-perl/Changes Tue Aug 24 20:25:11 2010
@@ -1,4 +1,14 @@
 Revision history for Perl extension HTTP::BrowserDetect.
+
+1.16 2010-08-19
+    - Added support for the < 3.0 Safari public versions (Jon Jensen)
+    - Added new UserAgents to useragents.yaml (Jon Jensen)
+    
+1.15 2010-08-18
+    - Re-releasing after some folders unintentionally included in build
+
+1.14 2010-08-18
+    - Fixed uninitialized value warnings for Safari (Heiko Weber) RT #60440
 
 1.13 2010-08-10
     - Firefox Mobile (Fennec) is now detected as mobile RT #60186 (Jacob Rask)
@@ -9,7 +19,7 @@
     - Added googlemobile (Luke Saunders: ec28d49d7218b43788b9)
     - SymbOS and Opera Mobi added to mobile detection RT #59817 (Jacob Rask)
     - Distribution is now managed with Dist::Zilla
-    
+
 1.11 2010-06-03
     - Added ps3 and psp (commit 85a619c9a977c0a8e403) (Alexey Surikov)
 

Modified: trunk/libhttp-browserdetect-perl/INSTALL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/INSTALL?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/INSTALL (original)
+++ trunk/libhttp-browserdetect-perl/INSTALL Tue Aug 24 20:25:11 2010
@@ -1,29 +1,14 @@
 
 This is the Perl distribution HTTP-BrowserDetect.
 
-Installing HTTP-BrowserDetect is straightforward.
+## Installation
 
-## Installation with cpanm
-
-If you have cpanm, you only need one line:
-
-    % cpanm HTTP::BrowserDetect
-
-If you are installing into a system-wide directory, you may need to pass the
-"-S" flag to cpanm, which uses sudo to install the module:
-
-    % cpanm -S HTTP::BrowserDetect
-
-## Installing with the CPAN shell
-
-Alternatively, if your CPAN shell is set up, you should just be able to do:
+HTTP-BrowserDetect installation is straightforward.
+If your CPAN shell is set up, you should just be able to do
 
     % cpan HTTP::BrowserDetect
 
-## Manual installation
-
-As a last resort, you can manually install it. Download the tarball, untar it,
-then build it:
+Download it, unpack it, then build it as per the usual:
 
     % perl Makefile.PL
     % make && make test
@@ -32,13 +17,11 @@
 
     % make install
 
-If you are installing into a system-wide directory, you may need to run:
-
-    % sudo make install
-
 ## Documentation
 
-HTTP-BrowserDetect documentation is available as POD.
-You can run perldoc from a shell to read the documentation:
+HTTP-BrowserDetect documentation is available as in POD.
+So you can do:
 
     % perldoc HTTP::BrowserDetect
+
+to read the documentation with your favorite pager.

Modified: trunk/libhttp-browserdetect-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/MANIFEST?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/MANIFEST (original)
+++ trunk/libhttp-browserdetect-perl/MANIFEST Tue Aug 24 20:25:11 2010
@@ -11,6 +11,7 @@
 lib/HTTP/BrowserDetect.pm
 t/01-detect.t
 t/author-critic.t
+t/create_config.pl
 t/release-pod-coverage.t
 t/release-pod-syntax.t
 t/useragents.yaml

Modified: trunk/libhttp-browserdetect-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/META.yml?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/META.yml (original)
+++ trunk/libhttp-browserdetect-perl/META.yml Tue Aug 24 20:25:11 2010
@@ -13,7 +13,7 @@
   ExtUtils::MakeMaker: 6.31
   Module::Build: 0.3601
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
+generated_by: 'Dist::Zilla version 4.102221, CPAN::Meta::Converter version 2.102160'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,4 +25,4 @@
 resources:
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTTP-BrowserDetect
   repository: http://github.com/oalders/http-browserdetect
-version: 1.13
+version: 1.16

Modified: trunk/libhttp-browserdetect-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/Makefile.PL?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Makefile.PL (original)
+++ trunk/libhttp-browserdetect-perl/Makefile.PL Tue Aug 24 20:25:11 2010
@@ -31,7 +31,7 @@
     'Exporter' => '0',
     'vars' => '0'
   },
-  'VERSION' => '1.13',
+  'VERSION' => '1.16',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: trunk/libhttp-browserdetect-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/README?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/README (original)
+++ trunk/libhttp-browserdetect-perl/README Tue Aug 24 20:25:11 2010
@@ -3,7 +3,7 @@
     an HTTP user agent string
 
 VERSION
-    version 1.13
+    version 1.16
 
 SYNOPSIS
         use HTTP::BrowserDetect;
@@ -210,7 +210,7 @@
     Returns one of the following strings, or undef. This method exists
     solely for compatibility with the HTTP::Headers::UserAgent module.
 
-      Win95, Win98, WinNT, Win2K, WinXP, Win2K3, WinVista, Win7, Mac, Mac OS X,
+      Win95, Win98, WinNT, Win2K, WinXP, Win2k3, WinVista, Win7, Mac, Mac OS X,
       Win3x, OS2, Unix, Linux, Playstation 3 GameOS, Playstation Portable GameOS
 
 Detecting Browser Vendor
@@ -240,21 +240,19 @@
    curl
    realplayer
    netfront
-    Netscape 6, even though its called six, in the userAgent string has
+    Netscape 6, even though its called six, in the User-Agent string has
     version number 5. The nav6 and nav6up methods correctly handle this
-    quirk. The firefox text correctly detects the older-named versions of
-    the browser (Phoenix, Firebird)
+    quirk. The Firefox test correctly detects the older-named versions of
+    the browser (Phoenix, Firebird).
 
   browser_string()
     Returns undef on failure. Otherwise returns one of the following:
 
-    Firefox, Safari, Chrome, MSIE, etc
-
-    To see a complete list of possible browser strings, check the
-    browser_string() method in the source code.
+    Netscape, Firefox, Safari, Chrome, MSIE, WebTV, AOL Browser, Opera,
+    Mosaic, Lynx, RealPlayer, IceWeasel, curl, puf, NetFront
 
   gecko_version()
-    If a Gecko rendering engine is used (as in Mozilla or Firebird), returns
+    If a Gecko rendering engine is used (as in Mozilla or Firefox), returns
     the version of the renderer (e.g. 1.3a, 1.7, 1.8) This might be more
     useful than the particular browser name or version when correcting for
     quirks in different versions of this rendering engine. If no Gecko
@@ -350,23 +348,29 @@
 
     Jacob Rask
 
+    Heiko Weber
+
+    Jon Jensen
+
 TO DO
     The _engine() method currently only handles Gecko. It needs to be
     expanded to handle other rendering engines.
 
     POD coverage is also not 100%.
 
-    If you're able to help out with anything on the TO DO list, please do. A
-    great deal of the latest improvements have come from patches via RT and
-    GitHub pull requests. If you're able to submit changes via GitHub, I'm
-    generally able to get them into a new release fairly quickly.
-
 SEE ALSO
     "The Ultimate JavaScript Client Sniffer, Version 3.0",
-    http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html.
-
-    "Browser ID (User-Agent) Strings"
+    http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
+
+    "Browser ID (User-Agent) Strings",
     http://www.zytrax.com/tech/web/browser_ids.htm
+
+    Safari "Historical User Agent strings",
+    http://developer.apple.com/internet/safari/uamatrix.html (now gone,
+    retrieved 2007-06-20)
+
+    "Safari Agent Strings",
+    http://homepage.mac.com/jprince/designSandbox/web/safari-agents/
 
     perl(1), HTTP::Headers, HTTP::Headers::UserAgent.
 
@@ -401,11 +405,17 @@
     The biggest limitation at this point is the test suite, which really
     needs to have many more UserAgent strings to test against.
 
+CONTRIBUTING
     Patches are certainly welcome, with many thanks for the excellent
     contributions which have already been received. The preferred method of
     patching would be to fork the GitHub repo and then send me a pull
     requests, but plain old patch files are also welcome.
 
+    If you're able to add test cases, this will speed up the time to release
+    your changes. Just edit t/useragents.yaml so that the test coverage
+    includes any changes you have made. Please contact me if you have any
+    questions.
+
 AUTHOR
     Olaf Alders <olaf at wundercounter.com> (current maintainer)
 

Modified: trunk/libhttp-browserdetect-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/changelog?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/changelog (original)
+++ trunk/libhttp-browserdetect-perl/debian/changelog Tue Aug 24 20:25:11 2010
@@ -1,7 +1,12 @@
-libhttp-browserdetect-perl (1.13-1) UNRELEASED; urgency=low
+libhttp-browserdetect-perl (1.16-1) UNRELEASED; urgency=low
 
-  TODO: - the 'GNU' has gone missing from the GPL-1+ text (see diff)
-  - Also document the change to the maintainer email in d/copyright?
+  * New upstream release
+  * Add myself to uploaders
+  * Review and delete old TO-DO lines
+
+ -- Iñigo Tejedor Arrondo <poisonbit at gmail.com>  Tue, 24 Aug 2010 22:23:00 +0200
+
+libhttp-browserdetect-perl (1.13-1) unstable; urgency=low
 
   * New upstream release
   * Add myself to uploaders

Modified: trunk/libhttp-browserdetect-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/control?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/control (original)
+++ trunk/libhttp-browserdetect-perl/debian/control Tue Aug 24 20:25:11 2010
@@ -6,7 +6,8 @@
  libyaml-tiny-perl, perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: gregor herrmann <gregoa at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
- Ansgar Burchardt <ansgar at 43-1.org>, Angel Abad <angelabad at gmail.com>
+ Ansgar Burchardt <ansgar at 43-1.org>, Angel Abad <angelabad at gmail.com>,
+ Iñigo Tejedor Arrondo <poisonbit at gmail.com>
 Standards-Version: 3.9.1
 Homepage: http://search.cpan.org/dist/HTTP-BrowserDetect/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-browserdetect-perl/

Modified: trunk/libhttp-browserdetect-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/copyright?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/copyright (original)
+++ trunk/libhttp-browserdetect-perl/debian/copyright Tue Aug 24 20:25:11 2010
@@ -13,6 +13,7 @@
  2010, Angel Abad <angelabad at gmail.com>
  2010, Ansgar Burchardt <ansgar at 43-1.org>
  2010, gregor herrmann <gregoa at debian.org>
+ 2010, Iñigo Tejedor Arrondo <poisonbit at gmail.com>
 License: Artistic or GPL-1+
 
 License: Artistic

Modified: trunk/libhttp-browserdetect-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/dist.ini?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/dist.ini (original)
+++ trunk/libhttp-browserdetect-perl/dist.ini Tue Aug 24 20:25:11 2010
@@ -1,9 +1,9 @@
-name    = HTTP-BrowserDetect 
+name    = HTTP-BrowserDetect
 author  = Olaf Alders <olaf at wundercounter.com> (current maintainer)
 license = Perl_5
-copyright_holder = Lee Semel 
+copyright_holder = Lee Semel
 copyright_year   = 2010
-version = 1.13
+version = 1.16
 main_module = lib/HTTP/BrowserDetect.pm
 
 [MetaResources]
@@ -19,3 +19,4 @@
 [ModuleBuild]
 [PodWeaver]
 
+[UploadToCPAN]

Modified: trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm (original)
+++ trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm Tue Aug 24 20:25:11 2010
@@ -1,7 +1,7 @@
 use strict;
 package HTTP::BrowserDetect;
 BEGIN {
-  $HTTP::BrowserDetect::VERSION = '1.13';
+  $HTTP::BrowserDetect::VERSION = '1.16';
 }
 
 use vars qw(@ISA @EXPORT @EXPORT_OK @ALL_TESTS);
@@ -75,6 +75,37 @@
 # Properties
 push @ALL_TESTS, 'mobile';
 
+
+# Safari build -> version map for versions prior to 3.0
+# (since then, version appears in the user-agent string)
+
+my %safari_build_to_version = qw(
+    48      0.8
+    51      0.8.1
+    60      0.8.2
+    73      0.9
+    74      1.0b2v74
+    85      1.0
+    85.7    1.0.2
+    85.8    1.0.3
+    100     1.1
+    100.1   1.1.1
+    125     1.2
+    125.1   1.2.1
+    125.7   1.2.2
+    125.9   1.2.3
+    125.11  1.2.4
+    312     1.3
+    312.3   1.3.1
+    312.5   1.3.2
+    412     2.0
+    412.5   2.0.1
+    416.12  2.0.2
+    417.8   2.0.3
+    419.3   2.0.4
+);
+
+
 #######################################################################################################
 # BROWSER OBJECT
 
@@ -148,7 +179,7 @@
             ( [^\s]* )              # Beta version string is up to next space
         }x
     );
-    
+
 
     # Firefox version
     if ($ua =~ m{
@@ -188,11 +219,11 @@
         $beta  = $3;
 
     }
-    
+
     # Opera needs to be dealt with specifically
     # http://dev.opera.com/articles/view/opera-ua-string-changes/
     # Opera/9.80 (S60; SymbOS; Opera Mobi/320; U; sv) Presto/2.4.15 Version/10.00
-    
+
     if ( $ua =~ m{\AOpera.*\sVersion/(\d*)\.(\d*)\z}i) {
         $major = $1;
         $minor = $2;
@@ -223,33 +254,28 @@
                 ( [^.]* )           # Minor version number is digits after first dot
             }x
         );
-
-        #print "major=$major minor=$minor beta=$beta\n";
     }
 
     # Safari Version
     elsif ( $tests->{SAFARI} ) {
-
-
-        my ( $safari_build, $safari_minor );
-        ( $safari_build, $safari_minor ) = (
+        my ( $safari_build, $safari_minor ) = (
             $ua =~ m{
-                safari
-                \/
-                ( [^.]* )       # Major version number is everything before first dot
-                (?:             # The first dot
-                ( \d* ))?       # Minor version number is digits after first dot
+                safari/
+                ( \d+ )       # Major version number
+                ( \. \d+ )?   # Minor version number is dot and following digits
             }x
         );
 
-# in some obscure cases, extra characters are captured by the regex
-# like: Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.3.1.15.0
-        $safari_build =~ s{ [^\d] }{}gxms;
-
-        $major = int( $safari_build / 100 );
-        $minor = int( $safari_build % 100 ) / 100;
-        $beta  = $safari_minor;
-
+        if ( !$safari_build && $ua =~ m{applewebkit\/([\d\.]{1,})}xi ) {
+            # ignore digits after 2nd dot
+            ( $safari_build, $safari_minor ) = split /\./, $1;
+        }
+
+        if ( $safari_build ) {
+            $major = int( $safari_build / 100 );
+            $minor = int( $safari_build % 100 ) / 100;
+            $beta  = $safari_minor;
+        }
     }
 
     # Gecko-powered Netscape (i.e. Mozilla) versions
@@ -261,7 +287,7 @@
             && index( $ua, "compatible" ) == -1
             && index( $ua, "opera" ) == -1
             && index( $ua, "webtv" ) == -1
-            && index( $ua, "hotjava" ) == -1 
+            && index( $ua, "hotjava" ) == -1
             && index( $ua, "playstation 3" ) == -1
             && index( $ua, "playstation portable" ) == -1 );
 
@@ -799,31 +825,51 @@
 }
 
 sub public_beta {
-
-    my ( $self, $check ) = _self_or_default( @_ );
-    return $self->beta( $check );
-
+    my ( $self, $check ) = _self_or_default( @_ );
+    my ( $major, $minor, $beta ) = $self->_public;
+
+    return $beta;
 }
 
 sub _public {
     my ( $self, $check ) = _self_or_default( @_ );
 
-    my $ua = $self->user_agent;
-
-    # this is the Public version of Safari.  See RT #48727
-    if ( $self->safari && $ua =~ m{
+    # Return Public version of Safari. See RT #48727.
+    if ($self->safari) {
+        my $ua = lc $self->user_agent;
+
+        # Safari starting with version 3.0 provides its own public version
+        if ( $ua =~ m{
                 version/
-                ( [^.]* )       # Major version number is everything before first dot
-                \.              # The first dot
-                ( [^.]* )       # Minor version number is digits after first dot
+                ( \d+ )       # Major version number is everything before first dot
+                ( \. \d+ )?   # Minor version number is first dot and following digits
             }x
-        )
-    {
-        return ( $1, $2 );
-    }
-
-    return ( $self->major, $self>minor );
-
+            )
+        {
+            return ($1, $2, undef);
+        }
+
+        # Safari before version 3.0 had only build numbers;
+        # use a lookup table provided by Apple to convert to version numbers
+        if ($ua =~ m{ safari/ ( \d+ (?: \.\d+ )* ) }x) {
+            my $build = $1;
+            my $version = $safari_build_to_version{$build};
+            unless ($version) {
+                # if exact build -> version mapping doesn't exist, find next lower build
+                for my $maybe_build (sort { $b <=> $a } keys %safari_build_to_version) {
+                    $version = $safari_build_to_version{$maybe_build}, last
+                        if $build >= $maybe_build;
+                }
+            }
+            my ($major, $minor) = split /\./, $version;
+            my $beta;
+            $minor =~ s/(\D.*)// and $beta = $1;
+            $minor = 0 + ('.' . $minor);
+            return ( $major, $minor, ($beta ? 1 : undef) );
+        }
+    }
+
+    return ( $self->major, $self->minor, $self->beta($check) );
 }
 
 
@@ -831,13 +877,13 @@
 sub engine_string {
 
     my ( $self, $check ) = _self_or_default( @_ );
+
+    if ( $self->user_agent =~ m{\bKHTML\b} ) {
+        return 'KHTML';
+    }
 
     if ( $self->gecko ) {
         return 'Gecko';
-    }
-
-    if ( $self->user_agent =~ m{KHTML, like Gecko} ) {
-        return 'KHTML';
     }
 
     if ( $self->ie ) {
@@ -1020,7 +1066,7 @@
 
 =head1 VERSION
 
-version 1.13
+version 1.16
 
 =head1 SYNOPSIS
 
@@ -1251,7 +1297,7 @@
 Returns one of the following strings, or undef. This method exists solely for
 compatibility with the L<HTTP::Headers::UserAgent> module.
 
-  Win95, Win98, WinNT, Win2K, WinXP, Win2K3, WinVista, Win7, Mac, Mac OS X,
+  Win95, Win98, WinNT, Win2K, WinXP, Win2k3, WinVista, Win7, Mac, Mac OS X,
   Win3x, OS2, Unix, Linux, Playstation 3 GameOS, Playstation Portable GameOS
 
 =head1 Detecting Browser Vendor
@@ -1304,23 +1350,21 @@
 
 =head3 netfront
 
-Netscape 6, even though its called six, in the userAgent string has version
-number 5. The nav6 and nav6up methods correctly handle this quirk. The firefox
-text correctly detects the older-named versions of the browser (Phoenix,
-Firebird)
+Netscape 6, even though its called six, in the User-Agent string has version
+number 5. The nav6 and nav6up methods correctly handle this quirk. The Firefox
+test correctly detects the older-named versions of the browser (Phoenix,
+Firebird).
 
 =head2 browser_string()
 
 Returns undef on failure.  Otherwise returns one of the following:
 
-Firefox, Safari, Chrome, MSIE, etc
-
-To see a complete list of possible browser strings, check the browser_string()
-method in the source code.
+Netscape, Firefox, Safari, Chrome, MSIE, WebTV, AOL Browser, Opera, Mosaic,
+Lynx, RealPlayer, IceWeasel, curl, puf, NetFront
 
 =head2 gecko_version()
 
-If a Gecko rendering engine is used (as in Mozilla or Firebird), returns the
+If a Gecko rendering engine is used (as in Mozilla or Firefox), returns the
 version of the renderer (e.g. 1.3a, 1.7, 1.8) This might be more useful than
 the particular browser name or version when correcting for quirks in different
 versions of this rendering engine. If no Gecko browser is being used, or the
@@ -1444,6 +1488,10 @@
 
 Jacob Rask
 
+Heiko Weber
+
+Jon Jensen
+
 =head1 TO DO
 
 The _engine() method currently only handles Gecko.  It needs to be expanded to
@@ -1451,16 +1499,15 @@
 
 POD coverage is also not 100%.
 
-If you're able to help out with anything on the TO DO list, please do. A great
-deal of the latest improvements have come from patches via RT and GitHub pull
-requests. If you're able to submit changes via GitHub, I'm generally able to
-get them into a new release fairly quickly.
-
 =head1 SEE ALSO
 
-"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>.
-
-"Browser ID (User-Agent) Strings" B<http://www.zytrax.com/tech/web/browser_ids.htm>
+"The Ultimate JavaScript Client Sniffer, Version 3.0", B<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>
+
+"Browser ID (User-Agent) Strings", B<http://www.zytrax.com/tech/web/browser_ids.htm>
+
+Safari "Historical User Agent strings", B<http://developer.apple.com/internet/safari/uamatrix.html> (now gone, retrieved 2007-06-20)
+
+"Safari Agent Strings", B<http://homepage.mac.com/jprince/designSandbox/web/safari-agents/>
 
 perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
 
@@ -1500,12 +1547,18 @@
 
 The biggest limitation at this point is the test suite, which really needs to
 have many more UserAgent strings to test against.
+
+=head1 CONTRIBUTING
 
 Patches are certainly welcome, with many thanks for the excellent
 contributions which have already been received. The preferred method of
 patching would be to fork the GitHub repo and then send me a pull requests,
 but plain old patch files are also welcome.
 
+If you're able to add test cases, this will speed up the time to release your
+changes. Just edit t/useragents.yaml so that the test coverage includes any
+changes you have made.  Please contact me if you have any questions.
+
 =head1 AUTHOR
 
 Olaf Alders <olaf at wundercounter.com> (current maintainer)

Modified: trunk/libhttp-browserdetect-perl/t/01-detect.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/t/01-detect.t?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/t/01-detect.t (original)
+++ trunk/libhttp-browserdetect-perl/t/01-detect.t Tue Aug 24 20:25:11 2010
@@ -25,19 +25,26 @@
         }
     }
 
-    foreach my $method (
-        'major',   'minor', 'engine_major', 'engine_minor',
-        'version', 'engine_version',
-        )
+    foreach my $method (qw(
+        public_version
+        public_major
+        public_minor
+        version
+        major
+        minor
+        engine_version
+        engine_major
+        engine_minor
+        ))
     {
-        if ( exists $test->{$method} && $test->{$method} ) {
+        if ( exists $test->{$method} and defined $test->{$method} and length $test->{$method} ) {
             cmp_ok( $detected->$method, '==', $test->{$method},
                 "$method: $test->{$method}" );
         }
     }
 
     foreach my $method ( 'language', 'device', 'device_name' ) {
-        if ( exists $test->{$method} && $test->{$method} ) {
+        if ( exists $test->{$method} and defined $test->{$method} and length $test->{$method} ) {
             cmp_ok( $detected->$method, 'eq', $test->{$method},
                 "$method: $test->{$method}" );
         }  

Modified: trunk/libhttp-browserdetect-perl/t/author-critic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/t/author-critic.t?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/t/author-critic.t (original)
+++ trunk/libhttp-browserdetect-perl/t/author-critic.t Tue Aug 24 20:25:11 2010
@@ -16,4 +16,5 @@
 
 eval "use Test::Perl::Critic";
 plan skip_all => 'Test::Perl::Critic required to criticise code' if $@;
+Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc";
 all_critic_ok();

Modified: trunk/libhttp-browserdetect-perl/t/useragents.yaml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/t/useragents.yaml?rev=62002&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/t/useragents.yaml (original)
+++ trunk/libhttp-browserdetect-perl/t/useragents.yaml Tue Aug 24 20:25:11 2010
@@ -1167,7 +1167,7 @@
 version: 6.1
 major: 6
 minor: 0.1
-public_version: 6
+public_version: 6.1
 public_major: 6
 public_minor: 0.1
 language: EN
@@ -1202,7 +1202,7 @@
 match:
   - mac
   - realplayer
-minor: 1
+minor: 0.1
 no_match:
   - windows
 os: ~
@@ -1347,7 +1347,7 @@
   - mac
 public_version: 3.6
 public_major: 3
-public_minor: 6
+public_minor: 0.6
 version: 3.6
 major: 3
 minor: 0.6
@@ -1474,3 +1474,522 @@
 version: 3.6 
 major: 3 
 minor: .6
+---
+browser_string: ~
+match:
+  - safari 
+no_match: ~
+os: ~
+other: ~
+useragent: 'Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 Nokia5230/20.0.005; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.3'
+language: ~
+country: ~
+public_version: 3.0
+public_major: 3
+public_minor: 0
+version: 5.25 
+major: 5 
+minor: .25 
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en) AppleWebKit/522.13.1 (KHTML, like Gecko) Version/3.0.2 Safari/522.13.1'
+match:
+  - windows
+  - winnt
+  - win2k
+  - win32
+  - safari
+browser_string: Safari
+os: Win2k
+public_version: 3.0
+public_major: 3
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 2.0
+public_major: 2
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4'
+match:
+  - mac
+  - macosx
+  - macppc
+  - firefox
+browser_string: Firefox
+os: Mac OS X
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en) AppleWebKit/522.12.1 (KHTML, like Gecko) Version/3.0.1 Safari/522.12.2'
+match:
+  - safari
+  - windows
+  - winnt
+  - win2k
+  - win32
+browser_string: Safari
+os: Win2k
+public_version: 3.0
+public_major: 3
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; x86_64) KHTML/3.5.6 (like Gecko) (Kubuntu)'
+match:
+  - konqueror
+  - linux
+  - unix
+  - x11
+os: Linux
+public_version: 3.5
+public_major: 3
+public_minor: 0.5
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3'
+match:
+  - safari
+  - mac
+  - macosx
+browser_string: Safari
+os: Mac OS X
+public_version: 2.0
+public_major: 2
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20061201 Galeon/2.0.2 (Ubuntu package 2.0.2-4ubuntu1) Firefox/2.0.0.4 (Ubuntu-feisty)'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.8.1.4) Gecko/20061201 Epiphany/2.18 Firefox/2.0.0.4 (Ubuntu-feisty)'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 1.5
+public_major: 1
+public_minor: 0.5
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)'
+match:
+  - windows
+  - win32
+  - winnt
+  - winxp
+  - ie
+  - ie6
+  - ie55up
+  - ie4up
+  - dotnet
+browser_string: MSIE
+os: WinXP
+public_version: 6.0
+public_major: 6
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12'
+match:
+  - windows
+  - win32
+  - winnt
+  - winxp
+  - firefox
+browser_string: Firefox
+os: WinXP
+public_version: 1.5
+public_major: 1
+public_minor: 0.5
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4'
+match:
+  - mac
+  - macosx
+  - firefox
+browser_string: Firefox
+os: Mac OS X
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Opera/9.21 (Macintosh; Intel Mac OS X; U; en)'
+match:
+  - mac
+  - macosx
+  - opera
+browser_string: Opera
+os: Mac OS X
+public_version: 9.21
+public_major: 9
+public_minor: 0.21
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/6.0.495.0 Safari/534.6'
+match:
+  - linux
+  - unix
+  - x11
+  - chrome
+browser_string: Chrome
+os: Linux
+public_version: 6.0
+public_major: 6
+public_minor: 0
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8'
+match:
+  - windows
+  - winxp
+  - safari
+browser_string: Safari
+os: WinXP
+public_version: 5.0
+public_major: 5
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4'
+match:
+  - linux
+  - unix
+  - x11
+  - chrome
+browser_string: Chrome
+os: Linux
+public_version: 5.0
+public_major: 5
+public_minor: 0
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 3.6
+public_major: 3
+public_minor: 0.6
+engine_version: 1.9
+engine_major: 1
+engine_minor: 0.9
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20091023 Galeon/2.0.7 (Ubuntu 2.0.7-1ubuntu2)'
+match:
+  - linux
+  - unix
+  - x11
+  - netscape
+#browser_string: Galeon
+browser_string: Netscape
+os: Linux
+#public_version: 2.0
+#public_major: 2
+#public_minor: 0.0
+engine_version: 1.9
+engine_major: 1
+engine_minor: 0.9
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100722 SeaMonkey/2.0.6'
+match:
+  - linux
+  - unix
+  - x11
+  - netscape
+#browser_string: SeaMonkey
+browser_string: Netscape
+os: Linux
+#public_version: 2.0
+#public_major: 2
+#public_minor: 0
+engine_version: 1.9
+engine_major: 1
+engine_minor: 0.9
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.36 Safari/534.3'
+match:
+  - windows
+  - winxp
+  - chrome
+browser_string: Chrome
+os: WinXP
+public_version: 6.0
+public_major: 6
+public_minor: 0
+engine_string: KHTML
+language: EN
+country: US
+---
+useragent: 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; eMusic DLM/4; .NET4.0C)'
+match:
+  - windows
+  - winxp
+  - ie
+  - ie8
+browser_string: MSIE
+os: WinXP
+public_version: 8.0
+public_major: 8
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0C)'
+match:
+  - windows
+  - winxp
+  - firefox
+browser_string: Firefox
+os: WinXP
+public_version: 3.6
+public_major: 3
+public_minor: 0.6
+engine_version: 1.9
+engine_major: 1
+engine_minor: 0.9
+language: EN
+country: US
+---
+useragent: 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.10'
+match:
+  - windows
+  - winxp
+  - opera
+browser_string: Opera
+os: WinXP
+public_version: 10.10
+public_major: 10
+public_minor: 0.10
+language: EN
+---
+useragent: 'Mozilla/5.0 (Linux; U; Android 1.5; en-us; Google Ion Build/CRB43) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1'
+match:
+  - safari
+  - mobile
+  - linux
+  - android
+browser_string: Safari
+public_version: 3.1
+public_major: 3
+public_minor: 0.1
+version: 5.25
+major: 5
+minor: 0.25
+engine: 5.25
+engine_string: KHTML
+language: EN
+country: US
+---
+useragent: 'Mozilla/5.0 (compatible; Konqueror/4.4; Linux; X11; x86_64) KHTML/4.4.2 (like Gecko) Kubuntu'
+match:
+  - linux
+  - unix
+  - x11
+  - konqueror
+os: Linux
+public_version: 4.4
+public_major: 4
+public_minor: 0.4
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/48 (like Gecko) Safari/48'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 0.8
+public_major: 0
+public_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/60 (like Gecko) Safari/60'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 0.8
+public_major: 0
+public_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/73 (KHTML, like Gecko) Safari/73'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 0.9
+public_major: 0
+public_minor: 0.9
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/85 (KHTML, like Gecko) Safari/85'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 1.0
+public_major: 1
+public_minor: 0
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 1.2
+public_major: 1
+public_minor: 0.2
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.6 (KHTML, like Gecko) Safari/125.12'
+match:
+  - mac
+  - macosx
+  - macppc
+  - safari
+browser_string: Safari
+os: Mac OS X
+public_version: 1.2
+public_major: 1
+public_minor: 0.2
+engine_string: KHTML
+---
+useragent: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)'
+match:
+  - linux
+  - unix
+  - x11
+  - firefox
+browser_string: Firefox
+os: Linux
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_string: Gecko
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en) AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3'
+match:
+  - windows
+  - winnt
+  - win2k
+  - win32
+  - safari
+browser_string: Safari
+os: Win2k
+public_version: 3.0
+public_major: 3
+public_minor: 0
+engine_string: KHTML
+---
+useragent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322'
+match:
+  - windows
+  - winnt
+  - win2k
+  - win32
+  - ie
+  - ie4up
+  - ie5up
+  - ie55up
+  - ie6
+  - dotnet
+browser_string: MSIE
+os: Win2k
+public_version: 6.0
+public_major: 6
+public_minor: 0
+---
+useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4'
+match:
+  - windows
+  - winnt
+  - win2k
+  - win32
+  - firefox
+  - gecko
+browser_string: Firefox
+os: Win2k
+public_version: 2.0
+public_major: 2
+public_minor: 0
+engine_string: Gecko
+engine_version: 1.8
+engine_major: 1
+engine_minor: 0.8




More information about the Pkg-perl-cvs-commits mailing list