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

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Fri May 6 22:52:50 UTC 2011


Author: angelabad-guest
Date: Fri May  6 22:52:39 2011
New Revision: 74084

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74084
Log:
* New upstream release
* debian/control: Add libfile-slurp-perl to B-D-I
* Bump Standards-Version to 3.9.2 (no changes)

Added:
    trunk/libhttp-browserdetect-perl/META.json
      - copied unchanged from r74083, branches/upstream/libhttp-browserdetect-perl/current/META.json
    trunk/libhttp-browserdetect-perl/t/useragents.json
      - copied unchanged from r74083, branches/upstream/libhttp-browserdetect-perl/current/t/useragents.json
    trunk/libhttp-browserdetect-perl/t/yaml2json.pl
      - copied unchanged from r74083, branches/upstream/libhttp-browserdetect-perl/current/t/yaml2json.pl
Removed:
    trunk/libhttp-browserdetect-perl/META.yml
    trunk/libhttp-browserdetect-perl/t/useragents.yaml
Modified:
    trunk/libhttp-browserdetect-perl/Build.PL
    trunk/libhttp-browserdetect-perl/Changes
    trunk/libhttp-browserdetect-perl/MANIFEST
    trunk/libhttp-browserdetect-perl/Makefile.PL
    trunk/libhttp-browserdetect-perl/README
    trunk/libhttp-browserdetect-perl/debian/changelog
    trunk/libhttp-browserdetect-perl/debian/compat
    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

Modified: trunk/libhttp-browserdetect-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/Build.PL?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Build.PL (original)
+++ trunk/libhttp-browserdetect-perl/Build.PL Fri May  6 22:52:39 2011
@@ -9,13 +9,17 @@
   'build_requires' => {
     'Data::Dump' => '0',
     'English' => '0',
+    'File::Slurp' => '0',
     'FindBin' => '0',
+    'JSON::PP' => '0',
+    'Modern::Perl' => '0',
     'Module::Build' => '0.3601',
     'Test::More' => '0',
-    'YAML' => '0'
+    'YAML' => '0',
+    'YAML::Syck' => '0'
   },
   'configure_requires' => {
-    'ExtUtils::MakeMaker' => '6.31',
+    'ExtUtils::MakeMaker' => '6.30',
     'Module::Build' => '0.3601'
   },
   'dist_abstract' => 'Determine Web browser, version, and platform from an HTTP user agent string',
@@ -25,7 +29,7 @@
     'Olaf Alders <olaf at wundercounter.com> (current maintainer)'
   ],
   'dist_name' => 'HTTP-BrowserDetect',
-  'dist_version' => '1.22',
+  'dist_version' => '1.23',
   '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=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Changes (original)
+++ trunk/libhttp-browserdetect-perl/Changes Fri May  6 22:52:39 2011
@@ -1,4 +1,15 @@
 Revision history for Perl extension HTTP::BrowserDetect.
+
+1.23 2011-05-02
+    - Adds a browser_properties() call that exposes all the browser "properties" (Olivier Bilodeau)
+    - Fixes issues where a Chrome string would return 1 to a ->nav45up check (Olivier Bilodeau)
+    - Fixes issue where some WebKit/KHTML browsers returned 1 on ->gecko (Olivier Bilodeau)
+    - Adds wince method (Windows CE) (Olivier Bilodeau)
+    - Now detects Java UserAgent as a robot (Graham Barr)
+    - Now detects Jakarta Commons-HttpClient as a Java client (Graham Barr)
+    - UserAgent tests moved from YAML to JSON
+    - Moves issue tracking to Github
+    - Dist now includes META.json file
 
 1.22 2011-03-10
     - Adds Namoroka to list of Firefox browsers (Viacheslav Tykhanovskyi)

Modified: trunk/libhttp-browserdetect-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/MANIFEST?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/MANIFEST (original)
+++ trunk/libhttp-browserdetect-perl/MANIFEST Fri May  6 22:52:39 2011
@@ -3,7 +3,7 @@
 INSTALL
 LICENSE
 MANIFEST
-META.yml
+META.json
 Makefile.PL
 README
 TODO
@@ -13,4 +13,5 @@
 t/01-detect.t
 t/author-critic.t
 t/release-pod-coverage.t
-t/useragents.yaml
+t/useragents.json
+t/yaml2json.pl

Modified: trunk/libhttp-browserdetect-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/Makefile.PL?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/Makefile.PL (original)
+++ trunk/libhttp-browserdetect-perl/Makefile.PL Fri May  6 22:52:39 2011
@@ -4,7 +4,7 @@
 
 
 
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker 6.30;
 
 
 
@@ -14,13 +14,17 @@
   'BUILD_REQUIRES' => {
     'Data::Dump' => '0',
     'English' => '0',
+    'File::Slurp' => '0',
     'FindBin' => '0',
+    'JSON::PP' => '0',
+    'Modern::Perl' => '0',
     'Module::Build' => '0.3601',
     'Test::More' => '0',
-    'YAML' => '0'
+    'YAML' => '0',
+    'YAML::Syck' => '0'
   },
   'CONFIGURE_REQUIRES' => {
-    'ExtUtils::MakeMaker' => '6.31',
+    'ExtUtils::MakeMaker' => '6.30',
     'Module::Build' => '0.3601'
   },
   'DISTNAME' => 'HTTP-BrowserDetect',
@@ -31,7 +35,7 @@
     'Exporter' => '0',
     'vars' => '0'
   },
-  'VERSION' => '1.22',
+  'VERSION' => '1.23',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: trunk/libhttp-browserdetect-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/README?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/README (original)
+++ trunk/libhttp-browserdetect-perl/README Fri May  6 22:52:39 2011
@@ -3,7 +3,7 @@
     an HTTP user agent string
 
 VERSION
-    version 1.22
+    version 1.23
 
 SYNOPSIS
         use HTTP::BrowserDetect;
@@ -95,6 +95,11 @@
     BlackBerry, iPhone, iPod or iPad. Returns UNDEF if no hardware can be
     detected.
 
+  browser_properties()
+    Returns a list of the browser properties, that is, all of the tests that
+    passed for the provided user_agent string. Operating systems, devices,
+    browser names, mobile and robots are all browser properties.
+
 Detecting Browser Version
     Please note that that the version(), major() and minor() methods have
     been superceded as of release 1.07 of this module. They are not yet
@@ -187,6 +192,7 @@
             winme win95 win98
             winnt
                 win2k winxp win2k3 winvista win7
+        wince
 
   dotnet()
   mac()
@@ -363,6 +369,8 @@
 
     Enrico Sorcinelli
 
+    Olivier Bilodeau
+
 TO DO
     The _engine() method currently only handles Gecko. It needs to be
     expanded to handle other rendering engines.

Modified: trunk/libhttp-browserdetect-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/changelog?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/changelog (original)
+++ trunk/libhttp-browserdetect-perl/debian/changelog Fri May  6 22:52:39 2011
@@ -1,3 +1,11 @@
+libhttp-browserdetect-perl (1.23-1) unstable; urgency=low
+
+  * New upstream release
+  * debian/control: Add libfile-slurp-perl to B-D-I
+  * Bump Standards-Version to 3.9.2 (no changes)
+
+ -- Angel Abad <angelabad at gmail.com>  Sat, 07 May 2011 00:51:57 +0200
+
 libhttp-browserdetect-perl (1.22-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libhttp-browserdetect-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/compat?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/compat (original)
+++ trunk/libhttp-browserdetect-perl/debian/compat Fri May  6 22:52:39 2011
@@ -1,1 +1,1 @@
-8
+7

Modified: trunk/libhttp-browserdetect-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/debian/control?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/control (original)
+++ trunk/libhttp-browserdetect-perl/debian/control Fri May  6 22:52:39 2011
@@ -1,14 +1,19 @@
 Source: libhttp-browserdetect-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 8), perl
-Build-Depends-Indep: libdata-dump-perl, libmodule-build-perl (>= 0.360100),
- libyaml-perl
+Build-Depends: debhelper (>= 8),
+ perl
+Build-Depends-Indep: libdata-dump-perl,
+ libmodule-build-perl (>= 0.360100),
+ libyaml-perl,
+ libfile-slurp-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 debian.org>, Angel Abad <angelabad at gmail.com>,
+Uploaders: gregor herrmann <gregoa at debian.org>,
+ Jonathan Yu <jawnsy at cpan.org>,
+ Ansgar Burchardt <ansgar at debian.org>,
+ Angel Abad <angelabad at gmail.com>,
  Iñigo Tejedor Arrondo <poisonbit at gmail.com>
-Standards-Version: 3.9.1
+Standards-Version: 3.9.2
 Homepage: http://search.cpan.org/dist/HTTP-BrowserDetect/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-browserdetect-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/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=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/debian/copyright (original)
+++ trunk/libhttp-browserdetect-perl/debian/copyright Fri May  6 22:52:39 2011
@@ -9,10 +9,10 @@
 
 Files: debian/*
 Copyright: 2001-2004, Ivan Kohler <ivan-debian at 420.am>
+ 2010-2011, Angel Abad <angelabad at gmail.com>
+ 2010-2011, gregor herrmann <gregoa at debian.org>
+ 2010-2011, Ansgar Burchardt <ansgar at debian.org>
  2010, Jonathan Yu <jawnsy at cpan.org>
- 2010, Angel Abad <angelabad at gmail.com>
- 2010-2011, Ansgar Burchardt <ansgar at debian.org>
- 2010-2011, gregor herrmann <gregoa at debian.org>
  2010, Iñigo Tejedor Arrondo <poisonbit at gmail.com>
 License: Artistic or GPL-1+
 
@@ -29,5 +29,5 @@
  the Free Software Foundation; either version 1, or (at your option)
  any later version.
  .
- On Debian systems, the complete text of version 1 of the General
+ On Debian systems, the complete text of version 1 of the GNU General
  Public License can be found in `/usr/share/common-licenses/GPL-1'.

Modified: trunk/libhttp-browserdetect-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-browserdetect-perl/dist.ini?rev=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/dist.ini (original)
+++ trunk/libhttp-browserdetect-perl/dist.ini Fri May  6 22:52:39 2011
@@ -5,13 +5,12 @@
 license = Perl_5
 copyright_holder = Lee Semel
 copyright_year   = 2011
-version = 1.22
+version = 1.23
 main_module = lib/HTTP/BrowserDetect.pm
 
 [GatherDir]
 [PruneCruft]
 [ManifestSkip]
-[MetaYAML]
 [License]
 [PodCoverageTests]
 [ExtraTests]
@@ -27,7 +26,9 @@
 [UploadToCPAN]
 
 [MetaResources]
+[MetaJSON]
 [Bugtracker]
+web = http://github.com/oalders/%s/issues
 [GithubMeta]
 
 [AutoPrereqs]

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=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm (original)
+++ trunk/libhttp-browserdetect-perl/lib/HTTP/BrowserDetect.pm Fri May  6 22:52:39 2011
@@ -1,7 +1,7 @@
 use strict;
 package HTTP::BrowserDetect;
 BEGIN {
-  $HTTP::BrowserDetect::VERSION = '1.22';
+  $HTTP::BrowserDetect::VERSION = '1.23';
 }
 
 use vars qw(@ISA @EXPORT @EXPORT_OK @ALL_TESTS);
@@ -30,6 +30,7 @@
     freebsd bsd         vms
     x11     amiga       android
     win7    ps3gameos   pspgameos
+    wince
 );
 
 # Devices
@@ -59,6 +60,12 @@
     mozilla     gecko       r1
     iceweasel   netfront    mobile_safari
     elinks
+);
+
+# Firefox variants
+push @ALL_TESTS, qw(
+    firebird    iceweasel   phoenix 
+    namoroka
 );
 
 # Robots
@@ -240,7 +247,7 @@
     # Mozilla browsers
 
     $tests->{GECKO} = ( index( $ua, "gecko" ) != -1 )
-        && ( index( $ua, "khtml, like gecko" ) == -1 );
+        && ( index( $ua, "like gecko" ) == -1 );
 
     $tests->{CHROME} = ( index( $ua, "chrome/" ) != -1 );
     $tests->{SAFARI}
@@ -288,6 +295,7 @@
     $tests->{NETSCAPE}
         = (    !$tests->{FIREFOX}
             && !$tests->{SAFARI}
+            && !$tests->{CHROME}
             && index( $ua, "mozilla" ) != -1
             && index( $ua, "spoofer" ) == -1
             && index( $ua, "compatible" ) == -1
@@ -401,7 +409,7 @@
     $tests->{MSN} = ( (index( $ua, "msnbot" ) != -1 || index( $ua, "bingbot" )) != -1 );
     $tests->{MSNMOBILE} = ( (index( $ua, "msnbot-mobile" ) != -1 || index( $ua, "bingbot-mobile" )) != -1 );
     $tests->{JAVA}
-        = ( index( $ua, "java" ) != -1 || index( $ua, "jdk" ) != -1 );
+        = ( index( $ua, "java" ) != -1 || index( $ua, "jdk" ) != -1 || index($ua, "jakarta commons-httpclient") != -1);
     $tests->{ALTAVISTA}    = ( index( $ua, "altavista" ) != -1 );
     $tests->{SCOOTER}      = ( index( $ua, "scooter" ) != -1 );
     $tests->{LYCOS}        = ( index( $ua, "lycos" ) != -1 );
@@ -427,6 +435,7 @@
                 || $tests->{MSN}
                 || $tests->{MSNMOBILE}
                 || $tests->{FACEBOOK}
+                || $tests->{JAVA}
         )
             || index( $ua, "bot" ) != -1
             || index( $ua, "spider" ) != -1
@@ -552,6 +561,8 @@
     $tests->{WIN7}     = ( index( $ua, "nt 6.1" ) != -1 );
     $tests->{DOTNET}   = ( index( $ua, ".net clr" ) != -1 );
 
+    $tests->{WINCE} = ( index( $ua, "windows ce" ) != -1 );
+
     $tests->{WINME} = ( index( $ua, "win 9x 4.90" ) != -1 );    # whatever
     $tests->{WIN32} = (
         (          $tests->{WIN95}
@@ -579,6 +590,7 @@
                 || $tests->{WINVISTA}
                 || $tests->{WIN7}
                 || $tests->{WINME}
+                || $tests->{WINCE}
         )
             || index( $ua, "win" ) != -1
     );
@@ -1070,6 +1082,21 @@
 
 }
 
+sub browser_properties {
+
+    my ( $self, $check ) = _self_or_default( @_ );
+
+    my @browser_properties;
+    foreach my $property (keys %{$self->{tests}}) {
+        push @browser_properties, lc($property) if (${$self->{tests}}{$property});
+    }
+
+    # devices are a property too but it's not stored in %tests 
+    # so I explicitly test for it and add it
+    push @browser_properties, 'device' if ($self->device());
+
+    return @browser_properties;
+}
 1;
 
 
@@ -1082,7 +1109,7 @@
 
 =head1 VERSION
 
-version 1.22
+version 1.23
 
 =head1 SYNOPSIS
 
@@ -1177,6 +1204,12 @@
 are subject to change and are really meant for display purposes.  You should
 use the device() method in your logic.  Returns one of: BlackBerry, iPhone,
 iPod or iPad.  Returns UNDEF if no hardware can be detected.
+
+=head2 browser_properties()
+
+Returns a list of the browser properties, that is, all of the tests that passed
+for the provided user_agent string. Operating systems, devices, browser names, 
+mobile and robots are all browser properties.
 
 =head1 Detecting Browser Version
 
@@ -1281,6 +1314,7 @@
         winme win95 win98
         winnt
             win2k winxp win2k3 winvista win7
+    wince
 
 =head2 dotnet()
 
@@ -1522,6 +1556,8 @@
 
 Enrico Sorcinelli
 
+Olivier Bilodeau
+
 =head1 TO DO
 
 The _engine() method currently only handles Gecko.  It needs to be expanded to

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=74084&op=diff
==============================================================================
--- trunk/libhttp-browserdetect-perl/t/01-detect.t (original)
+++ trunk/libhttp-browserdetect-perl/t/01-detect.t Fri May  6 22:52:39 2011
@@ -4,18 +4,24 @@
 use warnings;
 
 use Data::Dump qw( dump );
+use File::Slurp;
 use FindBin;
+use JSON::PP;
 use Test::More qw( no_plan );
 use YAML qw( LoadFile );
 require_ok( 'HTTP::BrowserDetect' );
 
-my @tests = LoadFile( "$FindBin::Bin/useragents.yaml" );
+my $json  = read_file( "$FindBin::Bin/useragents.json" );
 
-foreach my $test ( @tests ) {
+my $tests = JSON::PP->new->ascii->decode( $json );
+
+foreach my $ua ( sort keys %{$tests} ) {
+
+    my $test = $tests->{$ua};
 
     #diag( dump $test );
 
-    my $detected = HTTP::BrowserDetect->new( $test->{useragent} );
+    my $detected = HTTP::BrowserDetect->new( $ua );
     diag( $detected->user_agent );
 
     foreach my $method ( 'browser_string', 'engine_string', ) {
@@ -25,7 +31,8 @@
         }
     }
 
-    foreach my $method (qw(
+    foreach my $method (
+        qw(
         public_version
         public_major
         public_minor
@@ -35,21 +42,28 @@
         engine_version
         engine_major
         engine_minor
-        ))
+        )
+        )
     {
-        if ( exists $test->{$method} and defined $test->{$method} and length $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} and defined $test->{$method} and length $test->{$method} ) {
+        if (    exists $test->{$method}
+            and defined $test->{$method}
+            and length $test->{$method} )
+        {
             cmp_ok( $detected->$method, 'eq', $test->{$method},
                 "$method: $test->{$method}" );
-        }  
+        }
     }
-
 
     $test->{os} =~ tr[A-Z][a-z] if $test->{os};
 
@@ -63,6 +77,12 @@
         ok( $detected->$type, "$type should match" );
     }
 
+    is_deeply(
+        [ sort $detected->browser_properties() ],
+        [ sort @{ $test->{match} } ],
+        "browser properties match"
+    );
+
     # Test that $ua doesn't match a specific method
     foreach my $type ( @{ $test->{no_match} } ) {
         ok( !$detected->$type, "$type shouldn't match (and doesn't)" );




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