Hello community, here is the log from the commit of package perl-Minion for openSUSE:Factory checked in at 2017-06-09 15:57:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Minion (Old) and /work/SRC/openSUSE:Factory/.perl-Minion.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Minion" Fri Jun 9 15:57:53 2017 rev:25 rq:502477 version:6.06 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Minion/perl-Minion.changes 2017-04-12 18:17:21.048331110 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Minion.new/perl-Minion.changes 2017-06-09 15:57:57.698975480 +0200 @@ -1,0 +2,10 @@ +Fri Jun 9 06:00:14 UTC 2017 - co...@suse.com + +- updated to 6.06 + see /usr/share/doc/packages/perl-Minion/Changes + + 6.06 2017-06-03 + - Added an example application to demonstrate how to integrate background jobs + into well-structured Mojolicious applications. + +------------------------------------------------------------------- Old: ---- Minion-6.05.tar.gz New: ---- Minion-6.06.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Minion.spec ++++++ --- /var/tmp/diff_new_pack.jyLplK/_old 2017-06-09 15:57:58.602847906 +0200 +++ /var/tmp/diff_new_pack.jyLplK/_new 2017-06-09 15:57:58.606847342 +0200 @@ -17,7 +17,7 @@ Name: perl-Minion -Version: 6.05 +Version: 6.06 Release: 0 %define cpan_name Minion Summary: Job queue @@ -102,6 +102,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 %build %{__perl} Makefile.PL INSTALLDIRS=vendor ++++++ Minion-6.05.tar.gz -> Minion-6.06.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/Changes new/Minion-6.06/Changes --- old/Minion-6.05/Changes 2017-04-03 23:12:58.000000000 +0200 +++ new/Minion-6.06/Changes 2017-06-03 20:01:21.000000000 +0200 @@ -1,4 +1,8 @@ +6.06 2017-06-03 + - Added an example application to demonstrate how to integrate background jobs + into well-structured Mojolicious applications. + 6.05 2017-04-03 - Added support for sharing worker status information. - Improved retry methods to allow for active jobs to be retried as well. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/MANIFEST new/Minion-6.06/MANIFEST --- old/Minion-6.05/MANIFEST 2017-04-06 13:54:38.000000000 +0200 +++ new/Minion-6.06/MANIFEST 2017-06-06 00:14:54.000000000 +0200 @@ -1,4 +1,13 @@ Changes +examples/linkcheck/lib/LinkCheck.pm +examples/linkcheck/lib/LinkCheck/Controller/Links.pm +examples/linkcheck/lib/LinkCheck/Task/CheckLinks.pm +examples/linkcheck/linkcheck.conf +examples/linkcheck/script/linkcheck +examples/linkcheck/t/linkcheck.t +examples/linkcheck/templates/layouts/linkcheck.html.ep +examples/linkcheck/templates/links/index.html.ep +examples/linkcheck/templates/links/result.html.ep examples/minion_bench.pl lib/Minion.pm lib/Minion/Backend.pm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/META.json new/Minion-6.06/META.json --- old/Minion-6.05/META.json 2017-04-06 13:54:38.000000000 +0200 +++ new/Minion-6.06/META.json 2017-06-06 00:14:54.000000000 +0200 @@ -4,13 +4,13 @@ "Sebastian Riedel <s...@cpan.org>" ], "dynamic_config" : 0, - "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.28, CPAN::Meta::Converter version 2.150010", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Minion", "no_index" : { @@ -54,6 +54,6 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.05", - "x_serialization_backend" : "JSON::PP version 2.27400" + "version" : "6.06", + "x_serialization_backend" : "JSON::PP version 2.94" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/META.yml new/Minion-6.06/META.yml --- old/Minion-6.05/META.yml 2017-04-06 13:54:38.000000000 +0200 +++ new/Minion-6.06/META.yml 2017-06-06 00:14:54.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.28, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -27,5 +27,5 @@ homepage: http://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/minion.git -version: '6.05' +version: '6.06' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/lib/LinkCheck/Controller/Links.pm new/Minion-6.06/examples/linkcheck/lib/LinkCheck/Controller/Links.pm --- old/Minion-6.05/examples/linkcheck/lib/LinkCheck/Controller/Links.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/lib/LinkCheck/Controller/Links.pm 2017-06-03 20:49:10.000000000 +0200 @@ -0,0 +1,26 @@ +package LinkCheck::Controller::Links; +use Mojo::Base 'Mojolicious::Controller'; + +sub check { + my $self = shift; + + my $validation = $self->validation; + $validation->required('url'); + return $self->render(action => 'index') if $validation->has_error; + + my $id = $self->minion->enqueue(check_links => [$validation->param('url')]); + $self->redirect_to('result', id => $id); +} + +sub index { } + +sub result { + my $self = shift; + + return $self->reply->not_found + unless my $job = $self->minion->job($self->param('id')); + + $self->render(result => $job->info->{result}); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/lib/LinkCheck/Task/CheckLinks.pm new/Minion-6.06/examples/linkcheck/lib/LinkCheck/Task/CheckLinks.pm --- old/Minion-6.05/examples/linkcheck/lib/LinkCheck/Task/CheckLinks.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/lib/LinkCheck/Task/CheckLinks.pm 2017-06-03 20:40:51.000000000 +0200 @@ -0,0 +1,28 @@ +package LinkCheck::Task::CheckLinks; +use Mojo::Base 'Mojolicious::Plugin'; + +use Mojo::URL; + +sub register { + my ($self, $app) = @_; + $app->minion->add_task(check_links => \&_check_links); +} + +sub _check_links { + my ($job, $url) = @_; + + my @results; + my $ua = $job->app->ua; + my $res = $ua->get($url)->result; + push @results, [$url, $res->code]; + + for my $link ($res->dom->find('a[href]')->map(attr => 'href')->each) { + my $abs = Mojo::URL->new($link)->to_abs(Mojo::URL->new($url)); + $res = $ua->head($abs)->result; + push @results, [$link, $res->code]; + } + + $job->finish(\@results); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/lib/LinkCheck.pm new/Minion-6.06/examples/linkcheck/lib/LinkCheck.pm --- old/Minion-6.05/examples/linkcheck/lib/LinkCheck.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/lib/LinkCheck.pm 2017-06-04 15:21:04.000000000 +0200 @@ -0,0 +1,26 @@ +package LinkCheck; +use Mojo::Base 'Mojolicious'; + +sub startup { + my $self = shift; + + # Configuration + my $config = $self->plugin(Config => {file => 'linkcheck.conf'}); + $self->secrets($config->{secrets}); + + # Job queue (requires a background worker process) + # + # script/linkcheck minion worker + # + $self->plugin(Minion => {Pg => $config->{pg}}); + $self->plugin('LinkCheck::Task::CheckLinks'); + + # Controller + my $r = $self->routes; + $r->get('/' => sub { shift->redirect_to('index') }); + $r->get('/links')->to('links#index')->name('index'); + $r->post('/links')->to('links#check')->name('check'); + $r->get('/links/:id')->to('links#result')->name('result'); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/linkcheck.conf new/Minion-6.06/examples/linkcheck/linkcheck.conf --- old/Minion-6.05/examples/linkcheck/linkcheck.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/linkcheck.conf 2017-06-03 15:42:50.000000000 +0200 @@ -0,0 +1,4 @@ +{ + pg => 'postgresql://tester:testing@/test', + secrets => ['s3cret'] +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/script/linkcheck new/Minion-6.06/examples/linkcheck/script/linkcheck --- old/Minion-6.05/examples/linkcheck/script/linkcheck 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/script/linkcheck 2017-06-03 15:51:46.000000000 +0200 @@ -0,0 +1,11 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use FindBin; +BEGIN { unshift @INC, "$FindBin::Bin/../lib" } + +# Start command line interface for application +require Mojolicious::Commands; +Mojolicious::Commands->start_app('LinkCheck'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/t/linkcheck.t new/Minion-6.06/examples/linkcheck/t/linkcheck.t --- old/Minion-6.05/examples/linkcheck/t/linkcheck.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/t/linkcheck.t 2017-06-03 20:41:47.000000000 +0200 @@ -0,0 +1,43 @@ +use Mojo::Base -strict; + +use Test::More; + +# This test requires a PostgreSQL connection string for an existing database +# +# TEST_ONLINE=postgres://tester:testing@/test script/linkcheck test +# +plan skip_all => 'set TEST_ONLINE to enable this test' unless $ENV{TEST_ONLINE}; + +use Mojo::Pg; +use Mojo::URL; +use Test::Mojo; + +# Isolate tests +my $url + = Mojo::URL->new($ENV{TEST_ONLINE})->query([search_path => 'linkcheck_test']); +my $pg = Mojo::Pg->new($url); +$pg->db->query('drop schema if exists linkcheck_test cascade'); +$pg->db->query('create schema linkcheck_test'); + +# Override configuration for testing +my $t = Test::Mojo->new(LinkCheck => {pg => $url, secrets => ['test_s3cret']}); +$t->ua->max_redirects(10); + +# Enqueue a background job +$t->get_ok('/')->status_is(200)->text_is('title' => 'Check links') + ->element_exists('form input[type=url]'); +$t->post_ok('/links' => form => {url => 'http://mojolicious.org'}) + ->status_is(200)->text_is('title' => 'Result') + ->text_is('p' => 'Waiting for result...')->element_exists_not('table'); + +# Perform the background job +$t->get_ok('/links/1')->status_is(200)->text_is('title' => 'Result') + ->text_is('p' => 'Waiting for result...')->element_exists_not('table'); +$t->app->minion->perform_jobs; +$t->get_ok('/links/1')->status_is(200)->text_is('title' => 'Result') + ->element_exists_not('p')->element_exists('table'); + +# Clean up once we are done +$pg->db->query('drop schema linkcheck_test cascade'); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/templates/layouts/linkcheck.html.ep new/Minion-6.06/examples/linkcheck/templates/layouts/linkcheck.html.ep --- old/Minion-6.05/examples/linkcheck/templates/layouts/linkcheck.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/templates/layouts/linkcheck.html.ep 2017-06-03 19:50:46.000000000 +0200 @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <title><%= title %></title> + <style> + body { font: 0.9em 'Helvetica Neue', Helvetica, sans-serif } + input[type=url] { width: 300px } + input.field-with-error { border: 4px solid #f00 } + </style> + %= content_for 'header' + </head> + <body> + <h1><%= link_to 'Link Check' => 'index' %></h1> + %= content + </body> +</html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/templates/links/index.html.ep new/Minion-6.06/examples/linkcheck/templates/links/index.html.ep --- old/Minion-6.05/examples/linkcheck/templates/links/index.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/templates/links/index.html.ep 2017-06-03 19:47:14.000000000 +0200 @@ -0,0 +1,5 @@ +% layout 'linkcheck', title => 'Check links'; +%= form_for 'check' => begin + %= url_field url => 'http://mojolicious.org' + %= submit_button 'Check' +% end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/examples/linkcheck/templates/links/result.html.ep new/Minion-6.06/examples/linkcheck/templates/links/result.html.ep --- old/Minion-6.05/examples/linkcheck/templates/links/result.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ new/Minion-6.06/examples/linkcheck/templates/links/result.html.ep 2017-06-03 20:40:48.000000000 +0200 @@ -0,0 +1,24 @@ +% layout 'linkcheck', title => 'Result'; +% if (ref $result eq 'ARRAY') { + <table> + <tr> + <th>URL</th> + <th>Status</th> + </tr> + % for my $status (@$result) { + <tr> + <td><%= $status->[0] %></td> + <td><%= $status->[1] %></td> + </tr> + % } + </table> +% } +% elsif (!$result) { + % content_for header => begin + <meta http-equiv="refresh" content="3"> + % end + <p>Waiting for result...</p> +% } +% else { + %= $result +% } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Minion-6.05/lib/Minion.pm new/Minion-6.06/lib/Minion.pm --- old/Minion-6.05/lib/Minion.pm 2017-04-04 01:06:20.000000000 +0200 +++ new/Minion-6.06/lib/Minion.pm 2017-06-03 20:12:28.000000000 +0200 @@ -16,7 +16,7 @@ has remove_after => 172800; has tasks => sub { {} }; -our $VERSION = '6.05'; +our $VERSION = '6.06'; sub add_task { ($_[0]->tasks->{$_[1]} = $_[2]) and return $_[0] } @@ -215,6 +215,14 @@ # Mojolicious::Lite plugin 'MyApp::Task::PokeMojo'; +=head1 EXAMPLES + +This distribution also contains a great example application you can use for +inspiration. The +L<link checker|https://github.com/kraih/minion/tree/master/examples/linkcheck> +will show you how to integrate background jobs into well-structured +L<Mojolicious> applications. + =head1 EVENTS L<Minion> inherits all events from L<Mojo::EventEmitter> and can emit the