@@ -2,6 +2,17 @@ Revision history for Perl extension File::MimeInfo.
Versions up to 0.15 by Jaap Karssenberg <pardus@cpan.org>
Versions starting 0.16 by Michiel Beijen <michiel.beijen@gmail.com>
+0.25 2014-04-03
+ - Included new test file in MANIFEST.
+
+0.24 2014-04-02
+ - Fixed freedesktop.org desktop-file-utils URL - David Steinbrunner.
+
+0.23 2014-04-02
+ - Fixed opening of files with '+' in mime type using
+ File::MimeInfo::Applications.
+ Debian bug 690334, brian m. carlson.
+
0.22 2014-02-27
- Fixed Double-close on a filehandle issue
(RT 93221) - Christian Ludwig.
@@ -21,18 +21,22 @@ t/05_more.t
t/06_pod_ok.t
t/07_pod_cover.t
t/08_changes.t
+t/09_no404s.t
t/applications/foo.desktop
t/applications/mimeinfo.cache
+t/applications/mirage.desktop
t/default/binary_file
t/default/empty_file
t/default/encoding_breakage
t/default/plain_text
t/default/utf8_text
t/magic/application_msword
+t/magic/application_octet-stream
t/magic/application_vnd.corel-draw
t/magic/application_x-executable
t/magic/application_x-perl
t/magic/application_x-perl.txt
+t/magic/text_plain
t/magic/text_x-patch
t/mime/aliases
t/mime/globs
@@ -4,7 +4,7 @@
"Jaap Karssenberg <pardus@cpan.org>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.132830",
+ "generated_by" : "ExtUtils::MakeMaker version 6.8, CPAN::Meta::Converter version 2.132830",
"license" : [
"perl_5"
],
@@ -50,5 +50,5 @@
"url" : "https://github.com/mbeijen/File-MimeInfo"
}
},
- "version" : "0.22"
+ "version" : "0.25"
}
@@ -12,7 +12,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 6.30
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.132830'
+generated_by: 'ExtUtils::MakeMaker version 6.8, CPAN::Meta::Converter version 2.132830'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,4 +27,4 @@ requires:
resources:
bugtracker: https://github.com/mbeijen/File-MimeInfo/issues
repository: https://github.com/mbeijen/File-MimeInfo
-version: 0.22
+version: 0.25
@@ -8,7 +8,7 @@ use File::MimeInfo qw/mimetype_canon mimetype_isa/;
use File::DesktopEntry;
require Exporter;
-our $VERSION = '0.22';
+our $VERSION = '0.25';
our @ISA = qw(Exporter);
our @EXPORT = qw(
@@ -21,7 +21,7 @@ WARNING: You don't seem to have any mimeinfo.cache files.
Try running the update-desktop-database command. If you
don't have this command you should install the
desktop-file-utils package. This package is available from
-http://freedesktop.org/wiki/Software_2fdesktop_2dfile_2dutils
+http://freedesktop.org/wiki/Software/desktop-file-utils/
EOT
sub mime_applications {
@@ -120,7 +120,7 @@ sub _read_list { # read list with "mime/type=foo.desktop;bar.desktop" format
my @list;
open LIST, '<', $file or croak "Could not read file: $file";
while (<LIST>) {
- /^$mimetype=(.*)$/ or next;
+ /^\Q$mimetype\E=(.*)$/ or next;
push @list, grep defined($_), split ';', $1;
}
close LIST;
@@ -135,7 +135,7 @@ sub _write_list {
if (-f $file) {
open LIST, '<', $file or croak "Could not read file: $file";
while (<LIST>) {
- $text .= $_ unless /^$mimetype=/;
+ $text .= $_ unless /^\Q$mimetype\E=/;
}
close LIST;
$text =~ s/[\n\r]?$/\n/; # just to be sure
@@ -294,6 +294,6 @@ L<File::MimeInfo>,
L<File::MimeInfo::Magic>,
L<File::BaseDir>
-L<http://freedesktop.org/wiki/Software_2fdesktop_2dfile_2dutils>
+L<http://freedesktop.org/wiki/Software/desktop-file-utils/>
=cut
@@ -17,7 +17,7 @@ BEGIN {
our @ISA = qw(Exporter File::MimeInfo);
our @EXPORT = qw(mimetype);
our @EXPORT_OK = qw(extensions describe globs inodetype magic);
-our $VERSION = '0.22';
+our $VERSION = '0.25';
our $DEBUG;
our $_hashed = 0;
@@ -10,7 +10,7 @@ our @ISA = qw(Exporter);
our @EXPORT = qw(mime_exec mime_system);
our @EXPORT_OK = qw(suggest_script_name);
our %EXPORT_TAGS = (magic => \@EXPORT);
-our $VERSION = '0.22';
+our $VERSION = '0.25';
our @choicespath = (
config_home('rox.sourceforge.net'),
File::Spec->catdir($ENV{HOME}, 'Choices'),
@@ -10,7 +10,7 @@ require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(mimetype);
our @EXPORT_OK = qw(extensions describe globs inodetype mimetype_canon mimetype_isa);
-our $VERSION = '0.22';
+our $VERSION = '0.25';
our $DEBUG;
our ($_hashed, $_hashed_aliases, $_hashed_subclasses);
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-our $VERSION = '0.22';
+our $VERSION = '0.25';
$|++;
# ########## #
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-our $VERSION = '0.22';
+our $VERSION = '0.25';
$|++;
# ########## #
@@ -1,5 +1,6 @@
use strict;
-use Test::More tests => 14;
+use File::Spec;
+use Test::More tests => 16;
$ENV{XDG_DATA_HOME} = './t/';
$ENV{XDG_DATA_DIRS} = './t/'; # forceing non default value
@@ -36,13 +37,26 @@ SKIP: {
use_ok('File::MimeInfo::Applications');
- my ($default, @other) = mime_applications('text/plain');
+
+ my %list = (
+ 'text/plain' => 'foo.desktop',
+ 'image/svg+xml' => 'mirage.desktop',
+ );
+
+ for my $type (keys %list) {
+
+ my ($default, @other) = mime_applications($type);
ok (
!defined($default) &&
(@other == 1) &&
ref($other[0]) eq 'File::DesktopEntry',
'mime_application() works'
);
- ok ( $other[0]->{file} =~ /foo\.desktop$/, "desktop file is the right one" );
+ is (
+ $other[0]->{file},
+ File::Spec->catfile('t', 'applications', $list{$type}),
+ "desktop file is the right one",
+ );
+ }
}
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+use strict; use warnings;
+
+use Test::More;
+
+eval "use Test::Pod::No404s";
+if ( $@ ) {
+ plan skip_all => 'Test::Pod::No404s required for testing POD';
+} else {
+ all_pod_files_ok();
+}
@@ -1,2 +1,3 @@
[MIME Cache]
text/plain=foo.desktop
+image/svg+xml=mirage.desktop
@@ -0,0 +1,26 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=Foo Viewer
+Comment=The best viewer for Foo objects available!
+Comment[eo]=Tekstredaktilo
+Comment[ja]=テキストエディタ
+TryExec=fooview
+Exec=fooview %F
+Icon=fooview.png
+MimeType=image/x-foo
+X-KDE-Library=libfooview
+X-KDE-FactoryName=fooviewfactory
+X-KDE-ServiceType=FooService
+
+[Desktop Action Inverse]
+# Inverse Foo => ooF
+Exec=fooview --inverse %f
+Name=Foo Viewer (inverse image)
+
+[Desktop Action Edit]
+Exec=fooview --edit %f
+Name=Foo Viewer (edit image)
+Icon=fooview-edit.png
+
diff --git a/var/tmp/source/MICHIELB/File-MimeInfo-0.25/File-MimeInfo-0.25/t/magic/application_octet-stream b/var/tmp/source/MICHIELB/File-MimeInfo-0.25/File-MimeInfo-0.25/t/magic/application_octet-stream
new file mode 100644
index 00000000..ec227ada
Binary files /dev/null and b/var/tmp/source/MICHIELB/File-MimeInfo-0.25/File-MimeInfo-0.25/t/magic/application_octet-stream differ
@@ -0,0 +1 @@
+This is plain text