[libmime-types-perl] 01/06: Imported Upstream version 2.11

gregor herrmann gregoa at debian.org
Tue Jul 7 16:36:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libmime-types-perl.

commit d48a490124357b5dc525f7bc4b3f45cacf49777c
Author: gregor herrmann <gregoa at debian.org>
Date:   Tue Jul 7 18:29:37 2015 +0200

    Imported Upstream version 2.11
---
 ChangeLog                | 15 +++++++++++++++
 META.json                |  2 +-
 META.yml                 |  2 +-
 Makefile.PL              |  2 +-
 lib/MIME/Type.pm         |  4 ++--
 lib/MIME/Type.pod        |  6 +++---
 lib/MIME/Types.pm        | 18 +++++++++++++-----
 lib/MIME/Types.pod       | 16 ++++++++++++----
 lib/MojoX/MIME/Types.pm  |  4 ++--
 lib/MojoX/MIME/Types.pod |  6 +++---
 t/21accept.t             |  2 +-
 11 files changed, 54 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1c991b..f32516f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,21 @@ Mark Overmeer.
 TODO:
  . Add source http://www.ltsw.se/knbase/internet/mime.htp ?
 
+version 2.11: Tue Jun 16 17:16:20 CEST 2015
+
+	Improvements:
+	- strict Perl 5.8
+	  rt.cpan.org #105267 [Miyagawa], cpantesters
+
+version 2.10: Mon Jun 15 17:32:22 CEST 2015
+
+	Fixes:
+	- accept field 'q' weights [Theo van Hoesel]
+
+	Improvements:
+	- introduce PERL_MIME_TYPE_DB
+	  rt.cpan.org#104945 [Philip Gwyn]
+
 version 2.09: Sun Sep 14 18:12:08 CEST 2014
 
 	Improvements:
diff --git a/META.json b/META.json
index 46b4bf8..535da8d 100644
--- a/META.json
+++ b/META.json
@@ -40,5 +40,5 @@
       }
    },
    "release_status" : "stable",
-   "version" : "2.09"
+   "version" : "2.11"
 }
diff --git a/META.yml b/META.yml
index e1a123e..5f04d7b 100644
--- a/META.yml
+++ b/META.yml
@@ -22,4 +22,4 @@ requires:
   File::Spec: 0
   List::Util: 0
   Test::More: 0.47
-version: 2.09
+version: 2.11
diff --git a/Makefile.PL b/Makefile.PL
index 110b9af..ead23f4 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
 
 require 5.008_008;
 
-my $version  = '2.09';   # scanned by bin/collect_types !
+my $version  = '2.11';   # scanned by bin/collect_types !
 
 WriteMakefile
   ( NAME      => 'MIME::Types'
diff --git a/lib/MIME/Type.pm b/lib/MIME/Type.pm
index 59cd402..274c3ff 100644
--- a/lib/MIME/Type.pm
+++ b/lib/MIME/Type.pm
@@ -1,10 +1,10 @@
-# Copyrights 1999,2001-2014 by [Mark Overmeer].
+# Copyrights 1999,2001-2015 by [Mark Overmeer].
 #  For other contributors see ChangeLog.
 # See the manual pages for details on the licensing terms.
 # Pod stripped from pm file by OODoc 2.01.
 package MIME::Type;
 use vars '$VERSION';
-$VERSION = '2.09';
+$VERSION = '2.11';
 
 
 use strict;
diff --git a/lib/MIME/Type.pod b/lib/MIME/Type.pod
index 5555caf..e558a8b 100644
--- a/lib/MIME/Type.pod
+++ b/lib/MIME/Type.pod
@@ -225,12 +225,12 @@ specified with the C<type> option flag.
 
 =head1 SEE ALSO
 
-This module is part of MIME-Types distribution version 2.09,
-built on September 14, 2014. Website: F<http://perl.overmeer.net/mimetypes/>
+This module is part of MIME-Types distribution version 2.11,
+built on June 16, 2015. Website: F<http://perl.overmeer.net/mimetypes/>
 
 =head1 LICENSE
 
-Copyrights 1999,2001-2014 by [Mark Overmeer]. For other contributors see ChangeLog.
+Copyrights 1999,2001-2015 by [Mark Overmeer]. For other contributors see ChangeLog.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
diff --git a/lib/MIME/Types.pm b/lib/MIME/Types.pm
index 911ede8..b6c3c21 100644
--- a/lib/MIME/Types.pm
+++ b/lib/MIME/Types.pm
@@ -1,11 +1,11 @@
-# Copyrights 1999,2001-2014 by [Mark Overmeer].
+# Copyrights 1999,2001-2015 by [Mark Overmeer].
 #  For other contributors see ChangeLog.
 # See the manual pages for details on the licensing terms.
 # Pod stripped from pm file by OODoc 2.01.
 
 package MIME::Types;
 use vars '$VERSION';
-$VERSION = '2.09';
+$VERSION = '2.11';
 
 
 use strict;
@@ -31,7 +31,8 @@ sub _read_db($)
     my $only_complete   = $args->{only_complete};
     my $only_iana       = $args->{only_iana};
 
-    my $db              = $args->{db_file}
+    my $db              = $ENV{PERL_MIME_TYPE_DB}
+      || $args->{db_file}
       || File::Spec->catfile(dirname(__FILE__), 'types.db');
 
     local *DB;
@@ -166,8 +167,15 @@ sub httpAccept($)
           $ !x or next;
 
         my $mime = "$1/$2$4";
-        my $q    = $3 || ($1 eq '*' ? -2 : $2 eq '*' ? -1 : 1);
-        push @listed, [ $mime, $q- at listed*0.001 ];
+        my $q    = defined $3 ? $3 : 1;   # q, default=1
+
+        # most complex first
+        $q += $4 ? +0.01 : $1 eq '*' ? -0.02 : $2 eq '*' ? -0.01 : 0;
+
+        # keep order
+        $q -= @listed*0.0001;
+
+        push @listed, [ $mime => $q ];
     }
     map $_->[0], sort {$b->[1] <=> $a->[1]} @listed;
 }
diff --git a/lib/MIME/Types.pod b/lib/MIME/Types.pod
index 4c75f8b..ce2af69 100644
--- a/lib/MIME/Types.pod
+++ b/lib/MIME/Types.pod
@@ -67,6 +67,14 @@ within your program, but in the future this may change.
 
 =item db_file => FILENAME
 
+The location of the database which contains the type information.  Only the
+first instantiation of this object will have this parameter obeyed.
+
+[2.10] This parameter can be globally overruled via the C<PERL_MIME_TYPE_DB>
+environment variable, which may be needed in case of PAR or other tricky
+installations.  For PAR, you probably set this environment variable to
+"inc/lib/MIME/types.db"
+
 =item only_complete => BOOLEAN
 
 Only include complete MIME type definitions: requires at least one known
@@ -166,7 +174,7 @@ kept.  See RFC2616 section 14.1
 
 example: 
 
-  my @types = $types->httpAccept('text/html, application/json;q=9');
+  my @types = $types->httpAccept('text/html, application/json;q=0.9');
 
 =item $obj-E<gt>B<httpAcceptBest>($accept|\@types, @have)
 
@@ -246,12 +254,12 @@ missing, please contact the maintainer for inclusion.
 
 =head1 SEE ALSO
 
-This module is part of MIME-Types distribution version 2.09,
-built on September 14, 2014. Website: F<http://perl.overmeer.net/mimetypes/>
+This module is part of MIME-Types distribution version 2.11,
+built on June 16, 2015. Website: F<http://perl.overmeer.net/mimetypes/>
 
 =head1 LICENSE
 
-Copyrights 1999,2001-2014 by [Mark Overmeer]. For other contributors see ChangeLog.
+Copyrights 1999,2001-2015 by [Mark Overmeer]. For other contributors see ChangeLog.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
diff --git a/lib/MojoX/MIME/Types.pm b/lib/MojoX/MIME/Types.pm
index ae56358..06788f8 100644
--- a/lib/MojoX/MIME/Types.pm
+++ b/lib/MojoX/MIME/Types.pm
@@ -1,10 +1,10 @@
-# Copyrights 1999,2001-2014 by [Mark Overmeer].
+# Copyrights 1999,2001-2015 by [Mark Overmeer].
 #  For other contributors see ChangeLog.
 # See the manual pages for details on the licensing terms.
 # Pod stripped from pm file by OODoc 2.01.
 package MojoX::MIME::Types;
 use vars '$VERSION';
-$VERSION = '2.09';
+$VERSION = '2.11';
 
 use Mojo::Base -base;
 
diff --git a/lib/MojoX/MIME/Types.pod b/lib/MojoX/MIME/Types.pod
index e6ebc16..4588185 100644
--- a/lib/MojoX/MIME/Types.pod
+++ b/lib/MojoX/MIME/Types.pod
@@ -202,12 +202,12 @@ L<MIME::Types::httpAcceptSelect()|MIME::Types/"HTTP support"> to replace this br
 
 =head1 SEE ALSO
 
-This module is part of MIME-Types distribution version 2.09,
-built on September 14, 2014. Website: F<http://perl.overmeer.net/mimetypes/>
+This module is part of MIME-Types distribution version 2.11,
+built on June 16, 2015. Website: F<http://perl.overmeer.net/mimetypes/>
 
 =head1 LICENSE
 
-Copyrights 1999,2001-2014 by [Mark Overmeer]. For other contributors see ChangeLog.
+Copyrights 1999,2001-2015 by [Mark Overmeer]. For other contributors see ChangeLog.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
diff --git a/t/21accept.t b/t/21accept.t
index f538a42..395946a 100644
--- a/t/21accept.t
+++ b/t/21accept.t
@@ -31,6 +31,6 @@ is($t2[2], 'text/noot');
 
 my @t3 = $a->httpAccept('*/*, text/*,text/aap, text/noot;q=3, text/mies;q=0.1');
 cmp_ok(scalar @t3, '==', 5, 'quality');
-is(join('#', at t3), 'text/noot#text/aap#text/mies#text/*#*/*');
+is(join('#', at t3), 'text/noot#text/aap#text/*#*/*#text/mies');
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmime-types-perl.git



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