From: Tatsuhiko Miyagawa Date: Wed, 3 Apr 2013 22:20:34 +0000 (-0700) Subject: separate command_file implementation to a utility method ->fatpack_file X-Git-Tag: v0.009015~2^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9be5f3c0dafa2ac37c07836f3ad5fb6777799b87;p=p5sagit%2FApp-FatPacker.git separate command_file implementation to a utility method ->fatpack_file --- diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index 05c8db7..a7871c8 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -181,6 +181,11 @@ sub packlists_to_tree { sub script_command_file { my ($self, $args) = @_; my $file = shift @$args; + print $self->fatpack_file($file); +} + +sub fatpack_file { + my ($self, $file) = @_; my $cwd = cwd; my @dirs = grep -d, map rel2abs($_, $cwd), ('lib','fatlib'); my %files; @@ -229,7 +234,7 @@ sub script_command_file { '$fatpacked{'.perlstring($_).qq!} = <<'${name}';\n! .qq!${data}${name}\n!; } sort keys %files; - print join "\n", $start, @segments, $end; + return join "\n", $start, @segments, $end; } =encoding UTF-8