diff --git a/Changes b/Changes index db6b5af..e1dbe81 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,14 @@ Revision history for Asset-Pack +0.000005 2015-07-19T20:45:18Z f2f12fb + [Dependencies::Stats] + - Dependencies changed since 0.000004, see misc/*.deps* for details + - test: +3 -1 + + [Tests] + - Bundling Test::Requires temporarily till upstream re-establish perl 5.6 support in their installer + https://github.com/tokuhirom/Test-Requires/issues/11 + 0.000004 2015-07-13T06:11:23Z fcd9a2c [BugFix Bugfix] - Actually resolve the change I claimed to fix in 0.000003 because I can't count '0's. diff --git a/MANIFEST b/MANIFEST index c87cd80..b6f8a5e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,6 +33,7 @@ t/internals/pack_asset_binary.t t/internals/pack_asset_binary_large.t t/internals/pack_metadata.t t/interop/App-FatPacker.t +t/tlib/Test/Requires.pm t/write_index.t t/write_module.t t/write_module_binary.t diff --git a/META.json b/META.json index 5f56caf..e24abff 100644 --- a/META.json +++ b/META.json @@ -115,11 +115,13 @@ "Cwd" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", + "Test::Builder::Module" : "0", "Test::Differences" : "0", "Test::Fatal" : "0", "Test::More" : "0.89", - "Test::Requires" : "0", "Test::TempDir::Tiny" : "0", + "base" : "0", + "lib" : "0", "perl" : "5.006" } } @@ -127,7 +129,7 @@ "provides" : { "Asset::Pack" : { "file" : "lib/Asset/Pack.pm", - "version" : "0.000004" + "version" : "0.000005" } }, "release_status" : "stable", @@ -142,7 +144,7 @@ "web" : "https://github.com/kentnl/Asset-Pack" } }, - "version" : "0.000004", + "version" : "0.000005", "x_Dist_Zilla" : { "perl" : { "version" : "5.022000" @@ -583,7 +585,7 @@ "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "signed" : 0, - "tag" : "0.000004-source", + "tag" : "0.000005-source", "tag_format" : "%v-source", "tag_message" : "v%v", "time_zone" : "local" @@ -659,7 +661,7 @@ "Dist::Zilla::Plugin::Git::Tag" : { "branch" : "releases", "signed" : 0, - "tag" : "0.000004", + "tag" : "0.000005", "tag_format" : "%v", "tag_message" : "v%v", "time_zone" : "local" diff --git a/META.yml b/META.yml index 7e64010..d90cfd0 100644 --- a/META.yml +++ b/META.yml @@ -6,11 +6,13 @@ build_requires: Cwd: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' + Test::Builder::Module: '0' Test::Differences: '0' Test::Fatal: '0' Test::More: '0.89' - Test::Requires: '0' Test::TempDir::Tiny: '0' + base: '0' + lib: '0' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' @@ -25,7 +27,7 @@ name: Asset-Pack provides: Asset::Pack: file: lib/Asset/Pack.pm - version: '0.000004' + version: '0.000005' requires: Data::Dumper: '0' Exporter: '0' @@ -39,4 +41,4 @@ resources: bugtracker: https://github.com/kentnl/Asset-Pack/issues homepage: https://github.com/kentnl/Asset-Pack repository: https://github.com/kentnl/Asset-Pack.git -version: '0.000004' +version: '0.000005' diff --git a/Makefile.PL b/Makefile.PL index 48b6637..301d918 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -30,13 +30,15 @@ my %WriteMakefileArgs = ( "Cwd" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, + "Test::Builder::Module" => 0, "Test::Differences" => 0, "Test::Fatal" => 0, "Test::More" => "0.89", - "Test::Requires" => 0, - "Test::TempDir::Tiny" => 0 + "Test::TempDir::Tiny" => 0, + "base" => 0, + "lib" => 0 }, - "VERSION" => "0.000004", + "VERSION" => "0.000005", "test" => { "TESTS" => "t/*.t t/00-compile/*.t t/internals/*.t t/interop/*.t" } @@ -50,12 +52,14 @@ my %FallbackPrereqs = ( "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Path::Tiny" => "0.069", + "Test::Builder::Module" => 0, "Test::Differences" => 0, "Test::Fatal" => 0, "Test::More" => "0.89", - "Test::Requires" => 0, "Test::TempDir::Tiny" => 0, "Try::Tiny" => 0, + "base" => 0, + "lib" => 0, "parent" => 0, "strict" => 0, "warnings" => 0 diff --git a/lib/Asset/Pack.pm b/lib/Asset/Pack.pm index 38e5fba..ed8cd46 100644 --- a/lib/Asset/Pack.pm +++ b/lib/Asset/Pack.pm @@ -7,7 +7,7 @@ package Asset::Pack; use Path::Tiny 0.069 qw( path ); # path()->visit without broken ref returns use Try::Tiny qw( try catch ); -our $VERSION = '0.000004'; +our $VERSION = '0.000005'; # ABSTRACT: Easily pack assets into Perl Modules that can be fat-packed @@ -336,7 +336,7 @@ Asset::Pack - Easily pack assets into Perl Modules that can be fat-packed =head1 VERSION -version 0.000004 +version 0.000005 =head1 SYNOPSIS diff --git a/misc/Changes.deps b/misc/Changes.deps index a80db2c..fb3f9a1 100644 --- a/misc/Changes.deps +++ b/misc/Changes.deps @@ -1,6 +1,15 @@ This file contains changes in REQUIRED dependencies for standard CPAN phases (configure/build/runtime/test) -0.000004 +0.000005 + [Added / test requires] + - Test::Builder::Module + - base + - lib + + [Removed / test requires] + - Test::Requires + +0.000004 2015-07-13T06:11:23Z 0.000003 2015-07-13T05:40:50Z diff --git a/misc/Changes.deps.all b/misc/Changes.deps.all index 363e0ce..5eb86bd 100644 --- a/misc/Changes.deps.all +++ b/misc/Changes.deps.all @@ -1,6 +1,15 @@ This file contains ALL changes in dependencies in both REQUIRED / OPTIONAL dependencies for all phases (configure/build/runtime/test/develop) -0.000004 +0.000005 + [Added / test requires] + - Test::Builder::Module + - base + - lib + + [Removed / test requires] + - Test::Requires + +0.000004 2015-07-13T06:11:23Z 0.000003 2015-07-13T05:40:50Z [Changed / test recommends] diff --git a/misc/Changes.deps.dev b/misc/Changes.deps.dev index 1f9b385..bb140d4 100644 --- a/misc/Changes.deps.dev +++ b/misc/Changes.deps.dev @@ -1,6 +1,8 @@ This file contains changes to DEVELOPMENT dependencies only ( both REQUIRED and OPTIONAL ) -0.000004 +0.000005 + +0.000004 2015-07-13T06:11:23Z 0.000003 2015-07-13T05:40:50Z diff --git a/misc/Changes.deps.opt b/misc/Changes.deps.opt index a75cdd6..3130b1a 100644 --- a/misc/Changes.deps.opt +++ b/misc/Changes.deps.opt @@ -1,6 +1,8 @@ This file contains changes in OPTIONAL dependencies for standard CPAN phases (configure/build/runtime/test) -0.000004 +0.000005 + +0.000004 2015-07-13T06:11:23Z 0.000003 2015-07-13T05:40:50Z [Changed / test recommends] diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd index 52c293c..b42f52d 100644 --- a/t/00-report-prereqs.dd +++ b/t/00-report-prereqs.dd @@ -100,11 +100,13 @@ do { my $x = { 'Cwd' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', + 'Test::Builder::Module' => '0', 'Test::Differences' => '0', 'Test::Fatal' => '0', 'Test::More' => '0.89', - 'Test::Requires' => '0', 'Test::TempDir::Tiny' => '0', + 'base' => '0', + 'lib' => '0', 'perl' => '5.006' } } diff --git a/t/interop/App-FatPacker.t b/t/interop/App-FatPacker.t index 3149c80..5a7e2e4 100644 --- a/t/interop/App-FatPacker.t +++ b/t/interop/App-FatPacker.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use lib 't/tlib'; use Test::Requires { "App::FatPacker" => '0.009017' }; # Minimum required for fatpack_file use Test::TempDir::Tiny qw( tempdir ); use Path::Tiny qw( path cwd ); diff --git a/t/tlib/Test/Requires.pm b/t/tlib/Test/Requires.pm new file mode 100644 index 0000000..d9ee490 --- /dev/null +++ b/t/tlib/Test/Requires.pm @@ -0,0 +1,147 @@ +package Test::Requires; +use strict; +use warnings; +our $VERSION = '0.08'; +use base 'Test::Builder::Module'; +use 5.006000; + +sub import { + my $class = shift; + my $caller = caller(0); + + # export methods + { + no strict 'refs'; + *{"$caller\::test_requires"} = \&test_requires; + } + + # test arguments + if (@_ == 1 && ref $_[0] && ref $_[0] eq 'HASH') { + while (my ($mod, $ver) = each %{$_[0]}) { + test_requires($mod, $ver, $caller); + } + } else { + for my $mod (@_) { + test_requires($mod, undef, $caller); + } + } +} + +sub test_requires { + my ( $mod, $ver, $caller ) = @_; + return if $mod eq __PACKAGE__; + if (@_ != 3) { + $caller = caller(0); + } + $ver ||= ''; + + eval qq{package $caller; use $mod $ver}; ## no critic. + if (my $e = $@) { + my $skip_all = sub { + my $builder = __PACKAGE__->builder; + + if (not defined $builder->has_plan) { + $builder->skip_all(@_); + } elsif ($builder->has_plan eq 'no_plan') { + $builder->skip(@_); + if ( $builder->can('parent') && $builder->parent ) { + die bless {} => 'Test::Builder::Exception'; + } + exit 0; + } else { + for (1..$builder->has_plan) { + $builder->skip(@_); + } + if ( $builder->can('parent') && $builder->parent ) { + die bless {} => 'Test::Builder::Exception'; + } + exit 0; + } + }; + + my $msg = "$e"; + if ( $e =~ /^Can't locate/ ) { + $msg = "Test requires module '$mod' but it's not found"; + } + + if ($ENV{RELEASE_TESTING}) { + __PACKAGE__->builder->BAIL_OUT($msg); + } + else { + $skip_all->($msg); + } + } +} + +1; +__END__ + +=head1 NAME + +Test::Requires - Checks to see if the module can be loaded + +=head1 SYNOPSIS + + # in your Makefile.PL + use inc::Module::Install; + test_requires 'Test::Requires'; + + # in your test + use Test::More tests => 10; + use Test::Requires { + 'HTTP::MobileAttribute' => 0.01, # skip all if HTTP::MobileAttribute doesn't installed + }; + isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile'; + + # or + use Test::More tests => 10; + use Test::Requires qw( + HTTP::MobileAttribute + ); + isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile'; + + # or + use Test::More tests => 10; + use Test::Requires; + test_requires 'Some::Optional::Test::Required::Modules'; + isa_ok HTTP::MobileAttribute->new, 'HTTP::MobileAttribute::NonMobile'; + +=head1 DESCRIPTION + +Test::Requires checks to see if the module can be loaded. + +If this fails rather than failing tests this B. + +Test::Requires can also be used to require a minimum version of Perl: + + use Test::Requires "5.010"; # quoting is necessary!! + + # or + use Test::Requires "v5.10"; + +=head1 AUTHOR + +Tokuhiro Matsuno Etokuhirom @*(#RJKLFHFSDLJF gmail.comE + +=head1 THANKS TO + + kazuho++ # some tricky stuff + miyagawa++ # original code from t/TestPlagger.pm + tomyhero++ # reported issue related older test::builder + tobyink++ # documented that Test::Requires "5.010" works + +=head1 ENVIRONMENT + +If the C<< RELEASE_TESTING >> environment variable is true, then instead +of skipping tests, Test::Requires bails out. + +=head1 SEE ALSO + +L + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/xt/author/eol.t b/xt/author/eol.t index c158d83..226677d 100644 --- a/xt/author/eol.t +++ b/xt/author/eol.t @@ -19,6 +19,7 @@ my @files = ( 't/internals/pack_asset_binary_large.t', 't/internals/pack_metadata.t', 't/interop/App-FatPacker.t', + 't/tlib/Test/Requires.pm', 't/write_index.t', 't/write_module.t', 't/write_module_binary.t'