Hello community,

here is the log from the commit of package perl-Mojolicious-Plugin-AssetPack 
for openSUSE:Factory checked in at 2018-02-09 15:47:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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"

Fri Feb  9 15:47:22 2018 rev:37 rq:573983 version:2.02

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Mojolicious-Plugin-AssetPack/perl-Mojolicious-Plugin-AssetPack.changes
      2017-11-15 16:54:39.582937055 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Mojolicious-Plugin-AssetPack.new/perl-Mojolicious-Plugin-AssetPack.changes
 2018-02-09 15:47:23.335729710 +0100
@@ -1,0 +2,6 @@
+Wed Feb  7 16:52:44 UTC 2018 - co...@suse.com
+
+- updated to 2.02
+   see /usr/share/doc/packages/perl-Mojolicious-Plugin-AssetPack/Changes
+
+-------------------------------------------------------------------

Old:
----
  Mojolicious-Plugin-AssetPack-2.01.tar.gz

New:
----
  Mojolicious-Plugin-AssetPack-2.02.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Mojolicious-Plugin-AssetPack.spec ++++++
--- /var/tmp/diff_new_pack.YscRvQ/_old  2018-02-09 15:47:24.275695956 +0100
+++ /var/tmp/diff_new_pack.YscRvQ/_new  2018-02-09 15:47:24.279695813 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Mojolicious-Plugin-AssetPack
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
 
 
 Name:           perl-Mojolicious-Plugin-AssetPack
-Version:        2.01
+Version:        2.02
 Release:        0
 %define cpan_name Mojolicious-Plugin-AssetPack
 Summary:        Compress and convert css, less, sass, javascript and 
coffeescript files
 License:        Artistic-2.0
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/Mojolicious-Plugin-AssetPack/
-Source0:        
https://cpan.metacpan.org/authors/id/M/MR/MRAMBERG/%{cpan_name}-%{version}.tar.gz
+Source0:        
https://cpan.metacpan.org/authors/id/J/JH/JHTHORSEN/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ Mojolicious-Plugin-AssetPack-2.01.tar.gz -> 
Mojolicious-Plugin-AssetPack-2.02.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/Changes 
new/Mojolicious-Plugin-AssetPack-2.02/Changes
--- old/Mojolicious-Plugin-AssetPack-2.01/Changes       2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/Changes       2018-01-28 
13:12:59.000000000 +0100
@@ -1,10 +1,13 @@
 Revision history for perl distribution Mojolicious-Plugin-AssetPack
 
-2.01 2017-11-06T13:02:45+0100
+2.02 2018-01-28T13:12:59+0100
+ - Add EXPERIMENTAL support for fetching assets from helpers
 
+2.01 2017-11-06T13:02:45+0100
  - Up version number to try to fix pause indexing issues
+ - NOTE: 2.00 was a mistake. There are no major changes
 
-1.48 2017-10-29T10:20:51+0800
+2.00 2017-10-29T10:08:37+0800
  - Fix RollupJs package name #130
  - load_module() confess on error
  - Removed EXPERIMENTAL Reloader pipe
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/MANIFEST 
new/Mojolicious-Plugin-AssetPack-2.02/MANIFEST
--- old/Mojolicious-Plugin-AssetPack-2.01/MANIFEST      2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/MANIFEST      2018-01-28 
13:13:01.000000000 +0100
@@ -72,6 +72,7 @@
 t/fetch-hash.t
 t/fetch-source-map.t
 t/font-awesome.t
+t/from-helper.t
 t/google-font.t
 t/Helper.pm
 t/jpeg.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/META.json 
new/Mojolicious-Plugin-AssetPack-2.02/META.json
--- old/Mojolicious-Plugin-AssetPack-2.01/META.json     2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/META.json     2018-01-28 
13:13:01.000000000 +0100
@@ -1,10 +1,10 @@
 {
    "abstract" : "Compress and convert css, less, sass, javascript and 
coffeescript files",
    "author" : [
-      "Marcus Ramberg <marcus.ramb...@gmail.com>"
+      "Jan Henning Thorsen <jhthor...@cpan.org>"
    ],
-   "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter 
version 2.150005",
+   "dynamic_config" : 0,
+   "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "artistic_2"
    ],
@@ -21,9 +21,7 @@
    },
    "prereqs" : {
       "build" : {
-         "requires" : {
-            "Test::More" : "0.88"
-         }
+         "requires" : {}
       },
       "configure" : {
          "requires" : {
@@ -36,6 +34,11 @@
             "IPC::Run3" : "0.048",
             "Mojolicious" : "7.17"
          }
+      },
+      "test" : {
+         "requires" : {
+            "Test::More" : "0.88"
+         }
       }
    },
    "release_status" : "stable",
@@ -45,9 +48,11 @@
       },
       "homepage" : "https://github.com/jhthorsen/mojolicious-plugin-assetpack";,
       "repository" : {
-         "url" : "https://github.com/marcus/mojolicious-plugin-assetpack";
+         "type" : "git",
+         "url" : 
"https://github.com/jhthorsen/mojolicious-plugin-assetpack.git";,
+         "web" : "https://github.com/jhthorsen/mojolicious-plugin-assetpack";
       }
    },
-   "version" : "2.01",
-   "x_serialization_backend" : "JSON::PP version 2.27300"
+   "version" : "2.02",
+   "x_serialization_backend" : "JSON::PP version 2.27400_02"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/META.yml 
new/Mojolicious-Plugin-AssetPack-2.02/META.yml
--- old/Mojolicious-Plugin-AssetPack-2.01/META.yml      2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/META.yml      2018-01-28 
13:13:01.000000000 +0100
@@ -1,13 +1,13 @@
 ---
 abstract: 'Compress and convert css, less, sass, javascript and coffeescript 
files'
 author:
-  - 'Marcus Ramberg <marcus.ramb...@gmail.com>'
+  - 'Jan Henning Thorsen <jhthor...@cpan.org>'
 build_requires:
   Test::More: '0.88'
 configure_requires:
   ExtUtils::MakeMaker: '0'
-dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 
2.150005'
+dynamic_config: 0
+generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 
2.150010'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,6 +24,6 @@
 resources:
   bugtracker: https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues
   homepage: https://github.com/jhthorsen/mojolicious-plugin-assetpack
-  repository: https://github.com/marcus/mojolicious-plugin-assetpack
-version: '2.01'
+  repository: https://github.com/jhthorsen/mojolicious-plugin-assetpack.git
+version: '2.02'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/Makefile.PL 
new/Mojolicious-Plugin-AssetPack-2.02/Makefile.PL
--- old/Mojolicious-Plugin-AssetPack-2.01/Makefile.PL   2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/Makefile.PL   2018-01-28 
13:12:59.000000000 +0100
@@ -1,28 +1,43 @@
 # Generated by git-ship. See 'git-ship --man' for help or 
https://github.com/jhthorsen/app-git-ship
 use ExtUtils::MakeMaker;
-WriteMakefile(
-  NAME => 'Mojolicious::Plugin::AssetPack',
-  AUTHOR => 'Marcus Ramberg <marcus.ramb...@gmail.com>',
-  LICENSE => 'artistic_2',
-  ABSTRACT_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm',
-  VERSION_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm',
-  EXE_FILES => [qw(  )],
-  META_MERGE => {
-    resources => {
-      bugtracker => 
'https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues',
-      homepage => 'https://github.com/jhthorsen/mojolicious-plugin-assetpack',
-      repository => 'https://github.com/marcus/mojolicious-plugin-assetpack',
-    },
-  },
-  BUILD_REQUIRES => {
+my %WriteMakefileArgs = (
+  NAME           => 'Mojolicious::Plugin::AssetPack',
+  AUTHOR         => 'Jan Henning Thorsen <jhthor...@cpan.org>',
+  LICENSE        => 'artistic_2',
+  ABSTRACT_FROM  => 'lib/Mojolicious/Plugin/AssetPack.pm',
+  VERSION_FROM   => 'lib/Mojolicious/Plugin/AssetPack.pm',
+  EXE_FILES      => [qw()],
+  BUILD_REQUIRES => {}
+,
+  TEST_REQUIRES  => {
   'Test::More' => '0.88'
 }
 ,
-  PREREQ_PM => {
+  PREREQ_PM      => {
   'File::Which' => '1.21',
   'IPC::Run3' => '0.048',
   'Mojolicious' => '7.17'
 }
 ,
-  test => {TESTS => (-e 'META.yml' ? 't/*.t' : 't/*.t xt/*.t')},
+  META_MERGE     => {
+    'dynamic_config' => 0,
+    'meta-spec'      => {version => 2},
+    'resources'      => {
+      bugtracker => {web => 
'https://github.com/jhthorsen/mojolicious-plugin-assetpack/issues'},
+      homepage   => 
'https://github.com/jhthorsen/mojolicious-plugin-assetpack',
+      repository => {
+        type => 'git',
+        url  => 
'https://github.com/jhthorsen/mojolicious-plugin-assetpack.git',
+        web  => 'https://github.com/jhthorsen/mojolicious-plugin-assetpack',
+      },
+    },
+  },
+  test => {S => (-e 'META.yml' ? 't/*.t' : 't/*.t xt/*.t')},
 );
+
+unless (eval { ExtUtils::MakeMaker->VERSION('6.63_03') }) {
+  my $test_requires = delete $WriteMakefileArgs{TEST_REQUIRES};
+  @{$WriteMakefileArgs{PREREQ_PM}}{keys %$test_requires} = values 
%$test_requires;
+}
+
+WriteMakefile(%WriteMakefileArgs);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/README 
new/Mojolicious-Plugin-AssetPack-2.02/README
--- old/Mojolicious-Plugin-AssetPack-2.01/README        2017-11-06 
13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/README        2017-10-29 
03:20:51.000000000 +0100
@@ -3,7 +3,7 @@
     javascript and coffeescript files
 
 VERSION
-    2.01
+    1.48
 
 SYNOPSIS
   Application
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Mojolicious-Plugin-AssetPack-2.01/lib/Mojolicious/Plugin/AssetPack/Store.pm 
new/Mojolicious-Plugin-AssetPack-2.02/lib/Mojolicious/Plugin/AssetPack/Store.pm
--- 
old/Mojolicious-Plugin-AssetPack-2.01/lib/Mojolicious/Plugin/AssetPack/Store.pm 
    2017-11-06 12:10:29.000000000 +0100
+++ 
new/Mojolicious-Plugin-AssetPack-2.02/lib/Mojolicious/Plugin/AssetPack/Store.pm 
    2018-01-28 13:08:00.000000000 +0100
@@ -46,6 +46,7 @@
   my $asset;
 
   for my $url (ref $urls eq 'ARRAY' ? @$urls : ($urls)) {
+    return $self->_asset_from_helper(Mojo::URL->new($url)) if $url =~ 
m!^helper://!;
     for my $path (@{$paths || $self->paths}) {
       next unless $path =~ m!^https?://!;
       my $abs = Mojo::URL->new($path);
@@ -164,6 +165,21 @@
   return undef;
 }
 
+sub _asset_from_helper {
+  my ($self, $url) = @_;
+  my $app    = $self->ua->server->app;
+  my $args   = $url->query->to_hash;
+  my $helper = $app->renderer->helpers->{$url->host};
+  my $output = $app->build_controller->$helper($url->path->[0], $args);
+
+  die "[AssetPack] Unknown helper @{[$url->host]}" unless $helper;
+  my $asset
+    = $self->asset_class->new(url => $url, ref $output ? %$output : (content 
=> $output));
+
+  $asset->format($args->{format}) if $args->{format};
+  $asset;
+}
+
 sub _cache_path {
   my ($self, $attrs) = @_;
   return (
@@ -337,6 +353,21 @@
 
 =over 2
 
+=item * helper://some.mojo.helper/some_identifier?format=css
+
+Will call a helper registered under the name C<csome.mojo.helper>, with the
+query parameters as arguments. Example:
+
+  $output = $c->some->mojo->helper(some_identifier => {format => "css"});
+
+C<$output> can be a scalar containing the asset content or a hash-ref with
+arguments passed on to L<Mojolicious::Plugin::AssetPack::Asset>. Note that
+C<format> need to be present in the URL or the returning hash-ref for this
+to work.
+
+This feature is currently EXPERIMENTAL. Let me know if you use it/find it
+interesting.
+
 =item * http://example.com/foo/bar
 
 An absolute URL will be downloaded from web, unless the host is "local":
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Mojolicious-Plugin-AssetPack-2.01/lib/Mojolicious/Plugin/AssetPack.pm 
new/Mojolicious-Plugin-AssetPack-2.02/lib/Mojolicious/Plugin/AssetPack.pm
--- old/Mojolicious-Plugin-AssetPack-2.01/lib/Mojolicious/Plugin/AssetPack.pm   
2017-11-06 13:02:45.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/lib/Mojolicious/Plugin/AssetPack.pm   
2018-01-28 13:12:59.000000000 +0100
@@ -6,7 +6,7 @@
 use Mojolicious::Plugin::AssetPack::Store;
 use Mojolicious::Plugin::AssetPack::Util qw(diag has_ro load_module DEBUG);
 
-our $VERSION = '2.01';
+our $VERSION = '2.02';
 
 my %TAG_TEMPLATE;
 $TAG_TEMPLATE{css} = [qw(link rel stylesheet href)];
@@ -252,7 +252,7 @@
 
 =head1 VERSION
 
-2.01
+2.02
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-Plugin-AssetPack-2.01/t/from-helper.t 
new/Mojolicious-Plugin-AssetPack-2.02/t/from-helper.t
--- old/Mojolicious-Plugin-AssetPack-2.01/t/from-helper.t       1970-01-01 
01:00:00.000000000 +0100
+++ new/Mojolicious-Plugin-AssetPack-2.02/t/from-helper.t       2018-01-28 
12:57:38.000000000 +0100
@@ -0,0 +1,31 @@
+use lib '.';
+use t::Helper;
+
+$ENV{MOJO_MODE} = 'not_development';
+my $t = t::Helper->t(pipes => ['Combine']);
+
+$t->app->helper(
+  'some.mojo.helper' => sub {
+    my ($c, $name, $args) = @_;
+    $args->{val} ||= 'red';
+    return {content => "$name:monospace;\n", format => 'css'} unless 
$args->{format};
+    return "$name:$args->{val};\n";
+  }
+);
+
+$t->app->asset->process;
+$t->get_ok('/')->status_is(200)->element_count_is('link', 1);
+$t->get_ok($t->tx->res->dom->at('link')->{href})->status_is(200)
+  ->content_like(qr{border:1px;})->content_like(qr{color:red;})
+  ->content_like(qr{font:monospace;});
+
+done_testing;
+
+__DATA__
+@@ index.html.ep
+%= asset 'app.css'
+@@ assetpack.def
+! app.css
+< helper://some.mojo.helper/border?format=css&val=1px
+< helper://some.mojo.helper/color?format=css
+< helper://some.mojo.helper/font


Reply via email to