Hello community, here is the log from the commit of package perl-Mojolicious-Plugin-AssetPack for openSUSE:Factory checked in at 2017-05-03 15:57:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-AssetPack (Old) and /work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-AssetPack.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious-Plugin-AssetPack" Wed May 3 15:57:19 2017 rev:30 rq:492405 version:1.42 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-AssetPack/perl-Mojolicious-Plugin-AssetPack.changes 2017-03-24 02:23:19.573872766 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-AssetPack.new/perl-Mojolicious-Plugin-AssetPack.changes 2017-05-03 15:57:22.794618425 +0200 @@ -1,0 +2,10 @@ +Sun Apr 30 06:10:11 UTC 2017 - co...@suse.com + +- updated to 1.42 + see /usr/share/doc/packages/perl-Mojolicious-Plugin-AssetPack/Changes + + 1.42 2017-04-29T14:23:37+0200 + - Fix missing use lib '.' in register.t #124 + - Add fetching of source maps to "Fetch" pipe #117 + +------------------------------------------------------------------- Old: ---- Mojolicious-Plugin-AssetPack-1.41.tar.gz New: ---- Mojolicious-Plugin-AssetPack-1.42.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious-Plugin-AssetPack.spec ++++++ --- /var/tmp/diff_new_pack.sanFno/_old 2017-05-03 15:57:24.522374512 +0200 +++ /var/tmp/diff_new_pack.sanFno/_new 2017-05-03 15:57:24.526373947 +0200 @@ -17,7 +17,7 @@ Name: perl-Mojolicious-Plugin-AssetPack -Version: 1.41 +Version: 1.42 Release: 0 %define cpan_name Mojolicious-Plugin-AssetPack Summary: Compress and convert css, less, sass, javascript and coffeescript files ++++++ Mojolicious-Plugin-AssetPack-1.41.tar.gz -> Mojolicious-Plugin-AssetPack-1.42.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/Changes new/Mojolicious-Plugin-AssetPack-1.42/Changes --- old/Mojolicious-Plugin-AssetPack-1.41/Changes 2017-03-15 22:09:14.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/Changes 2017-04-29 14:23:37.000000000 +0200 @@ -1,5 +1,9 @@ Revision history for perl distribution Mojolicious-Plugin-AssetPack +1.42 2017-04-29T14:23:37+0200 + - Fix missing use lib '.' in register.t #124 + - Add fetching of source maps to "Fetch" pipe #117 + 1.41 2017-03-15T22:09:14+0100 - Fix bug in @import regex used by Pipe::Sass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/MANIFEST new/Mojolicious-Plugin-AssetPack-1.42/MANIFEST --- old/Mojolicious-Plugin-AssetPack-1.41/MANIFEST 2017-03-15 22:09:15.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/MANIFEST 2017-04-29 14:23:38.000000000 +0200 @@ -64,6 +64,7 @@ t/favicon.t t/fetch-all.t t/fetch-hash.t +t/fetch-source-map.t t/font-awesome.t t/google-font.t t/Helper.pm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/META.json new/Mojolicious-Plugin-AssetPack-1.42/META.json --- old/Mojolicious-Plugin-AssetPack-1.41/META.json 2017-03-15 22:09:15.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/META.json 2017-04-29 14:23:38.000000000 +0200 @@ -48,6 +48,6 @@ "url" : "https://github.com/jhthorsen/mojolicious-plugin-assetpack.git" } }, - "version" : "1.41", + "version" : "1.42", "x_serialization_backend" : "JSON::PP version 2.27300" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/META.yml new/Mojolicious-Plugin-AssetPack-1.42/META.yml --- old/Mojolicious-Plugin-AssetPack-1.41/META.yml 2017-03-15 22:09:15.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/META.yml 2017-04-29 14:23:38.000000000 +0200 @@ -25,5 +25,5 @@ bugtracker: https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues homepage: https://github.com/jhthorsen/mojolicious-plugin-assetpack repository: https://github.com/jhthorsen/mojolicious-plugin-assetpack.git -version: '1.41' +version: '1.42' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/Makefile.PL new/Mojolicious-Plugin-AssetPack-1.42/Makefile.PL --- old/Mojolicious-Plugin-AssetPack-1.41/Makefile.PL 2017-03-15 22:09:14.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/Makefile.PL 2017-04-29 14:23:37.000000000 +0200 @@ -6,7 +6,7 @@ LICENSE => 'artistic_2', ABSTRACT_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm', VERSION_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm', - EXE_FILES => [qw( )], + EXE_FILES => [qw()], META_MERGE => { resources => { bugtracker => 'https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/README new/Mojolicious-Plugin-AssetPack-1.42/README --- old/Mojolicious-Plugin-AssetPack-1.41/README 2017-03-15 22:09:14.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/README 2017-04-29 14:23:37.000000000 +0200 @@ -3,7 +3,7 @@ javascript and coffeescript files VERSION - 1.41 + 1.42 SYNOPSIS Application diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod --- old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod 2017-02-06 00:07:17.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod 2017-04-29 14:22:11.000000000 +0200 @@ -204,10 +204,13 @@ define a source file. This means that the file above will result in (almost) the same as in the L<example above|/Defining assets in the application>. -The difference can be found on the line with a double "E<lt>": This results in -the asset to be downloaded, but not included in the output asset. This is -useful when you have something like "sass/main.scss" that depend on -"materialize.scss", but "materialize.scss" itself should not be compiled. +The idea of the line starting with "<<" is to download an external (remote) +file for your convenience, which can be imported in your SASS/LESS files. The +downloaded file is not included in the output asset. For example, you have +"sass/main.scss" which depends on "materialize.scss" (remote file) and you need +this "materialize.scss" file locally available to be imported in +"sass/main.scss". If you want to include a remote file in your output asset, +use '<' insteaf of '<<'. It is also possible to add (EXPERIMENTAL) conditions: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack/Pipe/Fetch.pm new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack/Pipe/Fetch.pm --- old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack/Pipe/Fetch.pm 2016-11-13 17:49:48.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack/Pipe/Fetch.pm 2017-04-29 14:19:16.000000000 +0200 @@ -4,7 +4,24 @@ use Mojo::URL; # Only made public for quick fixes. Subject for change -our $URL_RE = qr{url\((['"]{0,1})(.*?)\1\)}; +our %FORMATS = ( + css => { + re => qr{url\((['"]{0,1})(.*?)\1\)}, + pos => sub { + my ($start, $url, $quotes) = @_; + my $len = length $url; + return $start - length($quotes) - $len - 1, $len; + }, + }, + js => { + re => qr{(//\W*sourceMappingURL=)(\S+)}m, + pos => sub { + my ($start, $url) = @_; + my $len = length $url; + return $start - $len, $len; + }, + }, +); sub process { my ($self, $assets) = @_; @@ -15,16 +32,16 @@ return $assets->each( sub { my ($asset, $index) = @_; - return unless $asset->format eq 'css'; return unless $asset->url =~ /^https?:/; + return unless my $format = $FORMATS{$asset->format}; my $base = Mojo::URL->new($asset->url); my $content = $asset->content; + my $re = $format->{re}; - while ($content =~ /$URL_RE/g) { - my ($pre, $url) = ($1, $2); - my $len = length $url; - my $start = pos($content) - length($pre) - $len - 1; + while ($content =~ /$re/g) { + my @matches = ($2, $1); + my $url = $matches[0]; next if $url =~ /^(?:\#|data:)/; # Avoid "data:image/svg+xml..." and "#foo" @@ -42,6 +59,7 @@ $related{$url} = "$up$path"; } + my ($start, $len) = $format->{pos}->(pos($content), @matches); substr $content, $start, $len, Mojo::URL->new($related{$url})->query(Mojo::Parameters->new); pos($content) = $start + $len; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack.pm new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack.pm --- old/Mojolicious-Plugin-AssetPack-1.41/lib/Mojolicious/Plugin/AssetPack.pm 2017-03-15 22:09:14.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/lib/Mojolicious/Plugin/AssetPack.pm 2017-04-29 14:23:37.000000000 +0200 @@ -6,7 +6,7 @@ use Mojolicious::Plugin::AssetPack::Store; use Mojolicious::Plugin::AssetPack::Util qw(diag has_ro load_module DEBUG); -our $VERSION = '1.41'; +our $VERSION = '1.42'; my %TAG_TEMPLATE; $TAG_TEMPLATE{css} = [qw(link rel stylesheet href)]; @@ -277,7 +277,7 @@ =head1 VERSION -1.41 +1.42 =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/t/fetch-source-map.t new/Mojolicious-Plugin-AssetPack-1.42/t/fetch-source-map.t --- old/Mojolicious-Plugin-AssetPack-1.41/t/fetch-source-map.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/t/fetch-source-map.t 2017-04-29 14:11:32.000000000 +0200 @@ -0,0 +1,34 @@ +use lib '.'; +use t::Helper; + +plan skip_all => 'TEST_ONLINE=1' unless $ENV{TEST_ONLINE} or -e '.test-everything'; + +my $t = t::Helper->t(pipes => ['Fetch']); +$t->app->asset->process( + 'app.js' => 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js'); + +$t->get_ok('/')->status_is(200); +$t->get_ok($t->tx->res->dom->at('script')->{src})->status_is(200) + ->content_like(qr{\QsourceMappingURL=../../asset/0bf00b0aa8/angular.min.js.map\E}); + +$t->get_ok('/asset/0bf00b0aa8/angular.min.js.map')->status_is(200); + +$ENV{MOJO_ASSETPACK_CLEANUP} = 0; +$ENV{MOJO_MODE} = 'production'; +$t = t::Helper->t(pipes => [qw(Fetch Combine)]); +$t->app->asset->process( + 'app.js' => 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js'); + +$t->get_ok('/')->status_is(200); +$t->get_ok($t->tx->res->dom->at('script')->{src})->status_is(200) + ->content_like(qr{\QsourceMappingURL=../../asset/0bf00b0aa8/angular.min.js.map\E}); + +$t->get_ok('/asset/0bf00b0aa8/angular.min.js.map')->status_is(200); + +$ENV{MOJO_ASSETPACK_CLEANUP} = 1; + +done_testing; + +__DATA__ +@@ index.html.ep +%= asset 'app.js' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/t/google-font.t new/Mojolicious-Plugin-AssetPack-1.42/t/google-font.t --- old/Mojolicious-Plugin-AssetPack-1.41/t/google-font.t 2016-11-14 19:55:16.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/t/google-font.t 2017-04-29 14:14:11.000000000 +0200 @@ -11,7 +11,7 @@ # comment from https://github.com/hugeinc/flexboxgrid-sass/blob/master/demo/sass/_code.scss $t->get_ok($t->tx->res->dom->at('link')->{href})->status_is(200) ->header_is('Content-Type', 'text/css')->content_like(qr{font-family:\W*Roboto}) - ->content_like(qr{\Qurl(../../asset/7520cea9d1/\E.*\.ttf\)}); + ->content_like(qr{\Qurl(../../asset/\E\w+/.*\.ttf\)}); my $cache_file = File::Spec->catfile( qw(t assets cache fonts.googleapis.com css_family_Roboto_400_700)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.41/t/register.t new/Mojolicious-Plugin-AssetPack-1.42/t/register.t --- old/Mojolicious-Plugin-AssetPack-1.41/t/register.t 2016-12-16 08:46:28.000000000 +0100 +++ new/Mojolicious-Plugin-AssetPack-1.42/t/register.t 2017-04-29 13:40:52.000000000 +0200 @@ -1,3 +1,4 @@ +use lib '.'; use t::Helper; $ENV{HTTP_PROXY} = 'example.com';