Asset-Pack

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "recommends" : {
            "App::FatPacker" : "0.009017",
            "CPAN::Meta" : "2.120900",
            "ExtUtils::MakeMaker" : "7.00",
            "Test::More" : "0.99"
         },
         "requires" : {
            "Cwd" : "0",
            "ExtUtils::MakeMaker" : "0",
            "File::Spec" : "0",
            "Test::Differences" : "0",
            "Test::Fatal" : "0",
            "Test::More" : "0",
            "Test::TempDir::Tiny" : "0",
            "perl" : "5.006"
         }
      }
   },
   "provides" : {
      "Asset::Pack" : {
         "file" : "lib/Asset/Pack.pm",

META.yml  view on Meta::CPAN

---
abstract: 'Easily pack assets into Perl Modules that can be fat-packed'
author:
  - 'James Laver <james.laver@gmail.com>'
build_requires:
  Cwd: '0'
  ExtUtils::MakeMaker: '0'
  File::Spec: '0'
  Test::Differences: '0'
  Test::Fatal: '0'
  Test::More: '0'
  Test::TempDir::Tiny: '0'
  perl: '5.006'
configure_requires:
  ExtUtils::MakeMaker: '0'
  perl: '5.006'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010'
license: perl

Makefile.PL  view on Meta::CPAN

    "Path::Tiny" => "0.069",
    "Try::Tiny" => 0,
    "parent" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Cwd" => 0,
    "ExtUtils::MakeMaker" => 0,
    "File::Spec" => 0,
    "Test::Differences" => 0,
    "Test::Fatal" => 0,
    "Test::More" => 0,
    "Test::TempDir::Tiny" => 0
  },
  "VERSION" => "0.000008",
  "test" => {
    "TESTS" => "t/*.t t/00-compile/*.t t/internals/*.t t/interop/*.t"
  }
);


my %FallbackPrereqs = (
  "Cwd" => 0,
  "Data::Dumper" => 0,
  "Exporter" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Spec" => 0,
  "Path::Tiny" => "0.069",
  "Test::Differences" => 0,
  "Test::Fatal" => 0,
  "Test::More" => 0,
  "Test::TempDir::Tiny" => 0,
  "Try::Tiny" => 0,
  "parent" => 0,
  "strict" => 0,
  "warnings" => 0
);


lib/Asset/Pack.pm  view on Meta::CPAN

B<generates> should work as-is on C<5.6> )

This is mostly due to its dependencies:

=over 4

=item * L<< C<Path::Tiny>|Path::Tiny >> is used extensively for mechanics, but C<Path::Tiny>
does not presently (Circa C<0.72>) work on C<< Perl <5.8 >>
(L<< details on C<GitHub>|https://github.com/dagolden/Path-Tiny/issues/145 >>)

=item * L<< C<Test::Differences>|Test::Differences >> is used a fair bit in tests, and
it won't auto-install on 5.6. But careful selection of dependencies will get you a
working install

=over 4

=item * C<< SMUELLER/Data-Dumper-2.128.tar.gz >> is newest version of Data::Dumper that
works on C<5.6.2>, versions C<2.130_03> to C<2.154> presently fail.

=item * C<< OVID/Test-Differences-0.61.tar.gz >> is the newest version of
Test::Differences that works on C<5.6.2>, versions C<0.61_01> to C<0.63> presently fail.

=back

=item * L<< C<Test::TempDir::Tiny>|Test::TempDir::Tiny >> is used a fair bit in tests as
well, and as of C<0.005-TRIAL>, C<5.6> support is
L<< still lacking|https://github.com/dagolden/Test-TempDir-Tiny/issues/9 >>, albeit support is
L<< intended|https://github.com/dagolden/Test-TempDir-Tiny/commit/bbf9f899ddee1959867e1ad3a4830bea5400f1ef >>

=back

t/00-report-prereqs.dd  view on Meta::CPAN

                   'recommends' => {
                                     'App::FatPacker' => '0.009017',
                                     'CPAN::Meta' => '2.120900',
                                     'ExtUtils::MakeMaker' => '7.00',
                                     'Test::More' => '0.99'
                                   },
                   'requires' => {
                                   'Cwd' => '0',
                                   'ExtUtils::MakeMaker' => '0',
                                   'File::Spec' => '0',
                                   'Test::Differences' => '0',
                                   'Test::Fatal' => '0',
                                   'Test::More' => '0',
                                   'Test::TempDir::Tiny' => '0',
                                   'perl' => '5.006'
                                 }
                 }
     };
  $x;
 }

t/internals/pack_asset_binary.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 1;

# ABSTRACT: Test _pack_metadata

use Asset::Pack;
use Test::TempDir::Tiny qw( tempdir );
use Path::Tiny qw( path );
use Test::Differences qw( eq_or_diff );

*pack_asset = \&Asset::Pack::_pack_asset;

sub mk_pack {
  my ( $file, $packed_class ) = @_;
  local $@;
  do $file or die "Did not get true return, $@";
  my $stash_contents = {};
  no strict 'refs';
  my $stash = \%{ $packed_class . '::' };

t/internals/pack_asset_binary_large.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 1;

# ABSTRACT: Test _pack_metadata

use Asset::Pack;
use Test::TempDir::Tiny qw( tempdir );
use Path::Tiny qw( path );
use Test::Differences qw( eq_or_diff );

*pack_asset = \&Asset::Pack::_pack_asset;

sub mk_pack {
  my ( $file, $packed_class ) = @_;
  local $@;
  do $file or die "Did not get true return, $@";
  my $stash_contents = {};
  no strict 'refs';
  my $stash = \%{ $packed_class . '::' };

t/internals/pack_metadata.t  view on Meta::CPAN


  my $ref = mk_pack( pack_metadata($struct) );
  is_deeply( [ sort keys %{$ref} ], [ 'VERSION', 'meta' ], 'Only expected vars' ) || $nfails++;
  is_deeply( $ref->{meta}->{PACKER}, $packer_struct, 'PACKER is expected' ) || $nfails++;
  is( $ref->{meta}->{candies}, '5', 'candies is expected' ) || $nfails++;
  is_deeply( $ref->{meta}->{hard},   [], 'hard is an empty array' )   || $nfails++;
  is_deeply( $ref->{meta}->{lemons}, [], 'lemons is an empty array' ) || $nfails++;
  is( $ref->{meta}->{hard}, $ref->{meta}->{lemons}, 'hard and lemons share stringified forms( same ref )' ) || $nfails++;
} or diag $last_pack;

use Test::Differences qw( eq_or_diff );

my_subtest "simple metadata + variables w/ cycle" => sub {
  my $struct = { VERSION => '1.0', 'candies' => '5', hard => [] };
  $struct->{'lemons'} = $struct->{'hard'};

  my $ref = mk_pack( pack_metadata( $struct, [qw( $candies $hard $lemons )] ) );
  my @expected = ( 'VERSION', 'meta', 'candies', 'hard', 'lemons' );

  eq_or_diff( [ sort keys %{$ref} ], [ sort @expected ], 'Only expected vars' ) || $nfails++;
  is_deeply( $ref->{meta}->{PACKER}, $packer_struct, 'PACKER is expected' ) || $nfails++;

t/write_module.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 3 * 2;

use 5.006;
use Path::Tiny;
use Test::TempDir::Tiny qw(tempdir);
use Asset::Pack qw(write_module);
use Test::Differences qw( eq_or_diff );

my $tmpdir = tempdir;
unshift @INC, $tmpdir;
my %paths = (
  't/write_module.t'  => 'Test::PackT',
  'LICENSE'           => 'Test::LICENSE',
  'lib/Asset/Pack.pm' => 'Test::AssetPack',
);
foreach my $p ( keys %paths ) {
  my $content = path($p)->slurp_raw;

t/write_module_binary.t  view on Meta::CPAN

use strict;
use warnings;

use Test::More tests => 1 * 2;

use 5.006;
use Path::Tiny;
use Test::TempDir::Tiny qw(tempdir);
use Asset::Pack qw(write_module);
use Test::Differences qw( eq_or_diff );

my $tempdir = tempdir;
unshift @INC, $tempdir;

my $binfile = path( $tempdir, 'binary_ranges.bin' );
{
  my $fh = $binfile->openw_raw;
  print {$fh} "Double\n";

  for my $first ( 0 .. 255 ) {



( run in 1.522 second using v1.01-cache-2.11-cpan-39bf76dae61 )