Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2019-02-04 14:25:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old) and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious" Mon Feb 4 14:25:36 2019 rev:106 rq:670908 version:8.12 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes 2019-01-03 18:09:56.379960343 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.28833/perl-Mojolicious.changes 2019-02-04 14:25:45.669043835 +0100 @@ -1,0 +2,12 @@ +Sat Feb 2 06:23:31 UTC 2019 - Stephan Kulow <co...@suse.com> + +- updated to 8.12 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 8.12 2019-01-27 + - Added EXPERIMENTAL timeout method to Mojo::Promise. (batman) + - Removed deprecated module Mojolicious::Plugin::PODRenderer. + - Removed deprecated method mojo_lib_dir from Mojo::Home. + - Fixed rare warning in Mojo::Log. (Grinnz) + +------------------------------------------------------------------- Old: ---- Mojolicious-8.11.tar.gz New: ---- Mojolicious-8.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.N6TXnb/_old 2019-02-04 14:25:46.321043526 +0100 +++ /var/tmp/diff_new_pack.N6TXnb/_new 2019-02-04 14:25:46.321043526 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 8.11 +Version: 8.12 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-8.11.tar.gz -> Mojolicious-8.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/Changes new/Mojolicious-8.12/Changes --- old/Mojolicious-8.11/Changes 2019-01-02 14:50:33.000000000 +0100 +++ new/Mojolicious-8.12/Changes 2019-01-31 00:20:26.000000000 +0100 @@ -1,4 +1,10 @@ +8.12 2019-01-27 + - Added EXPERIMENTAL timeout method to Mojo::Promise. (batman) + - Removed deprecated module Mojolicious::Plugin::PODRenderer. + - Removed deprecated method mojo_lib_dir from Mojo::Home. + - Fixed rare warning in Mojo::Log. (Grinnz) + 8.11 2019-01-01 - Added EXPERIMENTAL support for SameSite cookies to better protect Mojolicious applications from CSRF attacks. (dylanwh, sri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/MANIFEST new/Mojolicious-8.12/MANIFEST --- old/Mojolicious-8.11/MANIFEST 2019-01-02 19:03:59.000000000 +0100 +++ new/Mojolicious-8.12/MANIFEST 2019-02-01 17:33:33.000000000 +0100 @@ -113,7 +113,6 @@ lib/Mojolicious/Plugin/HeaderCondition.pm lib/Mojolicious/Plugin/JSONConfig.pm lib/Mojolicious/Plugin/Mount.pm -lib/Mojolicious/Plugin/PODRenderer.pm lib/Mojolicious/Plugin/TagHelpers.pm lib/Mojolicious/Plugins.pm lib/Mojolicious/Renderer.pm @@ -134,7 +133,6 @@ lib/Mojolicious/resources/templates/mojo/debug.html.ep lib/Mojolicious/resources/templates/mojo/exception.html.ep lib/Mojolicious/resources/templates/mojo/not_found.html.ep -lib/Mojolicious/resources/templates/mojo/perldoc.html.ep lib/Mojolicious/Routes.pm lib/Mojolicious/Routes/Match.pm lib/Mojolicious/Routes/Pattern.pm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/META.json new/Mojolicious-8.12/META.json --- old/Mojolicious-8.11/META.json 2019-01-02 19:03:59.000000000 +0100 +++ new/Mojolicious-8.12/META.json 2019-02-01 17:33:33.000000000 +0100 @@ -58,6 +58,6 @@ }, "x_IRC" : "irc://irc.freenode.net/#mojo" }, - "version" : "8.11", + "version" : "8.12", "x_serialization_backend" : "JSON::PP version 4.00" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/META.yml new/Mojolicious-8.12/META.yml --- old/Mojolicious-8.11/META.yml 2019-01-02 19:03:59.000000000 +0100 +++ new/Mojolicious-8.12/META.yml 2019-02-01 17:33:33.000000000 +0100 @@ -31,5 +31,5 @@ homepage: https://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/mojolicious/mojo.git -version: '8.11' +version: '8.12' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojo/Home.pm new/Mojolicious-8.12/lib/Mojo/Home.pm --- old/Mojolicious-8.11/lib/Mojo/Home.pm 2018-11-22 21:21:44.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojo/Home.pm 2019-01-27 22:24:59.000000000 +0100 @@ -1,7 +1,7 @@ package Mojo::Home; use Mojo::Base 'Mojo::File'; -use Mojo::Util qw(class_to_path deprecated); +use Mojo::Util 'class_to_path'; sub detect { my ($self, $class) = @_; @@ -21,12 +21,6 @@ return $self; } -# DEPRECATED! -sub mojo_lib_dir { - deprecated 'Mojo::Home::mojo_lib_dir is DEPRECATED'; - shift->new(__FILE__)->sibling('..'); -} - sub rel_file { shift->child(split('/', shift)) } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojo/Log.pm new/Mojolicious-8.12/lib/Mojo/Log.pm --- old/Mojolicious-8.11/lib/Mojo/Log.pm 2018-11-22 21:21:43.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojo/Log.pm 2019-01-31 01:40:50.000000000 +0100 @@ -56,7 +56,7 @@ my ($time, $level) = (shift, shift); my ($s, $m, $h, $day, $month, $year) = localtime $time; $time = sprintf '%04d-%02d-%02d %02d:%02d:%08.5f', $year + 1900, $month + 1, - $day, $h, $m, "$s." . (split /\./, $time)[1]; + $day, $h, $m, "$s." . ((split /\./, $time)[1] // 0); return "[$time] [$$] [$level] " . join "\n", @_, ''; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojo/Promise.pm new/Mojolicious-8.12/lib/Mojo/Promise.pm --- old/Mojolicious-8.11/lib/Mojo/Promise.pm 2018-12-10 21:43:34.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojo/Promise.pm 2019-01-29 14:41:50.000000000 +0100 @@ -63,6 +63,13 @@ return $new; } +sub timeout { + my ($self, $after, $err) + = (ref $_[0] ? shift : shift->new, @_, 'Promise timeout'); + $self->ioloop->timer($after => sub { $self->reject($err) }); + return $self; +} + sub wait { my $self = shift; return if (my $loop = $self->ioloop)->is_running; @@ -348,6 +355,17 @@ } ); +=head2 timeout + + my $new = Mojo::Promise->timeout(5 => 'Timeout!'); + $promise = $promise->timeout(5 => 'Timeout!'); + $promise = $promise->timeout(5); + +Create a new L<Mojo::Promise> object with a timeout or attach a timeout to an +existing promise. The promise will be rejected after the given amount of time in +seconds with a reason, which defaults to C<Promise timeout>. Note that this +method is EXPERIMENTAL and might change without warning! + =head2 wait $promise->wait; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojo/Util.pm new/Mojolicious-8.12/lib/Mojo/Util.pm --- old/Mojolicious-8.11/lib/Mojo/Util.pm 2018-11-22 21:21:46.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojo/Util.pm 2019-01-27 22:36:11.000000000 +0100 @@ -602,7 +602,8 @@ deprecated 'foo is DEPRECATED in favor of bar'; Warn about deprecated feature from perspective of caller. You can also set the -C<MOJO_FATAL_DEPRECATIONS> environment variable to make them die instead. +C<MOJO_FATAL_DEPRECATIONS> environment variable to make them die instead with +L<Carp>. =head2 dumper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojo/WebSocket.pm new/Mojolicious-8.12/lib/Mojo/WebSocket.pm --- old/Mojolicious-8.11/lib/Mojo/WebSocket.pm 2018-11-22 21:21:54.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojo/WebSocket.pm 2019-01-30 11:23:22.000000000 +0100 @@ -276,6 +276,13 @@ Opcode for C<Text> frames. +=head1 DEBUGGING + +You can set the C<MOJO_WEBSOCKET_DEBUG> environment variable to get some +advanced diagnostics information printed to C<STDERR>. + + MOJO_WEBSOCKET_DEBUG=1 + =head1 SEE ALSO L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojolicious/Plugin/PODRenderer.pm new/Mojolicious-8.12/lib/Mojolicious/Plugin/PODRenderer.pm --- old/Mojolicious-8.11/lib/Mojolicious/Plugin/PODRenderer.pm 2018-11-22 21:22:02.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojolicious/Plugin/PODRenderer.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,141 +0,0 @@ -# DEPRECATED! -package Mojolicious::Plugin::PODRenderer; -use Mojo::Base 'Mojolicious::Plugin'; - -use Mojo::Asset::File; -use Mojo::ByteStream; -use Mojo::DOM; -use Mojo::File 'path'; -use Mojo::URL; -use Mojo::Util 'deprecated'; -use Pod::Simple::XHTML; -use Pod::Simple::Search; - -sub register { - my ($self, $app, $conf) = @_; - - deprecated 'Mojolicious::Plugin::PODRenderer is DEPRECATED'; - - my $preprocess = $conf->{preprocess} || 'ep'; - $app->renderer->add_handler( - $conf->{name} || 'pod' => sub { - my ($renderer, $c, $output, $options) = @_; - $renderer->handlers->{$preprocess}($renderer, $c, $output, $options); - $$output = _pod_to_html($$output) if defined $$output; - } - ); - - $app->helper( - pod_to_html => sub { shift; Mojo::ByteStream->new(_pod_to_html(@_)) }); - - # Perldoc browser - return undef if $conf->{no_perldoc}; - my $defaults = {module => 'Mojolicious/Guides'}; - return $app->routes->any( - '/perldoc/:module' => $defaults => [module => qr/[^.]+/] => \&_perldoc); -} - -sub _indentation { - (sort map {/^(\s+)/} @{shift()})[0]; -} - -sub _html { - my ($c, $src) = @_; - - # Rewrite links - my $dom = Mojo::DOM->new(_pod_to_html($src)); - my $perldoc = $c->url_for('/perldoc/'); - $_->{href} =~ s!^https://metacpan\.org/pod/!$perldoc! - and $_->{href} =~ s!::!/!gi - for $dom->find('a[href]')->map('attr')->each; - - # Rewrite code blocks for syntax highlighting and correct indentation - for my $e ($dom->find('pre > code')->each) { - next if (my $str = $e->content) =~ /^\s*(?:\$|Usage:)\s+/m; - next unless $str =~ /[\$\@\%]\w|->\w|^use\s+\w/m; - my $attrs = $e->attr; - my $class = $attrs->{class}; - $attrs->{class} = defined $class ? "$class prettyprint" : 'prettyprint'; - } - - # Rewrite headers - my $toc = Mojo::URL->new->fragment('toc'); - my @parts; - for my $e ($dom->find('h1, h2, h3, h4')->each) { - - push @parts, [] if $e->tag eq 'h1' || !@parts; - my $link = Mojo::URL->new->fragment($e->{id}); - push @{$parts[-1]}, my $text = $e->all_text, $link; - my $permalink = $c->link_to('#' => $link, class => 'permalink'); - $e->content($permalink . $c->link_to($text => $toc)); - } - - # Try to find a title - my $title = 'Perldoc'; - $dom->find('h1 + p')->first(sub { $title = shift->text }); - - # Combine everything to a proper response - $c->content_for(perldoc => "$dom"); - $c->render('mojo/perldoc', title => $title, parts => \@parts); -} - -sub _perldoc { - my $c = shift; - - # Find module or redirect to CPAN - my $module = join '::', split('/', $c->param('module')); - $c->stash(cpan => "https://metacpan.org/pod/$module"); - my $path - = Pod::Simple::Search->new->find($module, map { $_, "$_/pods" } @INC); - return $c->redirect_to($c->stash('cpan')) unless $path && -r $path; - - my $src = path($path)->slurp; - $c->respond_to(txt => {data => $src}, html => sub { _html($c, $src) }); -} - -sub _pod_to_html { - return '' unless defined(my $pod = ref $_[0] eq 'CODE' ? shift->() : shift); - - my $parser = Pod::Simple::XHTML->new; - $parser->perldoc_url_prefix('https://metacpan.org/pod/'); - $parser->$_('') for qw(html_header html_footer); - $parser->strip_verbatim_indent(\&_indentation); - $parser->output_string(\(my $output)); - return $@ unless eval { $parser->parse_string_document("$pod"); 1 }; - - return $output; -} - -1; - -=encoding utf8 - -=head1 NAME - -Mojolicious::Plugin::PODRenderer - DEPRECATED! - -=head1 SYNOPSIS - - # DEPRECATED! - -=head1 DESCRIPTION - -This module is DEPRECATED! - -=head1 METHODS - -L<Mojolicious::Plugin::PODRenderer> inherits all methods from -L<Mojolicious::Plugin> and implements the following new ones. - -=head2 register - - my $route = $plugin->register(Mojolicious->new); - my $route = $plugin->register(Mojolicious->new, {name => 'foo'}); - -Register renderer and helper in L<Mojolicious> application. - -=head1 SEE ALSO - -L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>. - -=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojolicious/resources/templates/mojo/perldoc.html.ep new/Mojolicious-8.12/lib/Mojolicious/resources/templates/mojo/perldoc.html.ep --- old/Mojolicious-8.11/lib/Mojolicious/resources/templates/mojo/perldoc.html.ep 2019-01-01 17:39:10.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojolicious/resources/templates/mojo/perldoc.html.ep 1970-01-01 01:00:00.000000000 +0100 @@ -1,143 +0,0 @@ -%# DEPRECATED! -<!DOCTYPE html> -<html> - <head> - <title><%= $title %></title> - %= javascript '/mojo/prettify/run_prettify.js' - <style> - a { color: inherit } - a:hover { color: #2a2a2a } - a img { border: 0 } - body { - background: url(<%= url_for '/mojo/pinstripe-light.png' %>); - color: #445555; - font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; - font-weight: normal; - line-height: 1.5em; - margin: 0; - } - dd { - margin: 0; - margin-left: 2em; - } - dt { - color: #2a2a2a; - font-weight: bold; - margin-left: 0.9em; - } - :not(pre) > code { - background-color: rgba(0, 0, 0, 0.04); - border-radius: 3px; - font: 0.9em Consolas, Menlo, Monaco, Courier, monospace; - padding: 0.3em; - } - h1 { font-size: 1.5em } - h2 { font-size: 1.3em } - h3 { font-size: 1.1em } - h4 { font-size: 0.9em } - h1, h2, h3, h4 { - color: #2a2a2a; - margin: 0; - position: relative; - } - h1 a, h2 a, h3 a, h4 a { text-decoration: none } - li > p { - margin-bottom: 0; - margin-top: 0; - } - pre { - background-color: #fafafa; - border: 1px solid #c1c1c1; - border-radius: 3px; - font: 100% Consolas, Menlo, Monaco, Courier, monospace; - padding: 1em; - } - pre > code { - color: #4d4d4c; - font: 0.9em Consolas, Menlo, Monaco, Courier, monospace; - line-height: 1.5em; - text-align: left; - text-shadow: #eee 0 1px 0; - white-space: pre-wrap; - } - ul { list-style-type: square } - #footer { - padding-top: 0.5em; - text-align: center; - } - #more { - display: inline; - font-size: 0.8em; - } - #perldoc { - background-color: #fff; - border: 1px solid #c1c1c1; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - margin-left: 5em; - margin-right: 5em; - padding: 3em; - padding-top: 70px; - } - #perldoc > ul:first-of-type a { text-decoration: none } - #links { padding-bottom: 1em } - #wrapperlicious { - max-width: 1000px; - margin: 0 auto; - } - .permalink { - display: none; - left: -0.75em; - position: absolute; - padding-right: 0.25em; - } - h1:hover .permalink, h2:hover .permalink, h3:hover .permalink, - h4:hover .permalink { - display: block; - } - </style> - </head> - <body> - <div id="wrapperlicious"> - <div id="perldoc"> - <div id="links"> - % my $path; - % for my $part (split '/', $module) { - %= '::' if $path - % $path .= "/$part"; - %= link_to $part => url_for("/perldoc$path") - % } - <div id="more"> - (<%= link_to 'source' => url_for("/perldoc$path.txt") %>, - <%= link_to 'CPAN' => $cpan %>) - </div> - </div> - <h1><a id="toc">CONTENTS</a></h1> - <ul> - % for my $part (@$parts) { - <li> - %= link_to splice(@$part, 0, 2) - % if (@$part) { - <ul> - % while (@$part) { - <li><%= link_to splice(@$part, 0, 2) %></li> - % } - </ul> - % } - </li> - % } - </ul> - %= content 'perldoc' - </div> - </div> - <div id="footer"> - %= link_to 'https://mojolicious.org' => begin - <picture> - <img src="<%= url_for '/mojo/logo-black.png' %>" - srcset="<%= url_for '/mojo/logo-black-2x.png' %> 2x" - alt="Mojolicious logo"> - </picture> - % end - </div> - </body> -</html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/lib/Mojolicious.pm new/Mojolicious-8.12/lib/Mojolicious.pm --- old/Mojolicious-8.11/lib/Mojolicious.pm 2019-01-01 13:04:10.000000000 +0100 +++ new/Mojolicious-8.12/lib/Mojolicious.pm 2019-01-02 19:04:39.000000000 +0100 @@ -59,7 +59,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Supervillain'; -our $VERSION = '8.11'; +our $VERSION = '8.12'; sub BUILD_DYNAMIC { my ($class, $method, $dyn_methods) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/t/mojo/log.t new/Mojolicious-8.12/t/mojo/log.t --- old/Mojolicious-8.11/t/mojo/log.t 2018-11-22 21:22:58.000000000 +0100 +++ new/Mojolicious-8.12/t/mojo/log.t 2019-01-31 01:41:15.000000000 +0100 @@ -52,6 +52,8 @@ qr/^\[.*\] \[debug\] Test\n1\n2\n3\n$/, 'right format'; like $log->format->(time, 'error', 'I ♥ Mojolicious'), qr/^\[.*\] \[error\] I ♥ Mojolicious\n$/, 'right format'; +like $log->format->(CORE::time, 'error', 'I ♥ Mojolicious'), + qr/^\[.*\] \[error\] I ♥ Mojolicious\n$/, 'right format'; $log->format(sub { my ($time, $level, @lines) = @_; return join ':', $level, $time, @lines; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/t/mojo/promise.t new/Mojolicious-8.12/t/mojo/promise.t --- old/Mojolicious-8.11/t/mojo/promise.t 2018-11-22 21:23:00.000000000 +0100 +++ new/Mojolicious-8.12/t/mojo/promise.t 2019-01-29 14:40:35.000000000 +0100 @@ -181,6 +181,21 @@ is_deeply \@results, [], 'promises not resolved'; is_deeply \@errors, ['second'], 'promise rejected'; +# Timeout +(@errors, @results) = @_; +$promise = Mojo::Promise->timeout(0.25 => 'Timeout1'); +$promise2 = Mojo::Promise->new->timeout(0.025 => 'Timeout2'); +$promise3 + = Mojo::Promise->race($promise, $promise2)->then(sub { @results = @_ }) + ->catch(sub { @errors = @_ })->wait; +is_deeply \@results, [], 'promises not resolved'; +is_deeply \@errors, ['Timeout2'], 'promise rejected'; + +# Timeout with default message +@errors = (); +Mojo::Promise->timeout(0.025)->catch(sub { @errors = @_ })->wait; +is_deeply \@errors, ['Promise timeout'], 'default timeout message'; + # All $promise = Mojo::Promise->new->then(sub {@_}); $promise2 = Mojo::Promise->new->then(sub {@_}); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-8.11/t/pod_coverage.t new/Mojolicious-8.12/t/pod_coverage.t --- old/Mojolicious-8.11/t/pod_coverage.t 2018-11-22 21:23:09.000000000 +0100 +++ new/Mojolicious-8.12/t/pod_coverage.t 2019-01-27 22:26:17.000000000 +0100 @@ -7,5 +7,4 @@ plan skip_all => 'Test::Pod::Coverage 1.04+ required for this test!' unless eval 'use Test::Pod::Coverage 1.04; 1'; -all_pod_coverage_ok( - {also_private => ['BUILD_DYNAMIC', 'success', 'mojo_lib_dir']}); +all_pod_coverage_ok({also_private => ['BUILD_DYNAMIC', 'success']});