Skip Menu |

This queue is for tickets about the File-Assets CPAN distribution.

Report information
The Basics
Id: 70474
Status: resolved
Priority: 0/
Queue: File-Assets

People
Owner: Nobody in particular
Requestors: bokutin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.064
Fixed in: (no value)



Subject: a minified content was not written.
Hi, I found a bug. Test file attached. Cheers Tomohiro Hosaka
Subject: bug-minify.t
use Test::More qw/no_plan/; use t::Test; { my $assets = t::Test->assets( output_path => [ [ qw/* %n%-l.%e/ ] ], filter => [ [ css => 'minifier', ], [ js => 'minifier', ], ], ); my $scratch = t::Test->scratch; $assets->include("css/apple.css"); $assets->export; $scratch->read("static/assets.css"); $scratch->delete("static/assets.css"); } { my $assets = t::Test->assets( output_path => [ [ qw/* %n%-l.%e/ ] ], filter => [ [ css => 'minifier', ], [ js => 'minifier', ], ], ); my $scratch = t::Test->scratch; ok($assets->include_content(<<_END_, "css", { inline => 0 })); div { background: red; } _END_ $assets->export; $scratch->read("static/assets.css"); $scratch->delete("static/assets.css"); }
Subject: bug-minify.t.txt
use Test::More qw/no_plan/; use t::Test; # OK { my $assets = t::Test->assets( output_path => [ [ qw/* %n%-l.%e/ ] ], filter => [ [ css => 'minifier', ], [ js => 'minifier', ], ], ); my $scratch = t::Test->scratch; $assets->include("css/apple.css"); $assets->export; $scratch->read("static/assets.css"); $scratch->delete("static/assets.css"); } # OK { my $assets = t::Test->assets( output_path => [ [ qw/* %n%-l.%e/ ] ], filter => [ [ css => 'minifier', ], [ js => 'minifier', ], ], ); my $scratch = t::Test->scratch; $assets->include("css/apple.css"); ok($assets->include_content(<<_END_, "css", { inline => 0 })); div { background: red; } _END_ $assets->export; $scratch->read("static/assets.css"); $scratch->delete("static/assets.css"); } # NG { my $assets = t::Test->assets( output_path => [ [ qw/* %n%-l.%e/ ] ], filter => [ [ css => 'minifier', ], [ js => 'minifier', ], ], ); my $scratch = t::Test->scratch; ok($assets->include_content(<<_END_, "css", { inline => 0 })); div { background: red; } _END_ $assets->export; $scratch->read("static/assets.css"); $scratch->delete("static/assets.css"); }
Simplicity above bug... use File::Assets; my $assets = File::Assets->new( base => [ "./", "./" ], minify => 1 ); $assets->include('<style type="text/css"> body { color: red; } </style>', { inline => 0 }); $assets->export; # file not created. This bug not occured on github version. Because https://github.com/robertkrimen/file-assets/blob/master/lib/File/Assets/Filter/Collect.pm#L118 is exists. CPAN version is not. http://cpansearch.perl.org/src/RKRIMEN/File-Assets-0.064/lib/File/Assets/Filter/Collect.pm I am glad you upload this usuful module to cpan!! Cheers Tomohiro Hosaka