Hello community,
here is the log from the commit of package perl-Mojolicious-Plugin-AssetPack for openSUSE:Factory checked in at 2017-06-29 15:04:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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"
Thu Jun 29 15:04:36 2017 rev:33 rq:504916 version:1.45
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-AssetPack/perl-Mojolicious-Plugin-AssetPack.changes 2017-05-27 13:19:45.391701726 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-AssetPack.new/perl-Mojolicious-Plugin-AssetPack.changes 2017-06-29 15:05:11.481233422 +0200
@@ -1,0 +2,18 @@
+Tue Jun 20 06:01:05 UTC 2017 - coolo@suse.com
+
+- updated to 1.45
+ see /usr/share/doc/packages/perl-Mojolicious-Plugin-AssetPack/Changes
+
+ 1.45 2017-06-19T23:49:30+0200
+ - Add Developing guide
+ - Removed deprecated method end_range() from AssetPack::Asset
+ - Removed deprecated method get_chunk() from AssetPack::Asset
+ - Removed deprecated method is_range() from AssetPack::Asset
+ - Removed deprecated method mtime() from AssetPack::Asset
+ - Removed deprecated method start_range() from AssetPack::Asset
+ - Removed deprecated method tag_helper() from AssetPack::Asset
+ - Removed MOJO_ASSETPACK_CLEANUP (only used in test suite)
+ - Can prevent AssetPack::Store from writing assetpack.db while developing
+ with MOJO_ASSETPACK_LAZY=1 (EXPERIMENTAL)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-Plugin-AssetPack-1.44.tar.gz
New:
----
Mojolicious-Plugin-AssetPack-1.45.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious-Plugin-AssetPack.spec ++++++
--- /var/tmp/diff_new_pack.X9EIwD/_old 2017-06-29 15:05:16.640503982 +0200
+++ /var/tmp/diff_new_pack.X9EIwD/_new 2017-06-29 15:05:16.640503982 +0200
@@ -17,7 +17,7 @@
Name: perl-Mojolicious-Plugin-AssetPack
-Version: 1.44
+Version: 1.45
Release: 0
%define cpan_name Mojolicious-Plugin-AssetPack
Summary: Compress and convert css, less, sass, javascript and coffeescript files
++++++ Mojolicious-Plugin-AssetPack-1.44.tar.gz -> Mojolicious-Plugin-AssetPack-1.45.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/Changes new/Mojolicious-Plugin-AssetPack-1.45/Changes
--- old/Mojolicious-Plugin-AssetPack-1.44/Changes 2017-05-21 23:02:46.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/Changes 2017-06-19 23:49:30.000000000 +0200
@@ -1,5 +1,17 @@
Revision history for perl distribution Mojolicious-Plugin-AssetPack
+1.45 2017-06-19T23:49:30+0200
+ - Add Developing guide
+ - Removed deprecated method end_range() from AssetPack::Asset
+ - Removed deprecated method get_chunk() from AssetPack::Asset
+ - Removed deprecated method is_range() from AssetPack::Asset
+ - Removed deprecated method mtime() from AssetPack::Asset
+ - Removed deprecated method start_range() from AssetPack::Asset
+ - Removed deprecated method tag_helper() from AssetPack::Asset
+ - Removed MOJO_ASSETPACK_CLEANUP (only used in test suite)
+ - Can prevent AssetPack::Store from writing assetpack.db while developing
+ with MOJO_ASSETPACK_LAZY=1 (EXPERIMENTAL)
+
1.44 2017-05-21T23:02:46+0200
- Improved documentation #125
Contributor: William Lindley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/MANIFEST new/Mojolicious-Plugin-AssetPack-1.45/MANIFEST
--- old/Mojolicious-Plugin-AssetPack-1.44/MANIFEST 2017-05-21 23:02:47.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/MANIFEST 2017-06-19 23:49:31.000000000 +0200
@@ -9,6 +9,7 @@
lib/Mojolicious/Plugin/AssetPack/Asset.pm
lib/Mojolicious/Plugin/AssetPack/Asset/Null.pm
lib/Mojolicious/Plugin/AssetPack/Guides/Cookbook.pod
+lib/Mojolicious/Plugin/AssetPack/Guides/Developing.pod
lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod
lib/Mojolicious/Plugin/AssetPack/Pipe.pm
lib/Mojolicious/Plugin/AssetPack/Pipe/CoffeeScript.pm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/META.json new/Mojolicious-Plugin-AssetPack-1.45/META.json
--- old/Mojolicious-Plugin-AssetPack-1.44/META.json 2017-05-21 23:02:47.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/META.json 2017-06-19 23:49:31.000000000 +0200
@@ -48,6 +48,6 @@
"url" : "https://github.com/jhthorsen/mojolicious-plugin-assetpack.git"
}
},
- "version" : "1.44",
+ "version" : "1.45",
"x_serialization_backend" : "JSON::PP version 2.27300_01"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/META.yml new/Mojolicious-Plugin-AssetPack-1.45/META.yml
--- old/Mojolicious-Plugin-AssetPack-1.44/META.yml 2017-05-21 23:02:47.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/META.yml 2017-06-19 23:49:31.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.44'
+version: '1.45'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/README new/Mojolicious-Plugin-AssetPack-1.45/README
--- old/Mojolicious-Plugin-AssetPack-1.44/README 2017-05-21 23:02:46.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/README 2017-06-19 23:49:30.000000000 +0200
@@ -3,7 +3,7 @@
javascript and coffeescript files
VERSION
- 1.44
+ 1.45
SYNOPSIS
Application
@@ -33,17 +33,6 @@
<body><%= content %></body>
</html>
-FOR EXISTING USERS
- Are you already using AssetPack? You can still do so without any change.
- This new version was written to make it easier to maintain and also
- easier to extend. The new code will be "activated" by loadind this
- plugin with a list of pipes:
-
- $app->plugin(AssetPack => {pipes => [...]});
-
- The old API require Mojolicious::Plugin::AssetPack::Backcompat to be
- installed.
-
DESCRIPTION
Mojolicious::Plugin::AssetPack is Mojolicious plugin for processing
static assets. The idea is that JavaScript and CSS files should be
@@ -65,44 +54,15 @@
The tutorial will give an introduction to how AssetPack can be used.
- * Mojolicious::Plugin::AssetPack::Guides::Cookbook
-
- The cookbook has various receipes on how to cook with AssetPack.
-
-ENVIRONMENT
- It is possible to set environment variables to change the behavior of
- AssetPack:
-
- * MOJO_ASSETPACK_DEBUG
-
- Set this environment variable to get more debug to STDERR. Currently
- you can set it to a value between 0 and 3, where 3 provides the most
- debug.
-
- * MOJO_ASSETPACK_LAZY
+ * Mojolicious::Plugin::AssetPack::Guides::Developing
- Set this environment variable if you want to delay processing the
- assets until they are requested. This can be very useful while
- developing when the assets are changed frequently.
+ The "developing" guide will give insight on how to do effective
+ development with AssetPack and more details about the internals in
+ this plugin.
-OPTIONAL MODULES
- There are some optional modules you might want to install:
-
- * CSS::Minifier::XS
-
- Used by Mojolicious::Plugin::AssetPack::Pipe::Css.
-
- * CSS::Sass
-
- Used by Mojolicious::Plugin::AssetPack::Pipe::Sass.
-
- * IO::Socket::SSL
-
- Required if you want to download assets served over SSL.
-
- * JavaScript::Minifier::XS
+ * Mojolicious::Plugin::AssetPack::Guides::Cookbook
- Used by Mojolicious::Plugin::AssetPack::Pipe::JavaScript.
+ The cookbook has various receipes on how to cook with AssetPack.
HELPERS
asset
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Asset.pm new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Asset.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Asset.pm 2017-01-12 20:22:26.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Asset.pm 2017-06-19 21:03:42.000000000 +0200
@@ -4,7 +4,6 @@
use Mojo::Asset::Memory;
use Mojo::URL;
use Mojo::File;
-use Mojo::Util 'deprecated';
use Mojolicious::Plugin::AssetPack::Util qw(diag has_ro DEBUG);
has checksum => sub { Mojolicious::Plugin::AssetPack::Util::checksum(shift->content) };
@@ -20,8 +19,6 @@
has minified => sub { shift->url =~ /\bmin\b/ ? 1 : 0 };
-sub tag_helper { warn "DEPRECATED in v1.17! This attribute does nothing." }
-
has _asset => sub {
my $self = shift;
return $self->content(delete $self->{content})->_asset if $self->{content};
@@ -81,21 +78,11 @@
return $self->_asset(Mojo::Asset::Memory->new->add_chunk($_[0]));
}
-sub end_range { deprecated 'end_range() is deprecated'; shift->_asset->end_range(@_) }
-sub get_chunk { deprecated 'get_chunk() is deprecated'; shift->_asset->get_chunk(@_) }
-sub is_range { deprecated 'is_range() is deprecated'; shift->_asset->is_range }
-sub mtime { deprecated 'mtime() is deprecated'; shift->_asset->mtime }
-
sub path {
$_[0]->_asset->isa('Mojo::Asset::File') ? Mojo::File->new($_[0]->_asset->path) : undef;
}
sub size { $_[0]->_asset->size }
-sub start_range {
- deprecated 'start_range() is deprecated';
- shift->_asset->start_range(@_);
-}
-
sub url_for { $_[1]->url_for(assetpack => $_[0]->TO_JSON); }
sub FROM_JSON {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Cookbook.pod new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Cookbook.pod
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Cookbook.pod 2016-11-13 17:44:56.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Cookbook.pod 2017-06-19 23:18:28.000000000 +0200
@@ -213,29 +213,10 @@
(Note that the rest of the example file above is truncated)
-=head1 BUILDING PRODUCTION ASSETS
-
-To be sure that production assets are alwasy built, you can add a unit test
-like the one below:
-
- use Test::Mojo;
- use Test::More;
-
- $ENV{MOJO_MODE} = "production";
- my $t = Test::Mojo->new("MyApp");
-
- $t->get_ok("/")
- ->element_exists(q(head link[href$="/app.css"]))
- ->element_exists(q(body script[src$="/app.js"]));
-
- done_testing;
-
-The C tests should match the topics defined when defining the
-different assets.
-
=head1 SEE ALSO
-LMojolicious::Plugin::AssetPack and
+LMojolicious::Plugin::AssetPack,
+LMojolicious::Plugin::AssetPack::Guides::Developing and
LMojolicious::Plugin::AssetPack::Guides::Tutorial.
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Developing.pod new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Developing.pod
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Developing.pod 1970-01-01 01:00:00.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Developing.pod 2017-06-19 23:38:58.000000000 +0200
@@ -0,0 +1,126 @@
+=head1 NAME
+
+Mojolicious::Plugin::AssetPack::Guides::Developing - Developing with AssetPack
+
+=head1 OVERVIEW
+
+This guide will provide a setup for effective development with
+LMojolicious::Plugin::AssetPack.
+
+=head1 GUIDE
+
+=head2 Environment variables
+
+It is possible to set environment variables to change the behavior of AssetPack:
+
+=over 2
+
+=item * MOJO_ASSETPACK_DEBUG
+
+Set this environment variable to get more debug to STDERR. Currently you can
+set it to a value between 0 and 3, where 3 provides the most debug.
+
+=item * MOJO_ASSETPACK_LAZY
+
+Set this environment variable if you want to delay processing the assets until
+they are requested. This can be very useful while developing when the assets
+are changed frequently.
+
+=back
+
+=head2 Faster development cycle
+
+For a faster development cycle, you can use
+LMojolicious::Plugin::AssetPack::Pipe::Reloader, and L.
+The combination of the two will result in a webpage that reload itself when
+a change is found in either an asset or the perl code.
+
+Example application:
+
+ use Mojolicious::Lite;
+ plugin "AssetPack" => {pipes => [qw(Css Reloader)]};
+ app->asset->process;
+ get "/" => "example";
+ app->start;
+
+ __DATA__
+ @@ assetpack.def
+ ! myapp.css
+ < main.css
+
+ @@ main.css
+ body { background: pink; }
+
+ @@ example.html.ep
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>This page will reload when changes are made</title>
+
+ %# Some asset you have defined:
+ %= asset "myapp.css"
+
+ %# See Reloader pipe for details
+ %= asset "reloader.js" if app->mode eq "development"
+ </head>
+ <body>
+ This is a reload test page!
+ </body>
+ </html>
+
+How to run the application:
+
+ $ MOJO_ASSETPACK_LAZY=1 morbo myapp.pl
+
+=head2 Enforcing production assets
+
+To be sure that production assets are built correctly, you can add a unit test
+like the one below. This is especially important if you are using
+L.
+
+ use Test::Mojo;
+ use Test::More;
+
+ $ENV{MOJO_MODE} = "production";
+ my $t = Test::Mojo->new("MyApp");
+
+ $t->get_ok("/")
+ ->element_exists(q(head link[href$="/app.css"]))
+ ->element_exists(q(body script[src$="/app.js"]));
+
+ done_testing;
+
+The C tests should match the topics defined when defining the
+different assets.
+
+=head1 Optional modules
+
+There are some optional modules you might want to install:
+
+=over 2
+
+=item * LCSS::Minifier::XS
+
+Used by LMojolicious::Plugin::AssetPack::Pipe::Css.
+
+=item * LCSS::Sass
+
+Used by LMojolicious::Plugin::AssetPack::Pipe::Sass.
+
+=item * LIO::Socket::SSL
+
+Required if you want to download assets served over SSL.
+
+=item * LJavaScript::Minifier::XS
+
+Used by LMojolicious::Plugin::AssetPack::Pipe::JavaScript.
+
+=back
+
+=head1 SEE ALSO
+
+LMojolicious::Plugin::AssetPack,
+LMojolicious::Plugin::AssetPack::Guides::Cookbook and
+LMojolicious::Plugin::AssetPack::Guides::Tutorial.
+
+=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod 2017-05-21 23:01:47.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Guides/Tutorial.pod 2017-06-19 23:18:28.000000000 +0200
@@ -325,7 +325,8 @@
=head1 SEE ALSO
-LMojolicious::Plugin::AssetPack and
+LMojolicious::Plugin::AssetPack,
+LMojolicious::Plugin::AssetPack::Guides::Developing and
LMojolicious::Plugin::AssetPack::Guides::Cookbook.
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Pipe/Reloader.pm new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Pipe/Reloader.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Pipe/Reloader.pm 2017-01-27 15:27:24.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Pipe/Reloader.pm 2017-06-19 23:28:41.000000000 +0200
@@ -119,7 +119,7 @@
$bool = $self->enabled;
This pipe is only enabled if either
-LMojolicious::Plugin::AssetPack/MOJO_ASSETPACK_LAZY is
+LMojolicious::Plugin::AssetPack::Guides::Developing/MOJO_ASSETPACK_LAZY is
set or L is "development".
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm 2017-03-15 22:06:47.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm 2017-06-19 23:28:41.000000000 +0200
@@ -225,9 +225,9 @@
Lhttps://robots.thoughtbot.com/sass-source-maps-chrome-magic for more
information about the usefulness.
-See also LMojolicious::Plugin::AssetPack/MOJO_ASSETPACK_LAZY and
-LMojolicious::Plugin::AssetPack::Pipe::Reloader for how to reload the page
-when changes are done inside the browser's dev tools.
+See also Mojolicious::Plugin::AssetPack::Guides::Developing/Faster development
+cycle> for how to reload the page when changes are done inside the browser's
+dev tools.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Store.pm new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Store.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack/Store.pm 2017-05-12 14:37:49.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack/Store.pm 2017-06-19 23:11:19.000000000 +0200
@@ -7,7 +7,8 @@
use Mojolicious::Plugin::AssetPack::Util qw(diag checksum has_ro DEBUG);
# MOJO_ASSETPACK_DB_FILE is used in tests
-use constant DB_FILE_NAME => $ENV{MOJO_ASSETPACK_DB_FILE} || 'assetpack.db';
+use constant DB_FILE => $ENV{MOJO_ASSETPACK_DB_FILE} || 'assetpack.db';
+our %DB_KEYS = map { $_ => 1 } qw(checksum format minified rel);
has default_headers => sub { +{"Cache-Control" => "max-age=31536000"} };
@@ -26,11 +27,11 @@
has_ro _db => sub {
my $self = shift;
my ($db, $key, $url) = ({});
- for my $path (reverse @{$self->_files(DB_FILE_NAME, sub {-r})}) {
+ for my $path (reverse map { path($_, DB_FILE) } @{$self->paths}) {
open my $DB, '<', $path or next;
while (my $line = <$DB>) {
($key, $url) = ($1, $2) if $line =~ /^\[([\w-]+):(.+)\]$/;
- $db->{$url}{$key}{$1} = $2 if $key and $line =~ /^(\w+)=(.*)/;
+ $db->{$url}{$key}{$1} = $2 if $key and $line =~ /^(\w+)=(.*)/ and $DB_KEYS{$1};
}
}
return $db;
@@ -83,6 +84,33 @@
return $asset;
}
+sub persist {
+ my $self = shift;
+ my $db = $self->_db;
+ my $path = path($self->paths->[0], DB_FILE);
+ my @db_keys = sort keys %DB_KEYS;
+ my $DB;
+
+ unless (open $DB, '>', $path) {
+ diag 'Save "%s" = 0 (%s)', $path, $! if DEBUG;
+ return $self;
+ }
+
+ diag 'Save "%s" = 1', $path if DEBUG;
+ for my $url (sort keys %$db) {
+ for my $key (sort keys %{$db->{$url}}) {
+ Carp::confess("Invalid key '$key'. Need to be [a-z-].") unless $key =~ /^[\w-]+$/;
+ printf $DB "[%s:%s]\n", $key, $url;
+ for my $attr (@db_keys) {
+ next unless defined $db->{$url}{$key}{$attr};
+ printf $DB "%s=%s\n", $attr, $db->{$url}{$key}{$attr};
+ }
+ }
+ }
+
+ return $self;
+}
+
sub save {
my ($self, $ref, $attrs) = @_;
my $path = path($self->paths->[0], $self->_cache_path($attrs));
@@ -94,8 +122,9 @@
return Mojolicious::Plugin::AssetPack::Asset->new(%$attrs, content => $$ref)
unless -w $dir;
- $self->_db_set($attrs);
+
$path->spurt($$ref);
+ $self->_db_set(%$attrs);
return Mojolicious::Plugin::AssetPack::Asset->new(%$attrs, path => $path);
}
@@ -116,15 +145,11 @@
my $attrs = $self->_db_get({key => 'original', url => $url}) or return undef;
my $asset;
- if ($attrs->{rel} and $asset = $self->asset($attrs->{rel})) {
- $asset->{url} = $url;
- $asset->{format} ||= $attrs->{format} if $attrs->{format};
- $asset->{mtime} ||= $attrs->{mtime} if $attrs->{mtime};
- diag 'Already downloaded: %s', $asset->url if DEBUG;
- return $asset;
- }
-
- return undef;
+ return undef unless $attrs->{rel} and $asset = $self->asset($attrs->{rel});
+ $asset->{url} = $url;
+ $asset->{format} ||= $attrs->{format} if $attrs->{format};
+ diag 'Already downloaded: %s', $asset->url if DEBUG;
+ return $asset;
}
sub _cache_path {
@@ -147,30 +172,10 @@
}
sub _db_set {
- my ($self, $attrs) = @_;
- my $db = $self->_db;
- my $path = $self->_files(DB_FILE_NAME)->[0];
- my $data = $db->{$attrs->{url}}{$attrs->{key}} ||= {};
-
- %$data = %$attrs;
- if (open my $DB, '>', $path) {
- diag 'Save "%s" = 1', $path if DEBUG;
- for my $url (sort keys %$db) {
- for my $key (sort keys %{$db->{$url}}) {
- delete $db->{$url}{$key}{$_} for qw(key name url);
- next unless my @attrs = keys %{$db->{$url}{$key}};
- Carp::confess("Invalid key '$key'. Need to be [a-z-].") unless $key =~ /^[\w-]+$/;
- printf $DB "[%s:%s]\n", $key, $url;
- for my $attr (sort @attrs) {
- next unless defined $db->{$url}{$key}{$attr};
- printf $DB "%s=%s\n", $attr, $db->{$url}{$key}{$attr};
- }
- }
- }
- }
- else {
- diag 'Save "%s" = 0 (%s)', $path, $! if DEBUG;
- }
+ my ($self, %attrs) = @_;
+ my ($key, $url) = @attrs{qw(key url)};
+ return if $ENV{MOJO_ASSETPACK_LAZY} and $key ne 'original';
+ $self->_db->{$url}{$key} = {%attrs};
}
sub _download {
@@ -202,9 +207,6 @@
$path->spurt($tx->res->body);
}
- if (my $lm = $h->last_modified) {
- $attrs->{mtime} = Mojo::Date->new($lm)->epoch;
- }
if (my $ct = $h->content_type) {
$ct =~ s!;.*$!!;
$attrs->{format} = $self->_types->detect($ct)->[0] unless $ct eq 'text/plain';
@@ -212,18 +214,11 @@
$attrs->{format} ||= $tx->req->url->path->[-1] =~ /\.(\w+)$/ ? $1 : undef;
@$attrs{qw(key rel url)} = ('original', $rel, $url);
- $self->_db_set($attrs);
+ $self->_db_set(%$attrs);
return Mojolicious::Plugin::AssetPack::Asset->new(%$attrs, path => $path) if $path;
return Mojolicious::Plugin::AssetPack::Asset->new(%$attrs)->content($tx->res->body);
}
-sub _files {
- my ($self, $name, $check) = @_;
- my @files = map { path($_, split '/', $name) } @{$self->paths};
- return [grep $check, @files] if $check;
- return \@files;
-}
-
sub _rel {
local $_ = shift->clone->scheme(undef)->to_string;
s![^\w\.\/-]!_!g;
@@ -232,15 +227,6 @@
"cache/$_";
}
-sub _reset {
- my ($self, $args) = @_;
- return unless $args->{unlink};
- local $! = 0;
- my $file = $self->_files(DB_FILE_NAME)->[0];
- unlink $file;
- diag 'unlink %s = %s', $file, $! || '1' if DEBUG;
-}
-
1;
=encoding utf8
@@ -350,6 +336,14 @@
$bool = $self->load($asset, {minified => $bool});
+=head2 persist
+
+ $self = $self->persist;
+
+Used to save the internal state of the store to disk.
+
+This method is EXPERIMENTAL, and may change without warning.
+
=head2 save
$bool = $self->save($asset, \%attr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack.pm new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/lib/Mojolicious/Plugin/AssetPack.pm 2017-05-21 23:02:46.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/lib/Mojolicious/Plugin/AssetPack.pm 2017-06-19 23:49:30.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.44';
+our $VERSION = '1.45';
my %TAG_TEMPLATE;
$TAG_TEMPLATE{css} = [qw(link rel stylesheet href)];
@@ -171,6 +171,7 @@
$self->_app->log->debug(qq(Processed asset "$topic". [@checksum])) if DEBUG;
$self->{by_checksum}{$_->checksum} = $_ for @$assets;
$self->{by_topic}{$topic} = $assets;
+ $self->store->persist;
$self;
}
@@ -215,25 +216,6 @@
->map($self->tag_for, $c, \%args, @attrs)->join("\n");
}
-sub _reset {
- my ($self, $args) = @_;
-
- diag "Reset $self." if DEBUG;
-
- if ($args->{unlink}) {
- for (@{$self->{asset_paths} || []}) {
- next unless /\bcache\b/;
- next unless -e;
- local $! = 0;
- unlink;
- diag 'unlink %s = %s', $_, $! || '1' if DEBUG;
- }
- }
-
- $self->store->_reset($args);
- delete $self->{$_} for qw(by_checksum by_topic);
-}
-
sub _serve {
my $c = shift;
my $checksum = $c->stash('checksum');
@@ -262,11 +244,6 @@
return $assets;
}
-sub DESTROY {
- my $self = shift;
- $self->_reset({unlink => 1}) if $ENV{MOJO_ASSETPACK_CLEANUP} and $self->{store};
-}
-
1;
=encoding utf8
@@ -277,7 +254,7 @@
=head1 VERSION
-1.44
+1.45
=head1 SYNOPSIS
@@ -310,17 +287,6 @@
<body><%= content %></body>
</html>
-=head1 FOR EXISTING USERS
-
-Are you already using AssetPack? You can still do so without any change. This
-new version was written to make it easier to maintain and also easier to
-extend. The new code will be "activated" by loadind this plugin with a list of
-pipes:
-
- $app->plugin(AssetPack => {pipes => [...]});
-
-The old API require LMojolicious::Plugin::AssetPack::Backcompat to be installed.
-
=head1 DESCRIPTION
LMojolicious::Plugin::AssetPack is L
@@ -346,52 +312,14 @@
The tutorial will give an introduction to how AssetPack can be used.
-=item * LMojolicious::Plugin::AssetPack::Guides::Cookbook
-
-The cookbook has various receipes on how to cook with AssetPack.
-
-=back
-
-=head1 ENVIRONMENT
+=item * LMojolicious::Plugin::AssetPack::Guides::Developing
-It is possible to set environment variables to change the behavior of AssetPack:
+The "developing" guide will give insight on how to do effective development with
+AssetPack and more details about the internals in this plugin.
-=over 2
-
-=item * MOJO_ASSETPACK_DEBUG
-
-Set this environment variable to get more debug to STDERR. Currently you can
-set it to a value between 0 and 3, where 3 provides the most debug.
-
-=item * MOJO_ASSETPACK_LAZY
-
-Set this environment variable if you want to delay processing the assets until
-they are requested. This can be very useful while developing when the assets
-are changed frequently.
-
-=back
-
-=head1 OPTIONAL MODULES
-
-There are some optional modules you might want to install:
-
-=over 2
-
-=item * LCSS::Minifier::XS
-
-Used by LMojolicious::Plugin::AssetPack::Pipe::Css.
-
-=item * LCSS::Sass
-
-Used by LMojolicious::Plugin::AssetPack::Pipe::Sass.
-
-=item * LIO::Socket::SSL
-
-Required if you want to download assets served over SSL.
-
-=item * LJavaScript::Minifier::XS
+=item * LMojolicious::Plugin::AssetPack::Guides::Cookbook
-Used by LMojolicious::Plugin::AssetPack::Pipe::JavaScript.
+The cookbook has various receipes on how to cook with AssetPack.
=back
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/00-basic.t new/Mojolicious-Plugin-AssetPack-1.45/t/00-basic.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/00-basic.t 2016-12-23 02:10:42.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/00-basic.t 2017-06-19 21:02:44.000000000 +0200
@@ -27,7 +27,6 @@
plan tests => @files * 3 + 4;
-my @deprecated = qw(end_range get_chunk is_range mtime start_range tag_helper);
for my $file (@files) {
my $module = $file;
$module =~ s,\.pm$,,;
@@ -35,8 +34,7 @@
$module =~ s,/,::,g;
ok eval "use $module; 1", "use $module" or diag $@;
Test::Pod::pod_file_ok($file);
- Test::Pod::Coverage::pod_coverage_ok($module,
- {also_private => [@deprecated, qr/^[A-Z_]+$/]});
+ Test::Pod::Coverage::pod_coverage_ok($module, {also_private => [qr/^[A-Z_]+$/]});
}
Test::CPAN::Changes::changes_file_ok();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/Helper.pm new/Mojolicious-Plugin-AssetPack-1.45/t/Helper.pm
--- old/Mojolicious-Plugin-AssetPack-1.44/t/Helper.pm 2017-01-10 23:05:38.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/Helper.pm 2017-06-19 22:15:11.000000000 +0200
@@ -1,24 +1,45 @@
package t::Helper;
use Mojo::Base -strict;
+
+use Mojo::File 'path';
+use Mojo::Util;
use Mojo::Loader;
-use Mojolicious;
use Mojolicious::Plugin::AssetPack::Util;
-use Cwd ();
-use File::Basename qw(basename dirname);
-use File::Spec;
+use Mojolicious;
use Test::Mojo;
-use Test::More;
+use Test::More ();
$ENV{MOJO_LOG_LEVEL} = $ENV{HARNESS_IS_VERBOSE} ? 'debug' : 'error';
+$ENV{TEST_HOME} = path(__FILE__)->to_abs->dirname;
+
+END { cleanup() }
+
+my %CREATED_FILES;
+
+unless ($ENV{TEST_KEEP_FILES}) {
+ my $spurt = \&Mojo::File::spurt;
+ Mojo::Util::monkey_patch(
+ 'Mojo::File' => spurt => sub {
+ $CREATED_FILES{$_[0]} = 1 unless -e $_[0];
+ goto $spurt;
+ }
+ );
+}
+
+sub cleanup {
+ $CREATED_FILES{path($ENV{TEST_HOME}, 'assets', $ENV{MOJO_ASSETPACK_DB_FILE})} = 1
+ if $ENV{MOJO_ASSETPACK_DB_FILE};
+ unlink $_ for keys %CREATED_FILES;
+}
sub t {
my $class = shift;
my $args = ref $_[0] ? shift : {@_};
my $app = Mojolicious->new;
- $ENV{MOJO_ASSETPACK_CLEANUP} //= 1; # remove generated assets
- $ENV{MOJO_ASSETPACK_DB_FILE} = sprintf '%s.db', basename $0;
- ${$app->home} = Cwd::abs_path(dirname __FILE__);
+ $ENV{MOJO_ASSETPACK_DB_FILE} = sprintf '%s.db', path($0)->basename;
+ $class->cleanup unless state $cleaned_up++;
+ ${$app->home} = $ENV{TEST_HOME};
delete $app->log->{$_} for qw(handle path);
$app->routes->get('/' => 'index');
$app->plugin(AssetPack => $args);
@@ -29,17 +50,14 @@
my $class = shift;
my $caller = caller;
- unlink glob 't/public/packed/*' unless $ENV{TEST_KEEP_FILES};
-
- strict->import;
- warnings->import;
+ Mojo::Base->import('-strict');
- eval <<" CODE" or die $@;
+ eval <<"HERE" or die $@;
package $caller;
use Test::More;
use Test::Mojo;
1;
- CODE
+HERE
}
1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/css.t new/Mojolicious-Plugin-AssetPack-1.45/t/css.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/css.t 2016-12-23 02:10:10.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/css.t 2017-06-19 21:42:41.000000000 +0200
@@ -31,9 +31,8 @@
->header_is('Cache-Control', 'max-age=31536000')->header_is('Content-Type', 'text/css')
->content_like(qr/\.one\{color.*\.two\{color.*.skipped\s\{/s);
-Mojo::Util::monkey_patch('CSS::Minifier::XS', minify => sub { die 'Nope!' });
+Mojo::Util::monkey_patch('CSS::Minifier::XS', minify => sub { die 'Not cached!' });
ok -e $file->path, 'cached file exists';
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
$t = t::Helper->t(pipes => [qw(Css Combine)]);
$t->app->asset->process('app.css' => @assets);
@@ -41,7 +40,6 @@
$t->get_ok('/inline')->status_is(200)
->content_like(qr/\.one\{color.*\.two\{color.*.skipped\s\{/s);
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/fetch-source-map.t new/Mojolicious-Plugin-AssetPack-1.45/t/fetch-source-map.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/fetch-source-map.t 2017-04-29 14:11:32.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/fetch-source-map.t 2017-06-19 21:02:44.000000000 +0200
@@ -13,8 +13,7 @@
$t->get_ok('/asset/0bf00b0aa8/angular.min.js.map')->status_is(200);
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
-$ENV{MOJO_MODE} = 'production';
+$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');
@@ -25,8 +24,6 @@
$t->get_ok('/asset/0bf00b0aa8/angular.min.js.map')->status_is(200);
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
-
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/font-awesome.t new/Mojolicious-Plugin-AssetPack-1.45/t/font-awesome.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/font-awesome.t 2017-01-11 10:44:04.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/font-awesome.t 2017-06-19 21:02:44.000000000 +0200
@@ -14,8 +14,7 @@
$t->get_ok('/asset/986eed8dca/fontawesome-webfont_v_4_5_0.eot')->status_is(200);
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
-$ENV{MOJO_MODE} = 'production';
+$ENV{MOJO_MODE} = 'production';
$t = t::Helper->t(pipes => [qw(Css Fetch Combine)]);
$t->app->asset->process('app.css' =>
'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
@@ -27,8 +26,6 @@
$t->get_ok('/asset/986eed8dca/fontawesome-webfont_v_4_5_0.eot')->status_is(200);
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
-
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/google-font.t new/Mojolicious-Plugin-AssetPack-1.45/t/google-font.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/google-font.t 2017-04-29 14:14:11.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/google-font.t 2017-06-19 22:47:31.000000000 +0200
@@ -25,6 +25,26 @@
$t2->get_ok($t2->tx->res->dom->at('link')->{href})->status_is(200)
->header_is('Content-Type', 'text/css')->content_like(qr{font-family:\W*Roboto});
+my $t3 = t::Helper->t(pipes => [qw(Css Fetch)]);
+my $db = $t3->app->asset->store->_db;
+
+is_deeply(
+ $db->{'https://fonts.googleapis.com/css?family=Roboto:400,700'},
+ {
+ original =>
+ {format => 'css', rel => 'cache/fonts.googleapis.com/css_family_Roboto_400_700'}
+ },
+ 'assetpack.db looks right'
+);
+
+for my $url (keys %$db) {
+ like $url, qr{^https?:}, "db $url";
+ for my $key (keys %{$db->{$url}}) {
+ is $key, 'original', 'db has no processed assets';
+ is_deeply [sort keys %{$db->{$url}{$key}}], [qw(format rel)], 'correct db attributes';
+ }
+}
+
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/lazy.t new/Mojolicious-Plugin-AssetPack-1.45/t/lazy.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/lazy.t 2017-01-11 11:16:57.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/lazy.t 2017-06-19 22:16:08.000000000 +0200
@@ -4,6 +4,7 @@
plan skip_all => 'cpanm CSS::Sass' unless eval 'use CSS::Sass 3.3.0;1';
my $t = t::Helper->t(pipes => [qw(Sass Css)]);
+
$t->app->asset->process('app.css' => ('sass-one.sass', 'sass-two.scss'));
$t->get_ok('/asset/5660087922/sass-one.css')->status_is(404, 'not yet compiled');
@@ -30,6 +31,9 @@
$t->get_ok('/asset/0dfb452e32/sass-two.css')->status_is(200)
->content_like(qr{body\W+background:\s*black}s);
+$t = t::Helper->t(pipes => [qw(Css Fetch)]);
+is_deeply($t->app->asset->store->_db, {}, 'nothing was stored in db');
+
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/mount.t new/Mojolicious-Plugin-AssetPack-1.45/t/mount.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/mount.t 2016-11-14 19:55:17.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/mount.t 2017-06-19 21:02:44.000000000 +0200
@@ -1,8 +1,7 @@
use lib '.';
use t::Helper;
-$ENV{MOJO_MODE} = 'development';
-$ENV{MOJO_ASSETPACK_CLEANUP} //= 1; # remove generated assets
+$ENV{MOJO_MODE} = 'development';
$ENV{MOJO_ASSETPACK_DB_FILE} = 'mount.db';
my $app = Mojolicious->new;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/recreate.t new/Mojolicious-Plugin-AssetPack-1.45/t/recreate.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/recreate.t 2017-01-11 10:30:24.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/recreate.t 2017-06-19 21:02:44.000000000 +0200
@@ -5,8 +5,6 @@
use Mojo::Loader 'data_section';
use Mojolicious::Plugin::AssetPack::Util 'checksum';
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
-
# simulate minify()
no warnings 'once';
$INC{'CSS/Minifier/XS.pm'} = 'mocked';
@@ -40,7 +38,6 @@
# reset asset
$recreate->spurt(".recreate { color: #aaa }\n");
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/register.t new/Mojolicious-Plugin-AssetPack-1.45/t/register.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/register.t 2017-04-29 13:40:52.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/register.t 2017-06-19 21:02:44.000000000 +0200
@@ -5,6 +5,8 @@
$ENV{NO_PROXY} = 'mojolicious.org';
$ENV{no_proxy} = '';
+ok !eval '$undeclared_variable=123', 'strict is enabled';
+
my $t = Test::Mojo->new(Mojolicious->new);
delete $t->app->log->{$_} for qw(path handle);
$t->app->plugin(AssetPack => {helper => 'foo', pipes => ['Css']});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/sass-unable-to-download.t new/Mojolicious-Plugin-AssetPack-1.45/t/sass-unable-to-download.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/sass-unable-to-download.t 2017-01-12 20:34:40.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/sass-unable-to-download.t 2017-06-19 21:02:44.000000000 +0200
@@ -16,8 +16,6 @@
ok + (grep {/Unable to download.*_layout\.scss/} @message), 'unable to download'
or map { diag $_ } @message;
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
-
@message = ();
$t = t::Helper->t(pipes => [qw(Sass Css)]);
$t->app->log->on(message => sub { shift; push @message, @_ });
@@ -30,8 +28,6 @@
ok !(grep {/Unable to download.*_layout\.scss/} @message), 'assets are already downloaded'
or diag join ',', @message;
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
-
done_testing;
__DATA__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/sass.t new/Mojolicious-Plugin-AssetPack-1.45/t/sass.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/sass.t 2017-02-05 23:56:19.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/sass.t 2017-06-19 21:02:44.000000000 +0200
@@ -33,12 +33,10 @@
}
Mojo::Util::monkey_patch('CSS::Sass', sass2scss => sub { die 'Nope!' });
-$ENV{MOJO_ASSETPACK_CLEANUP} = 0;
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
ok eval { $t->app->asset->process('app.css' => ('sass-one.sass', 'sass-two.scss')) },
'using cached assets'
or diag $@;
-$ENV{MOJO_ASSETPACK_CLEANUP} = 1;
# Assets from disk
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-1.44/t/util.t new/Mojolicious-Plugin-AssetPack-1.45/t/util.t
--- old/Mojolicious-Plugin-AssetPack-1.44/t/util.t 2016-04-02 21:25:40.000000000 +0200
+++ new/Mojolicious-Plugin-AssetPack-1.45/t/util.t 2017-06-19 21:02:44.000000000 +0200
@@ -1,4 +1,3 @@
-BEGIN { $ENV{TEST_DIAG} = 1 }
use Mojo::Base -strict;
use Test::Mojo;
use Test::More;