Skip Menu |

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

Report information
The Basics
Id: 47932
Status: open
Priority: 0/
Queue: File-Assets

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

Bug Information
Severity: Critical
Broken in: 0.064_1
Fixed in: 0.02



Subject: ->include( $file => $rank ) broken for minification
Rank is completely ignored when minifying assets, which breaks any minified JS: $ cat assets.pl use strict; use warnings; use File::Assets; my $ass = File::Assets->new( base => [ 'http://foo.com', 'js' ], minify => 'concat', ); $ass->include( 'a.js', 10 ); # contains 'a' $ass->include( 'b.js', 5 ); # contains 'b' $ass->include( 'c.js', 7 ); # contains 'c' print $ass->export . $/; $ perl assets.pl <script src="http://foo.com/assets-cb18abe5b1c4a17c849d3c213bd74e80.js" type="text/javascript"></script> $ cat js/assets-cb18abe5b1c4a17c849d3c213bd74e80.js a b c
On Wed Jul 15 22:19:21 2009, KANE wrote: Show quoted text
> Rank is completely ignored when minifying assets, which breaks any > minified JS:
This patch fixes the problem: --- File-Assets-0.064/lib/File/Assets/Bucket.pm Mon Sep 29 23:21:04 2008 +++ File-Assets-0.064/lib/File/Assets/Bucket.pm Thu Jul 16 17:48:13 2009 @@ -41,6 +41,10 @@ sub exports { my $self = shift; + + ### slice order has to respect the rank assigned to the assets + $self->{'slice'} = [ sort { $a->rank <=> $b->rank } @{$self->{slice}} ]; + my @assets = $self->all; my $filters = $self->{filters}; for my $entry (@$filters) {
I am having the same issue, which is throwing off some of my css. I can confirm that this patch above fixes the issue for me.