+ - Don't break if there is only a single script to be fatpacked,
+ without ther being a lib/ directory present.
+
- Add repsoitory metadata to META.YML
0.9.6 2011-01-18
my ($self, $args) = @_;
my $file = shift @$args;
my $cwd = cwd;
- my @dirs = map rel2abs($_, $cwd), ('lib','fatlib');
+ my @dirs = grep { -d $_ } map rel2abs($_, $cwd), ('lib','fatlib');
my %files;
foreach my $dir (@dirs) {
find(sub {
+++ /dev/null
-#!perl
-use strict;
-use warnings FATAL => 'all';
-use Test::More qw(no_plan);
-use File::Basename;
-use File::Copy;
-use File::Path;
-use File::Temp;
-
-BEGIN { use_ok "App::FatPacker", "" }
-
-my $tempdir = File::Temp->newdir;
-mkpath([<$tempdir/{lib,fatlib}/t/mod>]);
-
-for(<t/mod/*.pm>) {
- copy $_, "$tempdir/lib/$_" or die "copy failed: $!";
-}
-
-chdir $tempdir;
-
-my $fp = App::FatPacker->new;
-my $temp_fh = File::Temp->new;
-select $temp_fh;
-$fp->script_command_file;
-print "1;\n";
-select STDOUT;
-close $temp_fh;
-
-# Packed, now try using it:
-require $temp_fh;
-
-{
- require t::mod::a;
- no warnings 'once';
- ok $t::mod::a::foo eq 'bar';
-}
--- /dev/null
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More qw(no_plan);
+use FindBin qw/$Bin/;
+use File::Spec;
+
+require File::Spec->catdir($Bin, "pack_lib.t");
+test_with("fatlib");
+
--- /dev/null
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use File::Basename;
+use File::Copy;
+use File::Path;
+use File::Temp;
+
+sub test_with {
+ use_ok "App::FatPacker", "";
+ my $dir = shift;
+ my $tempdir = File::Temp->newdir;
+ mkpath([<$tempdir/$dir/t/mod>]);
+
+ for(<t/mod/*.pm>) {
+ copy $_, "$tempdir/$dir/$_" or die "copy failed: $!";
+ }
+
+ chdir $tempdir;
+
+ my $fp = App::FatPacker->new;
+ my $temp_fh = File::Temp->new;
+ select $temp_fh;
+ $fp->script_command_file;
+ print "1;\n";
+ select STDOUT;
+ close $temp_fh;
+
+ # Packed, now try using it:
+ require $temp_fh;
+
+ {
+ require t::mod::a;
+ no warnings 'once';
+ ok $t::mod::a::foo eq 'bar';
+ }
+}
+
+unless (caller()) {
+ plan 'no_plan';
+ test_with("lib");
+}