@@ -1,3 +1,11 @@
+1.10 2015-02-01
+
+- Fixed Makefile.PL to actually use --lib and --include properly. Previously
+ it did the wrong thing with both of these arguments, and they were
+ essentially ignored. Reported by WATANABE Hiroaki. Patch by Mithun
+ Ayachit. RT #101715.
+
+
1.09 2014-12-20
- No code changes. This release just removes some junk that accidentally ended
@@ -1,4 +1,4 @@
-This software is copyright (c) 2014 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
+This software is copyright (c) 2015 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2014 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
+This software is Copyright (c) 2015 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2014 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
+This software is Copyright (c) 2015 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
This is free software, licensed under:
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.029.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.031.
Changes
INSTALL.md
LICENSE
@@ -19,6 +19,8 @@ inc/MyMakeMaker.pm
lib/File/LibMagic.pm
lib/File/LibMagic.xs
lib/File/typemap
+perlcriticrc
+perltidyrc
ppport.h
t/00-compile.t
t/00-report-prereqs.dd
@@ -27,11 +29,11 @@ t/all-exports.t
t/author-eol.t
t/author-no-tabs.t
t/author-pod-spell.t
-t/basic.t
t/complete-interface-errors.t
t/complete-interface.t
t/easy-interface.t
t/lib/Test/AnyOf.pm
+t/lib/Test/Exports.pm
t/oo-api.t
t/release-cpan-changes.t
t/release-pod-coverage.t
@@ -39,9 +41,13 @@ t/release-pod-linkcheck.t
t/release-pod-syntax.t
t/release-portability.t
t/release-synopsis.t
+t/release-test-version.t
+t/release-tidyall.t
t/samples/foo.c
t/samples/foo.foo
t/samples/foo.txt
t/samples/magic
t/samples/magic.mime
t/version.t
+tidyall.ini
+weaver.ini
@@ -6,13 +6,13 @@
"Dave Rolsky <autarch@urth.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.029, CPAN::Meta::Converter version 2.143240",
+ "generated_by" : "Dist::Zilla version 5.031, CPAN::Meta::Converter version 2.143240",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "File-LibMagic",
"prereqs" : {
@@ -23,15 +23,20 @@
},
"develop" : {
"requires" : {
+ "Code::TidyAll" : "0.24",
+ "Perl::Critic" : "1.123",
+ "Perl::Tidy" : "20140711",
"Pod::Coverage::TrustPod" : "0",
"Test::CPAN::Changes" : "0.19",
+ "Test::Code::TidyAll" : "0.24",
"Test::EOL" : "0",
"Test::More" : "0.88",
"Test::NoTabs" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08",
"Test::Spelling" : "0.12",
- "Test::Synopsis" : "0"
+ "Test::Synopsis" : "0",
+ "Test::Version" : "1"
}
},
"runtime" : {
@@ -54,7 +59,8 @@
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
- "Test::More" : "0.88",
+ "Test::Fatal" : "0",
+ "Test::More" : "0.96",
"lib" : "0"
}
}
@@ -62,7 +68,7 @@
"provides" : {
"File::LibMagic" : {
"file" : "lib/File/LibMagic.pm",
- "version" : "1.09"
+ "version" : "1.10"
}
},
"release_status" : "stable",
@@ -78,10 +84,10 @@
"web" : "https://github.com/autarch/File-LibMagic"
}
},
- "version" : "1.09",
+ "version" : "1.10",
"x_Dist_Zilla" : {
"perl" : {
- "version" : "5.016003"
+ "version" : "5.020001"
},
"plugins" : [
{
@@ -92,22 +98,22 @@
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "@DROLSKY/AutoPrereqs",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::CopyFilesFromBuild",
"name" : "@DROLSKY/CopyFilesFromBuild",
- "version" : "0.103510"
+ "version" : "0.150250"
},
{
"class" : "Dist::Zilla::Plugin::Git::GatherDir",
"config" : {
"Dist::Zilla::Plugin::GatherDir" : {
"exclude_filename" : [
- "README.md",
"cpanfile",
- "Makefile.PL",
+ "README.md",
"LICENSE",
+ "Makefile.PL",
"Build.PL"
],
"exclude_match" : [],
@@ -125,22 +131,22 @@
}
},
"name" : "@DROLSKY/Git::GatherDir",
- "version" : "2.028"
+ "version" : "2.029"
},
{
"class" : "Dist::Zilla::Plugin::GitHub::Meta",
"name" : "@DROLSKY/GitHub::Meta",
- "version" : "0.38"
+ "version" : "0.40"
},
{
"class" : "Dist::Zilla::Plugin::GitHub::Update",
"name" : "@DROLSKY/GitHub::Update",
- "version" : "0.38"
+ "version" : "0.40"
},
{
"class" : "Dist::Zilla::Plugin::MetaResources",
"name" : "@DROLSKY/MetaResources",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::MetaProvides::Package",
@@ -150,7 +156,7 @@
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : "@DROLSKY/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
- "version" : "5.029"
+ "version" : "5.031"
}
]
},
@@ -161,12 +167,12 @@
}
},
"name" : "@DROLSKY/MetaProvides::Package",
- "version" : "2.001002"
+ "version" : "2.003001"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@DROLSKY/NextRelease",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
@@ -176,8 +182,19 @@
"type" : "requires"
}
},
- "name" : "@DROLSKY/TestMoreDoneTesting",
- "version" : "5.029"
+ "name" : "@DROLSKY/Test::More with subtest()",
+ "version" : "5.031"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Prereqs",
+ "config" : {
+ "Dist::Zilla::Plugin::Prereqs" : {
+ "phase" : "develop",
+ "type" : "requires"
+ }
+ },
+ "name" : "@DROLSKY/Modules for use with tidyall",
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
@@ -189,27 +206,28 @@
"phase" : "release",
"skip" : [
"Dist::Zilla::Plugin::DROLSKY::Contributors",
- "Dist::Zilla::Plugin::DROLSKY::License"
+ "Dist::Zilla::Plugin::DROLSKY::License",
+ "Dist::Zilla::Plugin::DROLSKY::TidyAll"
]
}
},
- "name" : "@DROLSKY/stale modules, release",
- "version" : "0.032"
+ "name" : "@DROLSKY/PromptIfStale",
+ "version" : "0.037"
},
{
"class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
- "name" : "@DROLSKY/ReadmeMarkdownInBuild",
- "version" : "0.142470"
+ "name" : "@DROLSKY/README.md in build",
+ "version" : "0.150250"
},
{
"class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
- "name" : "@DROLSKY/ReadmeMarkdownInRoot",
- "version" : "0.142470"
+ "name" : "@DROLSKY/README.md in root",
+ "version" : "0.150250"
},
{
"class" : "Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable",
"name" : "@DROLSKY/Test::Pod::Coverage::Configurable",
- "version" : "0.02"
+ "version" : "0.03"
},
{
"class" : "Dist::Zilla::Plugin::Test::PodSpelling",
@@ -219,77 +237,92 @@
{
"class" : "Dist::Zilla::Plugin::Test::ReportPrereqs",
"name" : "@DROLSKY/Test::ReportPrereqs",
- "version" : "0.019"
+ "version" : "0.020"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::Version",
+ "name" : "@DROLSKY/Test::Version",
+ "version" : "0.003001"
},
{
"class" : "Dist::Zilla::Plugin::ManifestSkip",
"name" : "@DROLSKY/ManifestSkip",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
"name" : "@DROLSKY/MetaYAML",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::License",
"name" : "@DROLSKY/License",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::ExtraTests",
"name" : "@DROLSKY/ExtraTests",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"name" : "@DROLSKY/ExecDir",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
"name" : "@DROLSKY/ShareDir",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
"name" : "@DROLSKY/Manifest",
- "version" : "5.029"
+ "version" : "5.031"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::CheckVersionIncrement",
+ "name" : "@DROLSKY/CheckVersionIncrement",
+ "version" : "0.121750"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
"name" : "@DROLSKY/TestRelease",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
"name" : "@DROLSKY/ConfirmRelease",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
"name" : "@DROLSKY/UploadToCPAN",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
"name" : "@DROLSKY/CheckPrereqsIndexed",
- "version" : "0.013"
+ "version" : "0.015"
},
{
"class" : "Dist::Zilla::Plugin::CPANFile",
"name" : "@DROLSKY/CPANFile",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::DROLSKY::Contributors",
"name" : "@DROLSKY/DROLSKY::Contributors",
- "version" : "0.27"
+ "version" : "0.31"
},
{
"class" : "Dist::Zilla::Plugin::DROLSKY::License",
"name" : "@DROLSKY/DROLSKY::License",
- "version" : "0.27"
+ "version" : "0.31"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::DROLSKY::TidyAll",
+ "name" : "@DROLSKY/DROLSKY::TidyAll",
+ "version" : "0.31"
},
{
"class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch",
@@ -322,12 +355,7 @@
}
},
"name" : "@DROLSKY/Git::Contributors",
- "version" : "0.008"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Describe",
- "name" : "@DROLSKY/Git::Describe",
- "version" : "0.003"
+ "version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::Meta::Contributors",
@@ -337,12 +365,17 @@
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@DROLSKY/MetaConfig",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@DROLSKY/MetaJSON",
- "version" : "5.029"
+ "version" : "5.031"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::RewriteVersion",
+ "name" : "@DROLSKY/RewriteVersion",
+ "version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::SurgicalPodWeaver",
@@ -356,62 +389,62 @@
{
"class" : "Pod::Weaver::Plugin::EnsurePod5",
"name" : "@CorePrep/EnsurePod5",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Plugin::H1Nester",
"name" : "@CorePrep/H1Nester",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Name",
"name" : "Name",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Version",
"name" : "Version",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "prelude",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "SYNOPSIS",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "DESCRIPTION",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Leftovers",
"name" : "Leftovers",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "postlude",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Authors",
"name" : "Authors",
- "version" : "4.008"
+ "version" : "4.010"
},
{
"class" : "Pod::Weaver::Section::Contributors",
"name" : "Contributors",
- "version" : "0.008"
+ "version" : "0.009"
},
{
"class" : "Pod::Weaver::Section::Legal",
"name" : "Legal",
- "version" : "4.008"
+ "version" : "4.010"
}
]
}
@@ -422,12 +455,12 @@
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@DROLSKY/PodSyntaxTests",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::Test::CPAN::Changes",
"name" : "@DROLSKY/Test::CPAN::Changes",
- "version" : "0.008"
+ "version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::Test::Compile",
@@ -455,11 +488,17 @@
"class" : "Dist::Zilla::Plugin::Test::EOL",
"config" : {
"Dist::Zilla::Plugin::Test::EOL" : {
- "filename" : "xt/author/eol.t"
+ "filename" : "xt/author/eol.t",
+ "finder" : [
+ ":InstallModules",
+ ":ExecFiles",
+ ":TestFiles"
+ ],
+ "trailing_whitespace" : "1"
}
},
"name" : "@DROLSKY/Test::EOL",
- "version" : "0.16"
+ "version" : "0.17"
},
{
"class" : "Dist::Zilla::Plugin::Test::NoTabs",
@@ -474,7 +513,7 @@
}
},
"name" : "@DROLSKY/Test::NoTabs",
- "version" : "0.09"
+ "version" : "0.13"
},
{
"class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck",
@@ -484,12 +523,17 @@
{
"class" : "Dist::Zilla::Plugin::Test::Portability",
"name" : "@DROLSKY/Test::Portability",
- "version" : "2.000005"
+ "version" : "2.000006"
},
{
"class" : "Dist::Zilla::Plugin::Test::Synopsis",
"name" : "@DROLSKY/Test::Synopsis",
- "version" : "2.000005"
+ "version" : "2.000006"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::TidyAll",
+ "name" : "@DROLSKY/Test::TidyAll",
+ "version" : "0.01"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
@@ -499,10 +543,10 @@
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
- "README.md",
"cpanfile",
- "Makefile.PL",
+ "README.md",
"LICENSE",
+ "Makefile.PL",
"Build.PL",
"Changes",
"CONTRIBUTING.md"
@@ -515,7 +559,7 @@
}
},
"name" : "@DROLSKY/Git::Check",
- "version" : "2.028"
+ "version" : "2.029"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
@@ -527,10 +571,10 @@
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
- "README.md",
"cpanfile",
- "Makefile.PL",
+ "README.md",
"LICENSE",
+ "Makefile.PL",
"Build.PL",
"Changes",
"CONTRIBUTING.md"
@@ -542,8 +586,8 @@
"repo_root" : "."
}
},
- "name" : "@DROLSKY/Git::Commit",
- "version" : "2.028"
+ "name" : "@DROLSKY/commit generated files",
+ "version" : "2.029"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
@@ -551,7 +595,7 @@
"Dist::Zilla::Plugin::Git::Tag" : {
"branch" : null,
"signed" : 0,
- "tag" : "v1.09",
+ "tag" : "v1.10",
"tag_format" : "v%v",
"tag_message" : "v%v",
"time_zone" : "local"
@@ -561,7 +605,7 @@
}
},
"name" : "@DROLSKY/Git::Tag",
- "version" : "2.028"
+ "version" : "2.029"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
@@ -577,49 +621,19 @@
}
},
"name" : "@DROLSKY/Git::Push",
- "version" : "2.028"
- },
- {
- "class" : "inc::MyMakeMaker",
- "config" : {
- "Dist::Zilla::Role::TestRunner" : {
- "default_jobs" : 1
- }
- },
- "name" : "=inc::MyMakeMaker",
- "version" : null
- },
- {
- "class" : "inc::MyInstallGuide",
- "name" : "=inc::MyInstallGuide",
- "version" : null
- },
- {
- "class" : "Dist::Zilla::Plugin::FileFinder::Filter",
- "name" : "VersionedModules",
- "version" : "5.029"
- },
- {
- "class" : "Dist::Zilla::Plugin::RewriteVersion",
- "name" : "RewriteVersion",
- "version" : "0.008"
- },
- {
- "class" : "Dist::Zilla::Plugin::CheckVersionIncrement",
- "name" : "CheckVersionIncrement",
- "version" : "0.121750"
+ "version" : "2.029"
},
{
"class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease",
- "name" : "BumpVersionAfterRelease",
- "version" : "0.008"
+ "name" : "@DROLSKY/BumpVersionAfterRelease",
+ "version" : "0.009"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"config" : {
"Dist::Zilla::Plugin::Git::Commit" : {
"add_files_in" : [],
- "commit_msg" : "increment version after release",
+ "commit_msg" : "Bump version after release",
"time_zone" : "local"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
@@ -628,7 +642,7 @@
"Changes"
],
"allow_dirty_match" : [
- "(?^u:^lib/.*\\.pm$)"
+ "(?^:.+)"
],
"changelog" : "Changes"
},
@@ -636,53 +650,84 @@
"repo_root" : "."
}
},
- "name" : "increment version",
- "version" : "2.028"
+ "name" : "@DROLSKY/commit version bump",
+ "version" : "2.029"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Push",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::Push" : {
+ "push_to" : [
+ "origin"
+ ],
+ "remotes_must_exist" : 1
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@DROLSKY/push version bump",
+ "version" : "2.029"
+ },
+ {
+ "class" : "inc::MyMakeMaker",
+ "config" : {
+ "Dist::Zilla::Role::TestRunner" : {
+ "default_jobs" : 1
+ }
+ },
+ "name" : "=inc::MyMakeMaker",
+ "version" : null
+ },
+ {
+ "class" : "inc::MyInstallGuide",
+ "name" : "=inc::MyInstallGuide",
+ "version" : null
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":AllFiles",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":NoFiles",
- "version" : "5.029"
+ "version" : "5.031"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : "@DROLSKY/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
- "version" : "5.029"
+ "version" : "5.031"
}
],
"zilla" : {
@@ -690,11 +735,12 @@
"config" : {
"is_trial" : "0"
},
- "version" : "5.029"
+ "version" : "5.031"
}
},
"x_authority" : "cpan:DROLSKY",
"x_contributors" : [
+ "Mithun Ayachit <mayachit@amfam.com>",
"Olaf Alders <olaf@wundersolutions.com>"
]
}
@@ -9,12 +9,13 @@ build_requires:
File::Spec: '0'
IO::Handle: '0'
IPC::Open3: '0'
- Test::More: '0.88'
+ Test::Fatal: '0'
+ Test::More: '0.96'
lib: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.029, CPAN::Meta::Converter version 2.143240'
+generated_by: 'Dist::Zilla version 5.031, CPAN::Meta::Converter version 2.143240'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,7 +24,7 @@ name: File-LibMagic
provides:
File::LibMagic:
file: lib/File/LibMagic.pm
- version: '1.09'
+ version: '1.10'
requires:
Carp: '0'
Exporter: '0'
@@ -36,10 +37,10 @@ resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=File::LibMagic
homepage: http://metacpan.org/release/File::LibMagic
repository: git://github.com/autarch/File-LibMagic.git
-version: '1.09'
+version: '1.10'
x_Dist_Zilla:
perl:
- version: '5.016003'
+ version: '5.020001'
plugins:
-
class: Dist::Zilla::Plugin::Authority
@@ -48,20 +49,20 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@DROLSKY/AutoPrereqs'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::CopyFilesFromBuild
name: '@DROLSKY/CopyFilesFromBuild'
- version: '0.103510'
+ version: '0.150250'
-
class: Dist::Zilla::Plugin::Git::GatherDir
config:
Dist::Zilla::Plugin::GatherDir:
exclude_filename:
- - README.md
- cpanfile
- - Makefile.PL
+ - README.md
- LICENSE
+ - Makefile.PL
- Build.PL
exclude_match: []
follow_symlinks: '0'
@@ -74,19 +75,19 @@ x_Dist_Zilla:
Dist::Zilla::Role::Git::Repo:
repo_root: .
name: '@DROLSKY/Git::GatherDir'
- version: '2.028'
+ version: '2.029'
-
class: Dist::Zilla::Plugin::GitHub::Meta
name: '@DROLSKY/GitHub::Meta'
- version: '0.38'
+ version: '0.40'
-
class: Dist::Zilla::Plugin::GitHub::Update
name: '@DROLSKY/GitHub::Update'
- version: '0.38'
+ version: '0.40'
-
class: Dist::Zilla::Plugin::MetaResources
name: '@DROLSKY/MetaResources'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::MetaProvides::Package
config:
@@ -95,25 +96,33 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::FinderCode
name: '@DROLSKY/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
- version: '5.029'
+ version: '5.031'
Dist::Zilla::Role::MetaProvider::Provider:
inherit_missing: '1'
inherit_version: '1'
meta_noindex: '1'
name: '@DROLSKY/MetaProvides::Package'
- version: '2.001002'
+ version: '2.003001'
-
class: Dist::Zilla::Plugin::NextRelease
name: '@DROLSKY/NextRelease'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: test
type: requires
- name: '@DROLSKY/TestMoreDoneTesting'
- version: '5.029'
+ name: '@DROLSKY/Test::More with subtest()'
+ version: '5.031'
+ -
+ class: Dist::Zilla::Plugin::Prereqs
+ config:
+ Dist::Zilla::Plugin::Prereqs:
+ phase: develop
+ type: requires
+ name: '@DROLSKY/Modules for use with tidyall'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
@@ -125,20 +134,21 @@ x_Dist_Zilla:
skip:
- Dist::Zilla::Plugin::DROLSKY::Contributors
- Dist::Zilla::Plugin::DROLSKY::License
- name: '@DROLSKY/stale modules, release'
- version: '0.032'
+ - Dist::Zilla::Plugin::DROLSKY::TidyAll
+ name: '@DROLSKY/PromptIfStale'
+ version: '0.037'
-
class: Dist::Zilla::Plugin::ReadmeAnyFromPod
- name: '@DROLSKY/ReadmeMarkdownInBuild'
- version: '0.142470'
+ name: '@DROLSKY/README.md in build'
+ version: '0.150250'
-
class: Dist::Zilla::Plugin::ReadmeAnyFromPod
- name: '@DROLSKY/ReadmeMarkdownInRoot'
- version: '0.142470'
+ name: '@DROLSKY/README.md in root'
+ version: '0.150250'
-
class: Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable
name: '@DROLSKY/Test::Pod::Coverage::Configurable'
- version: '0.02'
+ version: '0.03'
-
class: Dist::Zilla::Plugin::Test::PodSpelling
name: '@DROLSKY/Test::PodSpelling'
@@ -146,63 +156,75 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::Test::ReportPrereqs
name: '@DROLSKY/Test::ReportPrereqs'
- version: '0.019'
+ version: '0.020'
+ -
+ class: Dist::Zilla::Plugin::Test::Version
+ name: '@DROLSKY/Test::Version'
+ version: '0.003001'
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@DROLSKY/ManifestSkip'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@DROLSKY/MetaYAML'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::License
name: '@DROLSKY/License'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::ExtraTests
name: '@DROLSKY/ExtraTests'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::ExecDir
name: '@DROLSKY/ExecDir'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::ShareDir
name: '@DROLSKY/ShareDir'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::Manifest
name: '@DROLSKY/Manifest'
- version: '5.029'
+ version: '5.031'
+ -
+ class: Dist::Zilla::Plugin::CheckVersionIncrement
+ name: '@DROLSKY/CheckVersionIncrement'
+ version: '0.121750'
-
class: Dist::Zilla::Plugin::TestRelease
name: '@DROLSKY/TestRelease'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@DROLSKY/ConfirmRelease'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@DROLSKY/UploadToCPAN'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@DROLSKY/CheckPrereqsIndexed'
- version: '0.013'
+ version: '0.015'
-
class: Dist::Zilla::Plugin::CPANFile
name: '@DROLSKY/CPANFile'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::DROLSKY::Contributors
name: '@DROLSKY/DROLSKY::Contributors'
- version: '0.27'
+ version: '0.31'
-
class: Dist::Zilla::Plugin::DROLSKY::License
name: '@DROLSKY/DROLSKY::License'
- version: '0.27'
+ version: '0.31'
+ -
+ class: Dist::Zilla::Plugin::DROLSKY::TidyAll
+ name: '@DROLSKY/DROLSKY::TidyAll'
+ version: '0.31'
-
class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch
config:
@@ -226,11 +248,7 @@ x_Dist_Zilla:
order_by: name
paths: []
name: '@DROLSKY/Git::Contributors'
- version: '0.008'
- -
- class: Dist::Zilla::Plugin::Git::Describe
- name: '@DROLSKY/Git::Describe'
- version: '0.003'
+ version: '0.009'
-
class: Dist::Zilla::Plugin::Meta::Contributors
name: '@DROLSKY/Meta::Contributors'
@@ -238,11 +256,15 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@DROLSKY/MetaConfig'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@DROLSKY/MetaJSON'
- version: '5.029'
+ version: '5.031'
+ -
+ class: Dist::Zilla::Plugin::RewriteVersion
+ name: '@DROLSKY/RewriteVersion'
+ version: '0.009'
-
class: Dist::Zilla::Plugin::SurgicalPodWeaver
config:
@@ -254,61 +276,61 @@ x_Dist_Zilla:
-
class: Pod::Weaver::Plugin::EnsurePod5
name: '@CorePrep/EnsurePod5'
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Plugin::H1Nester
name: '@CorePrep/H1Nester'
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Name
name: Name
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Version
name: Version
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Region
name: prelude
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Generic
name: SYNOPSIS
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Generic
name: DESCRIPTION
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Leftovers
name: Leftovers
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Region
name: postlude
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Authors
name: Authors
- version: '4.008'
+ version: '4.010'
-
class: Pod::Weaver::Section::Contributors
name: Contributors
- version: '0.008'
+ version: '0.009'
-
class: Pod::Weaver::Section::Legal
name: Legal
- version: '4.008'
+ version: '4.010'
name: '@DROLSKY/SurgicalPodWeaver'
version: '0.0023'
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@DROLSKY/PodSyntaxTests'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::Test::CPAN::Changes
name: '@DROLSKY/Test::CPAN::Changes'
- version: '0.008'
+ version: '0.009'
-
class: Dist::Zilla::Plugin::Test::Compile
config:
@@ -331,8 +353,13 @@ x_Dist_Zilla:
config:
Dist::Zilla::Plugin::Test::EOL:
filename: xt/author/eol.t
+ finder:
+ - ':InstallModules'
+ - ':ExecFiles'
+ - ':TestFiles'
+ trailing_whitespace: '1'
name: '@DROLSKY/Test::EOL'
- version: '0.16'
+ version: '0.17'
-
class: Dist::Zilla::Plugin::Test::NoTabs
config:
@@ -343,7 +370,7 @@ x_Dist_Zilla:
- ':ExecFiles'
- ':TestFiles'
name: '@DROLSKY/Test::NoTabs'
- version: '0.09'
+ version: '0.13'
-
class: Dist::Zilla::Plugin::Test::Pod::LinkCheck
name: '@DROLSKY/Test::Pod::LinkCheck'
@@ -351,11 +378,15 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::Test::Portability
name: '@DROLSKY/Test::Portability'
- version: '2.000005'
+ version: '2.000006'
-
class: Dist::Zilla::Plugin::Test::Synopsis
name: '@DROLSKY/Test::Synopsis'
- version: '2.000005'
+ version: '2.000006'
+ -
+ class: Dist::Zilla::Plugin::Test::TidyAll
+ name: '@DROLSKY/Test::TidyAll'
+ version: '0.01'
-
class: Dist::Zilla::Plugin::Git::Check
config:
@@ -363,10 +394,10 @@ x_Dist_Zilla:
untracked_files: die
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- - README.md
- cpanfile
- - Makefile.PL
+ - README.md
- LICENSE
+ - Makefile.PL
- Build.PL
- Changes
- CONTRIBUTING.md
@@ -375,7 +406,7 @@ x_Dist_Zilla:
Dist::Zilla::Role::Git::Repo:
repo_root: .
name: '@DROLSKY/Git::Check'
- version: '2.028'
+ version: '2.029'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
@@ -385,10 +416,10 @@ x_Dist_Zilla:
time_zone: local
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- - README.md
- cpanfile
- - Makefile.PL
+ - README.md
- LICENSE
+ - Makefile.PL
- Build.PL
- Changes
- CONTRIBUTING.md
@@ -396,22 +427,22 @@ x_Dist_Zilla:
changelog: Changes
Dist::Zilla::Role::Git::Repo:
repo_root: .
- name: '@DROLSKY/Git::Commit'
- version: '2.028'
+ name: '@DROLSKY/commit generated files'
+ version: '2.029'
-
class: Dist::Zilla::Plugin::Git::Tag
config:
Dist::Zilla::Plugin::Git::Tag:
branch: ~
signed: 0
- tag: v1.09
+ tag: v1.10
tag_format: v%v
tag_message: v%v
time_zone: local
Dist::Zilla::Role::Git::Repo:
repo_root: .
name: '@DROLSKY/Git::Tag'
- version: '2.028'
+ version: '2.029'
-
class: Dist::Zilla::Plugin::Git::Push
config:
@@ -422,93 +453,93 @@ x_Dist_Zilla:
Dist::Zilla::Role::Git::Repo:
repo_root: .
name: '@DROLSKY/Git::Push'
- version: '2.028'
- -
- class: inc::MyMakeMaker
- config:
- Dist::Zilla::Role::TestRunner:
- default_jobs: 1
- name: =inc::MyMakeMaker
- version: ~
- -
- class: inc::MyInstallGuide
- name: =inc::MyInstallGuide
- version: ~
- -
- class: Dist::Zilla::Plugin::FileFinder::Filter
- name: VersionedModules
- version: '5.029'
- -
- class: Dist::Zilla::Plugin::RewriteVersion
- name: RewriteVersion
- version: '0.008'
- -
- class: Dist::Zilla::Plugin::CheckVersionIncrement
- name: CheckVersionIncrement
- version: '0.121750'
+ version: '2.029'
-
class: Dist::Zilla::Plugin::BumpVersionAfterRelease
- name: BumpVersionAfterRelease
- version: '0.008'
+ name: '@DROLSKY/BumpVersionAfterRelease'
+ version: '0.009'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
Dist::Zilla::Plugin::Git::Commit:
add_files_in: []
- commit_msg: 'increment version after release'
+ commit_msg: 'Bump version after release'
time_zone: local
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- dist.ini
- Changes
allow_dirty_match:
- - (?^u:^lib/.*\.pm$)
+ - (?^:.+)
changelog: Changes
Dist::Zilla::Role::Git::Repo:
repo_root: .
- name: 'increment version'
- version: '2.028'
+ name: '@DROLSKY/commit version bump'
+ version: '2.029'
+ -
+ class: Dist::Zilla::Plugin::Git::Push
+ config:
+ Dist::Zilla::Plugin::Git::Push:
+ push_to:
+ - origin
+ remotes_must_exist: 1
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@DROLSKY/push version bump'
+ version: '2.029'
+ -
+ class: inc::MyMakeMaker
+ config:
+ Dist::Zilla::Role::TestRunner:
+ default_jobs: 1
+ name: =inc::MyMakeMaker
+ version: ~
+ -
+ class: inc::MyInstallGuide
+ name: =inc::MyInstallGuide
+ version: ~
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
- version: '5.029'
+ version: '5.031'
-
class: Dist::Zilla::Plugin::FinderCode
name: '@DROLSKY/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
- version: '5.029'
+ version: '5.031'
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: '0'
- version: '5.029'
+ version: '5.031'
x_authority: cpan:DROLSKY
x_contributors:
+ - 'Mithun Ayachit <mayachit@amfam.com>'
- 'Olaf Alders <olaf@wundersolutions.com>'
@@ -1,6 +1,6 @@
# This Makefile.PL for File-LibMagic was generated by
# inc::MyMakeMaker <self>
-# and Dist::Zilla::Plugin::MakeMaker::Awesome 0.32.
+# and Dist::Zilla::Plugin::MakeMaker::Awesome 0.33.
# Don't edit it but the dist.ini and plugins used to construct it.
use strict;
@@ -22,9 +22,7 @@ my %WriteMakefileArgs = (
"EXE_FILES" => [],
"INC" => "-I. -Ic",
"LDFROM" => "LibMagic\$(OBJ_EXT)",
- "LIBS" => [
- "-lmagic"
- ],
+ "LIBS" => "-lmagic",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.008",
"NAME" => "File::LibMagic",
@@ -42,7 +40,8 @@ my %WriteMakefileArgs = (
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
- "Test::More" => "0.88",
+ "Test::Fatal" => 0,
+ "Test::More" => "0.96",
"lib" => 0
},
"VERSION_FROM" => "lib/File/LibMagic.pm",
@@ -54,8 +53,8 @@ my %WriteMakefileArgs = (
}
);
$WriteMakefileArgs{DEFINE} = _defines();
-unshift @{ $WriteMakefileArgs{LIBS} }, _libs();
-$WriteMakefileArgs{INC} = join q{ }, _includes(), $WriteMakefileArgs{INC};
+$WriteMakefileArgs{INC} = join q{ }, _includes(), $WriteMakefileArgs{INC};
+$WriteMakefileArgs{LIBS} = join q{ }, _libs(), $WriteMakefileArgs{LIBS};
my %FallbackPrereqs = (
"Carp" => 0,
@@ -64,7 +63,8 @@ my %FallbackPrereqs = (
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
- "Test::More" => "0.88",
+ "Test::Fatal" => 0,
+ "Test::More" => "0.96",
"XSLoader" => 0,
"base" => 0,
"lib" => 0,
@@ -90,8 +90,8 @@ use Getopt::Long;
my @libs;
my @includes;
-sub _libs { return @libs }
-sub _includes { return @includes }
+sub _libs { return map { '-L' . $_ } @libs }
+sub _includes { return map { '-I' . $_ } @includes }
sub _defines {
GetOptions(
@@ -100,8 +100,8 @@ sub _defines {
);
my $ac = Config::AutoConf->new(
- extra_link_flags => [ map { '-L' . $_ } @libs ],
- extra_include_flags => [ map { '-I' . $_ } @includes ],
+ extra_link_flags => [ _libs() ],
+ extra_include_dirs => [ _includes() ],
);
_check_libmagic($ac);
@@ -1,266 +1,277 @@
-# NAME
+NAME
-File::LibMagic - Determine MIME types of data or files using libmagic
+ File::LibMagic - Determine MIME types of data or files using libmagic
-# VERSION
+VERSION
-version 1.09
+ version 1.10
-# SYNOPSIS
+SYNOPSIS
- use File::LibMagic;
+ use File::LibMagic;
+
+ my $magic = File::LibMagic->new();
+
+ my $info = $magic->info_from_filename('path/to/file');
+ # Prints a description like "ASCII text"
+ print $info->{description};
+ # Prints a MIME type like "text/plain"
+ print $info->{mime_type};
+ # Prints a character encoding like "us-ascii"
+ print $info->{encoding};
+ # Prints a MIME type with encoding like "text/plain; charset=us-ascii"
+ print $info->{mime_with_encoding};
+
+ my $file_content = read_file('path/to/file');
+ $info = $magic->info_from_string($file_content);
+
+ open my $fh, '<', 'path/to/file' or die $!;
+ $info = $magic->info_from_handle($fh);
- my $magic = File::LibMagic->new();
+DESCRIPTION
- my $info = $magic->info_from_filename('path/to/file');
- # Prints a description like "ASCII text"
- print $info->{description};
- # Prints a MIME type like "text/plain"
- print $info->{mime_type};
- # Prints a character encoding like "us-ascii"
- print $info->{encoding};
- # Prints a MIME type with encoding like "text/plain; charset=us-ascii"
- print $info->{mime_with_encoding};
+ The File::LibMagic is a simple perl interface to libmagic from the file
+ package (version 4.x or 5.x). You will need both the library
+ (libmagic.so) and the header file (magic.h) to build this Perl module.
- my $file_content = read_file('path/to/file');
- $info = $magic->info_from_string($file_content);
+ Installing libmagic
- open my $fh, '<', 'path/to/file' or die $!;
- $info = $magic->info_from_handle($fh);
+ On Debian/Ubuntu run:
-# DESCRIPTION
+ sudo apt-get install libmagic-dev
-The `File::LibMagic` is a simple perl interface to libmagic from the file
-package (version 4.x or 5.x). You will need both the library (`libmagic.so`)
-and the header file (`magic.h`) to build this Perl module.
+ On Mac you can use homebrew (http://brew.sh/):
-## Installing libmagic
+ brew install libmagic
-On Debian/Ubuntu run:
+ Specifying lib and/or include directories
- sudo apt-get install libmagic-dev
+ On some systems, you may need to pass additional lib and include
+ directories to the Makefile.PL. You can do this with the `--lib` and
+ `--include` parameters:
-On Mac you can use homebrew (http://brew.sh/):
+ perl Makefile.PL --lib /usr/local/include --include /usr/local/include
- brew install libmagic
+ You can pass these parameters multiple times to specify more than one
+ location.
-## Specifying lib and/or include directories
+API
-On some systems, you may need to pass additional lib and include directories
-to the Makefile.PL. You can do this with the \`--lib\` and \`--include\`
-parameters:
+ This module provides an object-oriented API with the following methods:
- perl Makefile.PL --lib /usr/local/include --include /usr/local/include
+ File::LibMagic->new()
-You can pass these parameters multiple times to specify more than one
-location.
+ Creates a new File::LibMagic object.
-# API
+ Using the object oriented interface only opens the magic database once,
+ which is probably most efficient for repeated uses.
-This module provides an object-oriented API with the following methods:
+ Each File::LibMagic object loads the magic database independently of
+ other File::LibMagic objects, so you may want to share a single object
+ across many modules.
-## File::LibMagic->new()
+ This method takes an optional argument containing a path to the magic
+ file. If the file doesn't exist this will throw an exception (but only
+ with libmagic 4.17+).
-Creates a new File::LibMagic object.
+ If you don't pass an argument, it will throw an exception if it can't
+ find any magic files at all.
-Using the object oriented interface only opens the magic database once, which
-is probably most efficient for repeated uses.
+ $magic->info_from_filename('path/to/file')
-Each `File::LibMagic` object loads the magic database independently of other
-`File::LibMagic` objects, so you may want to share a single object across
-many modules.
+ This method returns info about the given file. The return value is a
+ hash reference with four keys:
-This method takes an optional argument containing a path to the magic file. If
-the file doesn't exist this will throw an exception (but only with libmagic
-4.17+).
+ * description
-If you don't pass an argument, it will throw an exception if it can't find any
-magic files at all.
+ A textual description of the file content like "ASCII C program
+ text".
-## $magic->info\_from\_filename('path/to/file')
+ * mime_type
-This method returns info about the given file. The return value is a hash
-reference with four keys:
+ The MIME type without a character encoding, like "text/x-c".
-- description
+ * encoding
- A textual description of the file content like "ASCII C program text".
+ Just the character encoding, like "us-ascii".
-- mime\_type
+ * mime_with_encoding
- The MIME type without a character encoding, like "text/x-c".
+ The MIME type with a character encoding, like "text/x-c;
+ charset=us-ascii". Note that if no encoding was found, this will be
+ the same as the mime_type key.
-- encoding
+ $magic->info_from_string($string)
- Just the character encoding, like "us-ascii".
+ This method returns info about the given string. The string can be
+ passed as a reference to save memory.
-- mime\_with\_encoding
+ The return value is the same as that of $mime->info_from_filename().
- The MIME type with a character encoding, like "text/x-c;
- charset=us-ascii". Note that if no encoding was found, this will be the same
- as the `mime_type` key.
+ $magic->info_from_handle($fh)
-## $magic->info\_from\_string($string)
+ This method returns info about the given filehandle. It will read data
+ starting from the handle's current position, and leave the handle at
+ that same position after reading.
-This method returns info about the given string. The string can be passed as a
-reference to save memory.
+DEPRECATED APIS
-The return value is the same as that of `$mime->info_from_filename()`.
+ This module offers two different procedural APIs based on optional
+ exports, the "easy" and "complete" interfaces. There is also an older
+ OO API still available. All of these APIs are deprecated, but will not
+ be removed in the near future, nor will using them cause any warnings.
-## $magic->info\_from\_handle($fh)
+ I strongly recommend you use the new OO API. It's simpler than the
+ complete interface, more efficient than the easy interface, and more
+ featureful than the old OO API.
-This method returns info about the given filehandle. It will read data
-starting from the handle's current position, and leave the handle at that same
-position after reading.
+ The Old OO API
-# DEPRECATED APIS
+ This API uses the same constructor as the current API.
-This module offers two different procedural APIs based on optional exports,
-the "easy" and "complete" interfaces. There is also an older OO API still
-available. All of these APIs are deprecated, but will not be removed in the
-near future, nor will using them cause any warnings.
+ * $magic->checktype_contents($data)
-I strongly recommend you use the new OO API. It's simpler than the complete
-interface, more efficient than the easy interface, and more featureful than
-the old OO API.
+ Returns the MIME type of the data given as the first argument. The
+ data can be passed as a plain scalar or as a reference to a scalar.
-## The Old OO API
+ This is the same value as would be returned by the file command with
+ the -i switch.
-This API uses the same constructor as the current API.
+ * $magic->checktype_filename($filename)
-- $magic->checktype\_contents($data)
+ Returns the MIME type of the given file.
- Returns the MIME type of the data given as the first argument. The data can be
- passed as a plain scalar or as a reference to a scalar.
+ This is the same value as would be returned by the file command with
+ the -i switch.
- This is the same value as would be returned by the `file` command with the
- `-i` switch.
+ * $magic->describe_contents($data)
-- $magic->checktype\_filename($filename)
+ Returns a description (as a string) of the data given as the first
+ argument. The data can be passed as a plain scalar or as a reference
+ to a scalar.
- Returns the MIME type of the given file.
+ This is the same value as would be returned by the file command with
+ no switches.
- This is the same value as would be returned by the `file` command with the
- `-i` switch.
+ * $magic->describe_filename($filename)
-- $magic->describe\_contents($data)
+ Returns a description (as a string) of the given file.
- Returns a description (as a string) of the data given as the first argument.
- The data can be passed as a plain scalar or as a reference to a scalar.
+ This is the same value as would be returned by the file command with
+ no switches.
- This is the same value as would be returned by the `file` command with no
- switches.
+ The "easy" interface
-- $magic->describe\_filename($filename)
+ This interface is exported by:
- Returns a description (as a string) of the given file.
+ use File::LibMagic ':easy';
- This is the same value as would be returned by the `file` command with no
- switches.
+ This interface exports two subroutines:
-## The "easy" interface
+ * MagicBuffer($data)
-This interface is exported by:
+ Returns the description of a chunk of data, just like the
+ describe_contents method.
- use File::LibMagic ':easy';
+ * MagicFile($filename)
-This interface exports two subroutines:
+ Returns the description of a file, just like the describe_filename
+ method.
-- MagicBuffer($data)
+ The "complete" interface
- Returns the description of a chunk of data, just like the `describe_contents`
- method.
+ This interface is exported by:
-- MagicFile($filename)
+ use File::LibMagic ':complete';
- Returns the description of a file, just like the `describe_filename` method.
+ This interface exports several subroutines:
-## The "complete" interface
+ * magic_open($flags)
-This interface is exported by:
+ This subroutine opens creates a magic handle. See the libmagic man
+ page for a description of all the flags. These are exported by the
+ :complete import.
- use File::LibMagic ':complete';
+ my $handle = magic_open(MAGIC_MIME);
-This interface exports several subroutines:
+ * magic_load($handle, $filename)
-- magic\_open($flags)
+ This subroutine actually loads the magic file. The $filename argument
+ is optional. There should be a sane default compiled into your
+ libmagic library.
- This subroutine opens creates a magic handle. See the libmagic man page for a
- description of all the flags. These are exported by the `:complete` import.
+ * magic_buffer($handle, $data)
- my $handle = magic_open(MAGIC_MIME);
+ This returns information about a chunk of data as a string. What it
+ returns depends on the flags you passed to magic_open, a description,
+ a MIME type, etc.
-- magic\_load($handle, $filename)
+ * magic_file($handle, $filename)
- This subroutine actually loads the magic file. The `$filename` argument is
- optional. There should be a sane default compiled into your `libmagic`
- library.
+ This returns information about a file as a string. What it returns
+ depends on the flags you passed to magic_open, a description, a MIME
+ type, etc.
-- magic\_buffer($handle, $data)
+ * magic_close($handle)
- This returns information about a chunk of data as a string. What it returns
- depends on the flags you passed to `magic_open`, a description, a MIME type,
- etc.
+ Closes the magic handle.
-- magic\_file($handle, $filename)
+EXCEPTIONS
- This returns information about a file as a string. What it returns depends on
- the flags you passed to `magic_open`, a description, a MIME type, etc.
+ This module can throw an exception if your system runs out of memory
+ when trying to call magic_open internally.
-- magic\_close($handle)
+SUPPORT
- Closes the magic handle.
+ Please submit bugs to the CPAN RT system at
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-LibMagic or via email at
+ bug-file-libmagic@rt.cpan.org.
-# EXCEPTIONS
+BUGS
-This module can throw an exception if your system runs out of memory when
-trying to call `magic_open` internally.
+ This module is totally dependent on the version of file on your system.
+ It's possible that the tests will fail because of this. Please report
+ these failures so I can make the tests smarter. Please make sure to
+ report the version of file on your system as well!
-# SUPPORT
+DEPENDENCIES/PREREQUISITES
-Please submit bugs to the CPAN RT system at
-http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-LibMagic or via email at
-bug-file-libmagic@rt.cpan.org.
+ This module requires file 4.x or file 5x and the associated libmagic
+ library and headers (http://darwinsys.com/file/).
-# BUGS
+RELATED MODULES
-This module is totally dependent on the version of file on your system. It's
-possible that the tests will fail because of this. Please report these
-failures so I can make the tests smarter. Please make sure to report the
-version of file on your system as well!
+ Andreas created File::LibMagic because he wanted to use libmagic (from
+ file 4.x) File::MMagic only worked with file 3.x.
-# DEPENDENCIES/PREREQUISITES
+ File::MimeInfo::Magic uses the magic file from freedesktop.org which is
+ encoded in XML, and is thus not the fastest approach. See
+ http://mail.gnome.org/archives/nautilus-list/2003-December/msg00260.htm
+ l for a discussion of this issue.
-This module requires file 4.x or file 5x and the associated libmagic library
-and headers (http://darwinsys.com/file/).
+ File::Type uses a relatively small magic file, which is directly hacked
+ into the module code. It is quite fast but the database is quite small
+ relative to the file package.
-# RELATED MODULES
+AUTHORS
-Andreas created File::LibMagic because he wanted to use libmagic (from
-file 4.x) [File::MMagic](https://metacpan.org/pod/File::MMagic) only worked with file 3.x.
+ * Andreas Fitzner
-[File::MimeInfo::Magic](https://metacpan.org/pod/File::MimeInfo::Magic) uses the magic file from freedesktop.org which is
-encoded in XML, and is thus not the fastest approach. See
-[http://mail.gnome.org/archives/nautilus-list/2003-December/msg00260.html](http://mail.gnome.org/archives/nautilus-list/2003-December/msg00260.html)
-for a discussion of this issue.
+ * Michael Hendricks <michael@ndrix.org>
-File::Type uses a relatively small magic file, which is directly hacked into
-the module code. It is quite fast but the database is quite small relative to
-the file package.
+ * Dave Rolsky <autarch@urth.org>
-# AUTHORS
+CONTRIBUTORS
-- Andreas Fitzner
-- Michael Hendricks <michael@ndrix.org>
-- Dave Rolsky <autarch@urth.org>
+ * Mithun Ayachit <mayachit@amfam.com>
-# CONTRIBUTOR
+ * Olaf Alders <olaf@wundersolutions.com>
-Olaf Alders <olaf@wundersolutions.com>
+COPYRIGHT AND LICENSE
-# COPYRIGHT AND LICENSE
+ This software is copyright (c) 2015 by Andreas Fitzner, Michael
+ Hendricks, and Dave Rolsky.
-This software is copyright (c) 2014 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
@@ -11,7 +11,8 @@ on 'test' => sub {
requires "File::Spec" => "0";
requires "IO::Handle" => "0";
requires "IPC::Open3" => "0";
- requires "Test::More" => "0.88";
+ requires "Test::Fatal" => "0";
+ requires "Test::More" => "0.96";
requires "lib" => "0";
};
@@ -24,8 +25,12 @@ on 'configure' => sub {
};
on 'develop' => sub {
+ requires "Code::TidyAll" => "0.24";
+ requires "Perl::Critic" => "1.123";
+ requires "Perl::Tidy" => "20140711";
requires "Pod::Coverage::TrustPod" => "0";
requires "Test::CPAN::Changes" => "0.19";
+ requires "Test::Code::TidyAll" => "0.24";
requires "Test::EOL" => "0";
requires "Test::More" => "0.88";
requires "Test::NoTabs" => "0";
@@ -33,4 +38,5 @@ on 'develop' => sub {
requires "Test::Pod::Coverage" => "1.08";
requires "Test::Spelling" => "0.12";
requires "Test::Synopsis" => "0";
+ requires "Test::Version" => "1";
};
@@ -22,24 +22,8 @@ stopwords = homebrew
stopwords = libmagic
-remove = InstallGuide
-remove = MakeMaker
--remove = PkgVersion
-remove = Test::Pod::No404s
;authordep Dist::Zilla::Plugin::MakeMaker::Awesome
[=inc::MyMakeMaker]
[=inc::MyInstallGuide]
-
-[FileFinder::Filter / VersionedModules]
-finder = :InstallModules
-
-[RewriteVersion]
-finder = VersionedModules
-
-[CheckVersionIncrement]
-
-[BumpVersionAfterRelease]
-finder = VersionedModules
-
-[Git::Commit / increment version]
-allow_dirty_match = ^lib/.*\.pm$
-commit_msg = increment version after release
@@ -6,8 +6,7 @@ use Moose::Autobox;
use namespace::autoclean;
-with 'Dist::Zilla::Role::FileGatherer';
-with 'Dist::Zilla::Role::TextTemplate';
+with 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::TextTemplate';
my $content = <<'EOF';
# Installing File-LibMagic
@@ -84,7 +83,7 @@ sub gather_files {
$self->add_file(
Dist::Zilla::File::FromCode->new(
name => 'INSTALL.md',
- code => sub { $content },
+ code => sub {$content},
)
);
@@ -13,7 +13,7 @@ override _build_WriteMakefile_args => sub {
my $args = super();
- $args->{LIBS} = ['-lmagic'];
+ $args->{LIBS} = '-lmagic';
$args->{INC} = '-I. -Ic';
$args->{XS} = { 'lib/File/LibMagic.xs' => 'lib/File/LibMagic.c' };
$args->{C} = ['lib/File/LibMagic.c'];
@@ -32,8 +32,8 @@ override _build_WriteMakefile_dump => sub {
my $dump = super();
$dump .= <<'EOF';
$WriteMakefileArgs{DEFINE} = _defines();
-unshift @{ $WriteMakefileArgs{LIBS} }, _libs();
-$WriteMakefileArgs{INC} = join q{ }, _includes(), $WriteMakefileArgs{INC};
+$WriteMakefileArgs{INC} = join q{ }, _includes(), $WriteMakefileArgs{INC};
+$WriteMakefileArgs{LIBS} = join q{ }, _libs(), $WriteMakefileArgs{LIBS};
EOF
@@ -41,7 +41,7 @@ EOF
};
override _build_MakeFile_PL_template => sub {
- return super() . do { local $/; <DATA> };
+ return super() . do { local $/ = undef; <DATA> };
};
__PACKAGE__->meta->make_immutable;
@@ -57,8 +57,8 @@ use Getopt::Long;
my @libs;
my @includes;
-sub _libs { return @libs }
-sub _includes { return @includes }
+sub _libs { return map { '-L' . $_ } @libs }
+sub _includes { return map { '-I' . $_ } @includes }
sub _defines {
GetOptions(
@@ -67,8 +67,8 @@ sub _defines {
);
my $ac = Config::AutoConf->new(
- extra_link_flags => [ map { '-L' . $_ } @libs ],
- extra_include_flags => [ map { '-I' . $_ } @includes ],
+ extra_link_flags => [ _libs() ],
+ extra_include_dirs => [ _includes() ],
);
_check_libmagic($ac);
@@ -9,7 +9,7 @@ use Carp;
use Exporter;
use XSLoader;
-our $VERSION = '1.09';
+our $VERSION = '1.10';
XSLoader::load( __PACKAGE__, $VERSION );
@@ -35,10 +35,12 @@ for my $name (@Constants) {
croak "WTF defining $name - $error"
if defined $error;
- my $sub = sub { $value };
+ my $sub = sub {$value};
+ ## no critic (TestingAndDebugging::ProhibitNoStrict)
no strict 'refs';
*{$name} = $sub;
+ ## use critic
}
our %EXPORT_TAGS = (
@@ -56,8 +58,7 @@ our %EXPORT_TAGS = (
]
);
-$EXPORT_TAGS{"all"}
- = [ @{ $EXPORT_TAGS{"easy"} }, @{ $EXPORT_TAGS{"complete"} } ];
+$EXPORT_TAGS{all} = [ @{ $EXPORT_TAGS{easy} }, @{ $EXPORT_TAGS{complete} } ];
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@@ -155,7 +156,7 @@ File::LibMagic - Determine MIME types of data or files using libmagic
=head1 VERSION
-version 1.09
+version 1.10
=head1 SYNOPSIS
@@ -433,15 +434,25 @@ Dave Rolsky <autarch@urth.org>
=back
-=head1 CONTRIBUTOR
+=head1 CONTRIBUTORS
-=for stopwords Olaf Alders
+=for stopwords Mithun Ayachit Olaf Alders
+
+=over 4
+
+=item *
+
+Mithun Ayachit <mayachit@amfam.com>
+
+=item *
Olaf Alders <olaf@wundersolutions.com>
+=back
+
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
+This software is copyright (c) 2015 by Andreas Fitzner, Michael Hendricks, and Dave Rolsky.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -0,0 +1,58 @@
+severity = 3
+verbose = 11
+theme = core + pbp + bugs + maintenance + cosmetic + complexity + security + tests + moose
+
+exclude = Subroutines::ProhibitCallsToUndeclaredSubs
+
+[BuiltinFunctions::ProhibitStringySplit]
+severity = 3
+
+[CodeLayout::RequireTrailingCommas]
+severity = 3
+
+[ControlStructures::ProhibitCStyleForLoops]
+severity = 3
+
+[InputOutput::RequireCheckedSyscalls]
+functions = :builtins
+exclude_functions = sleep
+severity = 3
+
+[RegularExpressions::ProhibitComplexRegexes]
+max_characters = 200
+
+[RegularExpressions::ProhibitUnusualDelimiters]
+severity = 3
+
+[Subroutines::ProhibitUnusedPrivateSubroutines]
+private_name_regex = _(?!build)\w+
+
+[TestingAndDebugging::ProhibitNoWarnings]
+allow = redefine
+
+[ValuesAndExpressions::ProhibitEmptyQuotes]
+severity = 3
+
+[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
+severity = 3
+
+[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
+severity = 3
+
+[Variables::ProhibitPackageVars]
+add_packages = Carp Test::Builder
+
+[-Subroutines::RequireFinalReturn]
+
+[-ErrorHandling::RequireCarping]
+
+# No need for /xsm everywhere
+[-RegularExpressions::RequireDotMatchAnything]
+[-RegularExpressions::RequireExtendedFormatting]
+[-RegularExpressions::RequireLineBoundaryMatching]
+
+# http://stackoverflow.com/questions/2275317/why-does-perlcritic-dislike-using-shift-to-populate-subroutine-variables
+[-Subroutines::RequireArgUnpacking]
+
+# "use v5.14" is more readable than "use 5.014"
+[-ValuesAndExpressions::ProhibitVersionStrings]
@@ -0,0 +1,20 @@
+-l=78
+-i=4
+-ci=4
+-se
+-b
+-bar
+-boc
+-vt=0
+-vtc=0
+-cti=0
+-pt=1
+-bt=1
+-sbt=1
+-bbt=1
+-nolq
+-npro
+-nsfs
+--opening-hash-brace-right
+--no-outdent-long-comments
+-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
@@ -6,15 +6,20 @@ do { my $x = {
},
'develop' => {
'requires' => {
+ 'Code::TidyAll' => '0.24',
+ 'Perl::Critic' => '1.123',
+ 'Perl::Tidy' => '20140711',
'Pod::Coverage::TrustPod' => '0',
'Test::CPAN::Changes' => '0.19',
+ 'Test::Code::TidyAll' => '0.24',
'Test::EOL' => '0',
'Test::More' => '0.88',
'Test::NoTabs' => '0',
'Test::Pod' => '1.41',
'Test::Pod::Coverage' => '1.08',
'Test::Spelling' => '0.12',
- 'Test::Synopsis' => '0'
+ 'Test::Synopsis' => '0',
+ 'Test::Version' => '1'
}
},
'runtime' => {
@@ -37,7 +42,8 @@ do { my $x = {
'File::Spec' => '0',
'IO::Handle' => '0',
'IPC::Open3' => '0',
- 'Test::More' => '0.88',
+ 'Test::Fatal' => '0',
+ 'Test::More' => '0.96',
'lib' => '0'
}
}
@@ -3,7 +3,7 @@
use strict;
use warnings;
-# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.019
+# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.020
use Test::More tests => 1;
@@ -150,9 +150,16 @@ for my $phase ( qw(configure build test runtime develop other) ) {
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
- splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
- push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
+ if ($type eq 'modules') {
+ splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
+ push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
+ }
+ else {
+ splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
+ push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
+ }
+
push @full_reports, "\n";
}
}
@@ -3,32 +3,24 @@ use warnings;
use lib 't/lib';
-use Test::AnyOf;
+use Test::Exports qw( test_complete test_easy );
use Test::More 0.88;
-use File::LibMagic qw( :all );
+{
-# subs from :easy
-is( MagicBuffer("Hello World\n"), 'ASCII text' );
+ package Test::AllExports;
-is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
-is_any_of(
- MagicFile('t/samples/foo.c'),
- [ 'ASCII C program text', 'C source, ASCII text' ]
-);
-
-# subs from :complete
-my $handle = magic_open(MAGIC_NONE);
-magic_load( $handle, q{} );
-is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
+ use File::LibMagic qw( :all );
+}
-is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
-
-is_any_of(
- magic_file( $handle, 't/samples/foo.c' ),
- [ 'ASCII C program text', 'C source, ASCII text' ]
+subtest(
+ 'complete API exported by :all',
+ sub { test_complete('Test::AllExports') }
);
-magic_close($handle);
+subtest(
+ 'easy API exported by :all',
+ sub { test_easy('Test::AllExports') }
+);
done_testing();
@@ -8,9 +8,42 @@ BEGIN {
use strict;
use warnings;
-use Test::More;
-# generated by Dist::Zilla::Plugin::Test::EOL 0.16
+# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.17
+
+use Test::More 0.88;
use Test::EOL;
-all_perl_files_ok({ trailing_whitespace => 1 });
+my @files = (
+ 'lib/File/LibMagic.pm',
+ 't/00-compile.t',
+ 't/00-report-prereqs.dd',
+ 't/00-report-prereqs.t',
+ 't/all-exports.t',
+ 't/author-eol.t',
+ 't/author-no-tabs.t',
+ 't/author-pod-spell.t',
+ 't/complete-interface-errors.t',
+ 't/complete-interface.t',
+ 't/easy-interface.t',
+ 't/lib/Test/AnyOf.pm',
+ 't/lib/Test/Exports.pm',
+ 't/oo-api.t',
+ 't/release-cpan-changes.t',
+ 't/release-pod-coverage.t',
+ 't/release-pod-linkcheck.t',
+ 't/release-pod-syntax.t',
+ 't/release-portability.t',
+ 't/release-synopsis.t',
+ 't/release-test-version.t',
+ 't/release-tidyall.t',
+ 't/samples/foo.c',
+ 't/samples/foo.foo',
+ 't/samples/foo.txt',
+ 't/samples/magic',
+ 't/samples/magic.mime',
+ 't/version.t'
+);
+
+eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
+done_testing;
@@ -9,7 +9,7 @@ BEGIN {
use strict;
use warnings;
-# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.09
+# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.13
use Test::More 0.88;
use Test::NoTabs;
@@ -23,11 +23,11 @@ my @files = (
't/author-eol.t',
't/author-no-tabs.t',
't/author-pod-spell.t',
- 't/basic.t',
't/complete-interface-errors.t',
't/complete-interface.t',
't/easy-interface.t',
't/lib/Test/AnyOf.pm',
+ 't/lib/Test/Exports.pm',
't/oo-api.t',
't/release-cpan-changes.t',
't/release-pod-coverage.t',
@@ -35,6 +35,8 @@ my @files = (
't/release-pod-syntax.t',
't/release-portability.t',
't/release-synopsis.t',
+ 't/release-test-version.t',
+ 't/release-tidyall.t',
't/samples/foo.c',
't/samples/foo.foo',
't/samples/foo.txt',
@@ -39,6 +39,9 @@ michael
Dave
autarch
and
+Mithun
+Ayachit
+mayachit
Olaf
Alders
olaf
@@ -1,10 +0,0 @@
-use strict;
-use warnings;
-
-use Test::More 0.88;
-
-use File::LibMagic;
-
-ok( File::LibMagic::MagicBuffer("Hello World\n") eq "ASCII text" );
-
-done_testing();
@@ -1,27 +1,27 @@
use strict;
use warnings;
+use Test::Fatal;
use Test::More 0.88;
use File::LibMagic qw( :complete );
# TODO can we simulate an out-of-memory error?
-# try to use a missing magic file
+## no critic (TestingAndDebugging::ProhibitNoWarnings)
+
{
my $h = magic_open(MAGIC_NONE);
{
no warnings 'uninitialized';
- eval { magic_load( undef, 't/samples/magic' ) };
like(
- $@, qr{magic_load requires a defined handle},
- 'magic_load(undef)'
+ exception { magic_load( undef, 't/samples/magic' ) },
+ qr{magic_load requires a defined handle},
+ 'magic_load error when not given a handle'
);
}
- eval { magic_load( $h, 't/samples/missing' ) };
- # like( $@, qr{libmagic could not find any magic files}, 'missing magic file' );
magic_close($h);
}
@@ -29,49 +29,57 @@ use File::LibMagic qw( :complete );
my $h = magic_open(MAGIC_NONE);
magic_load( $h, 't/samples/magic' );
- # try to get information about an undef buffer
{
no warnings 'uninitialized';
- eval { magic_buffer( undef, "Foo" ) };
like(
- $@, qr{magic_buffer requires a defined handle},
- 'magic_buffer(undef)'
+ exception { magic_buffer( undef, 'foo' ) },
+ qr{magic_buffer requires a defined handle},
+ 'magic_buffer error when not given a handle'
);
}
- eval { magic_buffer( $h, undef ) };
like(
- $@, qr{magic_buffer requires defined content},
- 'magic_buffer no content'
+ exception { magic_buffer( $h, undef ) },
+ qr{magic_buffer requires defined content},
+ 'magic_buffer error with undef as content'
);
- # try to get information about a missing file
{
no warnings 'uninitialized';
- eval { magic_file( undef, 't/samples/foo.foo' ) };
like(
- $@, qr{magic_file requires a defined handle},
- 'magic_file(undef)'
+ exception { magic_file( undef, 't/samples/foo.foo' ) },
+ qr{magic_file requires a defined handle},
+ 'magic_file error when not given a handle'
);
}
- eval { magic_file( $h, undef ) };
- like( $@, qr{magic_file requires a filename}, 'magic_file no file' );
+ like(
+ exception { magic_file( $h, undef ) },
+ qr{magic_file requires a filename},
+ 'magic_file error when given undef as a file'
+ );
TODO: {
local $TODO = 'check libmagic version';
- eval { magic_file( $h, 't/samples/missing' ) };
- like( $@, qr{libmagic cannot open .+ at }, 'missing file' );
- magic_close($h);
+ like(
+ exception { magic_file( $h, 't/samples/missing' ) },
+ qr{libmagic cannot open .+ at },
+ 'magic_file error when given a non-existent file (depends on libmagic version)'
+ );
}
+
+ magic_close($h);
}
-# try calling magic_close with undef handle
{
no warnings 'uninitialized';
my $h = magic_open(MAGIC_NONE);
- eval { magic_close(undef) };
- like( $@, qr{magic_close requires a defined handle} );
+
+ like(
+ exception { magic_close(undef) },
+ qr{magic_close requires a defined handle},
+ 'magic_close error when not given a handle'
+ );
}
done_testing();
@@ -3,78 +3,16 @@ use warnings;
use lib 't/lib';
-use Test::AnyOf;
-use Test::More 0.88;
+use Test::Exports qw( test_complete );
+use Test::More 0.96;
-use File::LibMagic qw( :complete );
-
-# check for constants
-my $fail = 0;
-my @names = qw(
- MAGIC_CHECK MAGIC_COMPRESS MAGIC_CONTINUE MAGIC_DEBUG MAGIC_DEVICES
- MAGIC_ERROR MAGIC_MIME MAGIC_NONE MAGIC_PRESERVE_ATIME MAGIC_RAW
- MAGIC_SYMLINK
-);
-foreach my $constname (@names) {
- next if ( eval "my \$a = $constname; 1" );
- if ( $@ =~ /^Your vendor has not defined constants macro $constname/ ) {
- diag "pass: $@";
- }
- else {
- diag "fail: $@";
- $fail = 1;
- }
-
-}
-ok( $fail == 0, 'Constants' );
-
-# try loading a non-standard magic file
{
- my $handle = magic_open(MAGIC_NONE);
- magic_load( $handle, 't/samples/magic' );
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
- is( magic_buffer( $handle, "Footastic\n" ), 'A foo file' );
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
- is_any_of(
- magic_file( $handle, 't/samples/foo.c' ),
- [ 'ASCII text', 'ASCII C program text', 'C source, ASCII text' ]
- );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'A foo file' );
+ package Test::Complete;
- magic_close($handle);
+ use File::LibMagic qw( :complete );
}
-# test the traditional empty string for magic_load
-{
- my $handle = magic_open(MAGIC_NONE);
- magic_load( $handle, q{} );
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
- is_any_of(
- magic_file( $handle, 't/samples/foo.c' ),
- [ 'ASCII C program text', 'C source, ASCII text' ]
- );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
-
- magic_close($handle);
-}
-
-# test undef as the filename for magic_load
-{
- my $handle = magic_open(MAGIC_NONE);
- magic_load( $handle, undef );
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
- is_any_of(
- magic_file( $handle, 't/samples/foo.c' ),
- [ 'ASCII C program text', 'C source, ASCII text' ]
- );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
-
- magic_close($handle);
-}
+test_complete('Test::Complete');
done_testing();
@@ -3,29 +3,16 @@ use warnings;
use lib 't/lib';
-use Test::AnyOf;
-use Test::More 0.88;
+use Test::Exports qw( test_easy );
+use Test::More 0.96;
-use File::LibMagic qw( :easy );
+{
-is( MagicBuffer("Hello World\n"), 'ASCII text' );
-is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
-is_any_of(
- MagicFile('t/samples/foo.c'),
- [ 'ASCII C program text', 'C source, ASCII text' ]
-);
+ package Test::Easy;
-# check the error handling
-eval { MagicBuffer(undef) };
-like( $@, qr{MagicBuffer requires defined content}, 'MagicBuffer(undef)' );
-
-eval { MagicFile(undef) };
-like( $@, qr{MagicFile requires a filename}, 'MagicFile(undef)' );
-
-TODO: {
- local $TODO = 'check libmagic version';
- eval { MagicFile('t/samples/missing') };
- like( $@, qr{libmagic cannot open .+ at .+}, 'MagicFile: missing file' );
+ use File::LibMagic qw( :easy );
}
+test_easy('Test::Easy');
+
done_testing();
@@ -7,10 +7,13 @@ use Exporter;
use base 'Exporter';
+## no critic (Modules::ProhibitAutomaticExportation)
our @EXPORT = qw( is_any_of );
+## use critic
use Test::More;
+## no critic (Subroutines::ProhibitSubroutinePrototypes)
sub is_any_of ($$;$) {
my $got = shift;
my $expect = shift;
@@ -29,13 +32,13 @@ sub is_any_of ($$;$) {
got: $got
expected: any one of ...
EOF
- $diag .= join "\n", map { " $_"} @{$expect};
+ $diag .= join "\n", map {" $_"} @{$expect};
$tb->diag($diag);
}
return $match;
}
+## use critic
1;
-
@@ -0,0 +1,175 @@
+package Test::Exports;
+
+use strict;
+use warnings;
+
+use Test::AnyOf;
+use Test::Fatal;
+use Test::More 0.96;
+
+use Exporter qw( import );
+
+our @EXPORT_OK = qw( test_complete test_easy );
+
+sub test_complete {
+ my $package = shift;
+
+ subtest(
+ 'constants',
+ sub { _test_constants($package) }
+ );
+
+ subtest(
+ 'custom magic file',
+ sub { _test_complete_with_handle( $package, 't/samples/magic' ) }
+ );
+ subtest(
+ 'empty string for magic file name',
+ sub { _test_complete_with_handle( $package, q{} ) }
+ );
+ subtest(
+ 'undef for magic file name',
+ sub { _test_complete_with_handle( $package, undef ) }
+ );
+}
+
+sub _test_constants {
+ my $package = shift;
+
+ my @constants = qw(
+ MAGIC_CHECK
+ MAGIC_COMPRESS
+ MAGIC_CONTINUE
+ MAGIC_DEBUG
+ MAGIC_DEVICES
+ MAGIC_ERROR
+ MAGIC_MIME
+ MAGIC_NONE
+ MAGIC_PRESERVE_ATIME
+ MAGIC_RAW
+ MAGIC_SYMLINK
+ );
+
+ foreach my $const (@constants) {
+ ## no critic (Variables::RequireInitializationForLocalVars)
+ local $@;
+ ## no critic (BuiltinFunctions::ProhibitStringyEval)
+ my $ok = eval "${package}::$const() || 1";
+ ## use critic
+
+ if ($ok) {
+ pass("$const is exported by :complete");
+ next;
+ }
+
+ if ( $@ =~ /^Your vendor has not defined constants macro \Q$const/ ) {
+ pass("$const is not defined for this version of libmagic");
+ }
+ else {
+ fail("unexpected error for $const");
+ diag($@);
+ }
+ }
+}
+
+sub _test_complete_with_handle {
+ my $package = shift;
+ my $custom_file = shift;
+
+ my $handle
+ = $package->can('magic_open')->( $package->can('MAGIC_NONE')->() );
+ $package->can('magic_load')->( $handle, $custom_file );
+
+ my $magic_buffer = $package->can('magic_buffer');
+ my $magic_file = $package->can('magic_file');
+
+ is(
+ $magic_buffer->( $handle, "Hello World\n" ),
+ 'ASCII text',
+ 'magic_buffer on ASCII text'
+ );
+
+ if ($custom_file) {
+ is(
+ $magic_buffer->( $handle, "Footastic\n" ),
+ 'A foo file',
+ 'magic_file on foo text (with custom magic)'
+ );
+ is(
+ $magic_file->( $handle, 't/samples/foo.foo' ),
+ 'A foo file',
+ 'magic_file on foo file (with custom magic)'
+ );
+ }
+ else {
+ is(
+ $magic_file->( $handle, 't/samples/foo.txt' ),
+ 'ASCII text',
+ 'magic_file on foo file (no custom magic)'
+ );
+ is(
+ $magic_file->( $handle, 't/samples/foo.foo' ),
+ 'ASCII text',
+ 'magic_file on foo file (no custom magic)'
+ );
+ }
+
+ is(
+ $magic_file->( $handle, 't/samples/foo.txt' ),
+ 'ASCII text',
+ 'magic_file on ASCII text'
+ );
+ is_any_of(
+ $magic_file->( $handle, 't/samples/foo.c' ),
+ [ 'ASCII text', 'ASCII C program text', 'C source, ASCII text' ],
+ 'magic_file on C code'
+ );
+
+ $package->can('magic_close')->($handle);
+}
+
+sub test_easy {
+ my $package = shift;
+
+ my $MagicBuffer = $package->can('MagicBuffer');
+ my $MagicFile = $package->can('MagicFile');
+
+ is(
+ $MagicBuffer->("Hello World\n"),
+ 'ASCII text',
+ 'MagicBuffer on text'
+ );
+ is(
+ $MagicFile->('t/samples/foo.txt'),
+ 'ASCII text',
+ 'MagicFile on ASCII text'
+ );
+ is_any_of(
+ $MagicFile->('t/samples/foo.c'),
+ [ 'ASCII C program text', 'C source, ASCII text' ],
+ 'MagicFile on C code'
+ );
+
+ like(
+ exception { $MagicBuffer->(undef) },
+ qr{MagicBuffer requires defined content},
+ 'MagicBuffer(undef)'
+ );
+
+ like(
+ exception { $MagicFile->(undef) },
+ qr{MagicFile requires a filename},
+ 'MagicFile(undef)'
+ );
+
+TODO: {
+ local $TODO = 'May not fail sanely with all versions of libmagic';
+ like(
+ exception { $MagicFile->('t/samples/missing') },
+ qr{libmagic cannot open .+ at .+},
+ 'MagicFile: missing file'
+ );
+ }
+}
+
+1;
@@ -4,7 +4,7 @@ use warnings;
use lib 't/lib';
use Test::AnyOf;
-use Test::More 0.88;
+use Test::More 0.96;
use File::LibMagic;
@@ -96,11 +96,9 @@ sub _test_old_oo_api {
"describe_filename $file",
);
- my $data = do {
- local $/;
- open my $fh, '<', $file or die $!;
- <$fh>;
- };
+ open my $fh, '<', $file or die $!;
+ my $data = do { local $/ = undef; <$fh>; };
+ close $fh or die $!;
like(
$flm->checktype_contents($data),
@@ -143,8 +141,8 @@ sub _test_new_oo_api {
"info_from_string $file",
sub {
open my $fh, '<', $file or die $!;
- my $string = do { local $/; <$fh> };
- close $fh;
+ my $string = do { local $/ = undef; <$fh> };
+ close $fh or die $!;
_test_info( $flm->info_from_string($string), @args );
},
);
@@ -153,8 +151,8 @@ sub _test_new_oo_api {
"info_from_string $file as ref",
sub {
open my $fh, '<', $file or die $!;
- my $string = do { local $/; <$fh> };
- close $fh;
+ my $string = do { local $/ = undef; <$fh> };
+ close $fh or die $!;
_test_info( $flm->info_from_string( \$string ), @args );
},
);
@@ -164,7 +162,8 @@ sub _test_new_oo_api {
sub {
open my $fh, '<', $file or die $!;
_test_info( $flm->info_from_handle($fh), @args );
- my $content = do { local $/; <$fh> };
+ my $content = do { local $/ = undef; <$fh> };
+ close $fh or die $!;
ok(
length $content,
'info_from_handle resets pos after reading'
@@ -175,12 +174,15 @@ sub _test_new_oo_api {
subtest(
"info_from_handle $file - handle from scalar ref",
sub {
- open my $fh, '<', $file or die $!;
- my $string = do { local $/; <$fh> };
- close $fh;
-
- open $fh, '<', \$string;
- _test_info( $flm->info_from_handle($fh), @args );
+ open my $file_fh, '<', $file or die $!;
+ my $string = do { local $/ = undef; <$file_fh> };
+ close $file_fh or die $!;
+
+ ## no critic (InputOutput::RequireCheckedOpen, InputOutput::RequireCheckedSyscalls)
+ open my $string_fh, '<', \$string;
+ _test_info( $flm->info_from_handle($string_fh), @args );
+ close $string_fh;
+ ## use critic
},
);
}
@@ -218,11 +220,12 @@ sub _test_info {
{
{
+
package My::Magic::Subclass;
use base qw( File::LibMagic );
- sub checktype_filename { 'text/x-test-passes' }
+ sub checktype_filename {'text/x-test-passes'}
}
subtest(
@@ -16,4 +16,5 @@ use Test::More;
eval 'use Test::Portability::Files';
plan skip_all => 'Test::Portability::Files required for testing portability'
if $@;
+
run_tests();
@@ -0,0 +1,30 @@
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+use strict;
+use warnings;
+use Test::More;
+
+# generated by Dist::Zilla::Plugin::Test::Version 0.003001
+use Test::Version;
+
+my @imports = ( 'version_all_ok' );
+
+my $params = {
+ is_strict => 1,
+ has_version => 1,
+};
+
+push @imports, $params
+ if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
+
+
+Test::Version->import(@imports);
+
+version_all_ok;
+done_testing;
@@ -0,0 +1,17 @@
+#!perl
+
+BEGIN {
+ unless ($ENV{RELEASE_TESTING}) {
+ require Test::More;
+ Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ }
+}
+
+# This file was automatically generated by Dist::Zilla::Plugin::Test::TidyAll
+
+use Test::Code::TidyAll 0.24;
+use Test::More 0.88;
+
+tidyall_ok();
+
+done_testing();
@@ -0,0 +1,23 @@
+[PerlTidy]
+select = **/*.{pl,pm,t,psgi}
+ignore = .build/**/*
+ignore = File-LibMagic-*/**/*
+ignore = blib/**/*
+ignore = inc/Capture/*
+ignore = inc/Config/*
+ignore = t/00-*
+ignore = t/author-*
+ignore = t/release-*
+argv = --profile=$ROOT/perltidyrc
+
+[PerlCritic]
+select = **/*.{pl,pm,t,psgi}
+ignore = .build/**/*
+ignore = File-LibMagic-*/**/*
+ignore = blib/**/*
+ignore = inc/Capture/*
+ignore = inc/Config/*
+ignore = t/00-*
+ignore = t/author-*
+ignore = t/release-*
+argv = --profile $ROOT/perlcriticrc --program-extensions .pl --program-extensions .t --program-extensions .psgi
@@ -0,0 +1,17 @@
+[@CorePrep]
+
+[Name]
+[Version]
+
+[Region / prelude]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+
+[Leftovers]
+
+[Region / postlude]
+
+[Authors]
+[Contributors]
+[Legal]