Hello community,
here is the log from the commit of package perl-Mojolicious for
openSUSE:Factory checked in at 2020-04-22 20:57:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Wed Apr 22 20:57:29 2020 rev:128 rq:796297 version:8.39
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes
2020-04-21 13:08:54.404601608 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.2738/perl-Mojolicious.changes
2020-04-22 20:57:31.963927760 +0200
@@ -1,0 +2,21 @@
+Wed Apr 22 13:58:16 UTC 2020 - <[email protected]>
+
+- updated to 8.39
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 8.39 2020-04-22
+ - Fixed a bug in Mojo::Server::Daemon where active connections could get
the
+ keep-alive timeout assigned instead of the inactivity timeout.
+ - Fixed a race condition in Mojo::UserAgent where test servers would close
+ connections prematurely.
+
+-------------------------------------------------------------------
+Wed Apr 22 03:10:15 UTC 2020 - <[email protected]>
+
+- updated to 8.38
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 8.38 2020-04-21
+ - Added run_p method to Mojo::IOLoop::Subprocess. (batman)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-8.37.tar.gz
New:
----
Mojolicious-8.39.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.MgeqsG/_old 2020-04-22 20:57:32.871929567 +0200
+++ /var/tmp/diff_new_pack.MgeqsG/_new 2020-04-22 20:57:32.871929567 +0200
@@ -17,7 +17,7 @@
Name: perl-Mojolicious
-Version: 8.37
+Version: 8.39
Release: 0
%define cpan_name Mojolicious
Summary: Real-time web framework
++++++ Mojolicious-8.37.tar.gz -> Mojolicious-8.39.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/Changes new/Mojolicious-8.39/Changes
--- old/Mojolicious-8.37/Changes 2020-04-19 16:34:05.000000000 +0200
+++ new/Mojolicious-8.39/Changes 2020-04-22 14:30:35.000000000 +0200
@@ -1,4 +1,13 @@
+8.39 2020-04-22
+ - Fixed a bug in Mojo::Server::Daemon where active connections could get the
+ keep-alive timeout assigned instead of the inactivity timeout.
+ - Fixed a race condition in Mojo::UserAgent where test servers would close
+ connections prematurely.
+
+8.38 2020-04-21
+ - Added run_p method to Mojo::IOLoop::Subprocess. (batman)
+
8.37 2020-04-19
- Added keep_alive_timeout attribute to Mojo::Server::Daemon.
- Added -k options to daemon and prefork commands.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/META.json
new/Mojolicious-8.39/META.json
--- old/Mojolicious-8.37/META.json 2020-04-19 21:46:49.000000000 +0200
+++ new/Mojolicious-8.39/META.json 2020-04-22 14:48:56.000000000 +0200
@@ -62,6 +62,6 @@
},
"x_IRC" : "irc://irc.freenode.net/#mojo"
},
- "version" : "8.37",
+ "version" : "8.39",
"x_serialization_backend" : "JSON::PP version 4.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/META.yml
new/Mojolicious-8.39/META.yml
--- old/Mojolicious-8.37/META.yml 2020-04-19 21:46:49.000000000 +0200
+++ new/Mojolicious-8.39/META.yml 2020-04-22 14:48:56.000000000 +0200
@@ -34,5 +34,5 @@
homepage: https://mojolicious.org
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/mojolicious/mojo.git
-version: '8.37'
+version: '8.39'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/HelloWorld.pm
new/Mojolicious-8.39/lib/Mojo/HelloWorld.pm
--- old/Mojolicious-8.37/lib/Mojo/HelloWorld.pm 2020-03-31 22:29:52.000000000
+0200
+++ new/Mojolicious-8.39/lib/Mojo/HelloWorld.pm 2020-04-21 21:48:51.000000000
+0200
@@ -25,7 +25,7 @@
=head1 DESCRIPTION
-L<Mojo::HelloWorld> is the default L<Mojolicious> application. Used mostly for
+L<Mojo::HelloWorld> is the default L<Mojolicious> application, used mostly for
testing.
=head1 ATTRIBUTES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/IOLoop/Subprocess.pm
new/Mojolicious-8.39/lib/Mojo/IOLoop/Subprocess.pm
--- old/Mojolicious-8.37/lib/Mojo/IOLoop/Subprocess.pm 2020-03-30
11:31:17.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojo/IOLoop/Subprocess.pm 2020-04-21
15:55:21.000000000 +0200
@@ -4,6 +4,7 @@
use Config;
use Mojo::IOLoop;
use Mojo::IOLoop::Stream;
+use Mojo::Promise;
use POSIX ();
use Storable;
@@ -19,6 +20,19 @@
return $self;
}
+sub run_p {
+ my ($self, $child) = @_;
+
+ my $p = Mojo::Promise->new;
+ my $parent = sub {
+ my ($self, $err) = (shift, shift);
+ $err ? $p->reject($err) : $p->resolve(@_);
+ };
+ $self->ioloop->next_tick(sub { $self->_start($child, $parent) });
+
+ return $p;
+}
+
sub _start {
my ($self, $child, $parent) = @_;
@@ -245,6 +259,24 @@
the first callback and exceptions thrown by it, will be serialized with
L<Storable>, so they can be shared between processes.
+=head2 run_p
+
+ my $promise = $subprocess->run_p(sub {...});
+
+Same as L</"run">, but returns a L<Mojo::Promise> object instead of accepting a
+second callback.
+
+ $subprocess->run_p(sub {
+ sleep 5;
+ return '♥', 'Mojolicious';
+ })->then(sub {
+ my @results = @_;
+ say "I $results[0] $results[1]!";
+ })->catch(sub {
+ my $err = shift;
+ say "Subprocess error: $err";
+ })->wait;
+
=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.37/lib/Mojo/IOLoop.pm
new/Mojolicious-8.39/lib/Mojo/IOLoop.pm
--- old/Mojolicious-8.37/lib/Mojo/IOLoop.pm 2020-04-19 16:20:16.000000000
+0200
+++ new/Mojolicious-8.39/lib/Mojo/IOLoop.pm 2020-04-21 21:48:51.000000000
+0200
@@ -545,7 +545,7 @@
my $loop = Mojo::IOLoop->singleton;
-The global L<Mojo::IOLoop> singleton. Used to access a single shared event loop
+The global L<Mojo::IOLoop> singleton, used to access a single shared event loop
object from everywhere inside the process.
# Many methods also allow you to take shortcuts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/JSON.pm
new/Mojolicious-8.39/lib/Mojo/JSON.pm
--- old/Mojolicious-8.37/lib/Mojo/JSON.pm 2020-03-31 22:30:22.000000000
+0200
+++ new/Mojolicious-8.39/lib/Mojo/JSON.pm 2020-04-21 21:48:51.000000000
+0200
@@ -364,7 +364,7 @@
my $false = false;
-False value. Used because Perl has no native equivalent.
+False value, used because Perl has no native equivalent.
=head2 from_json
@@ -393,7 +393,7 @@
my $true = true;
-True value. Used because Perl has no native equivalent.
+True value, used because Perl has no native equivalent.
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/Server/Daemon.pm
new/Mojolicious-8.39/lib/Mojo/Server/Daemon.pm
--- old/Mojolicious-8.37/lib/Mojo/Server/Daemon.pm 2020-04-19
16:28:05.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojo/Server/Daemon.pm 2020-04-22
13:53:38.000000000 +0200
@@ -157,10 +157,14 @@
return $self->_remove($id) if $tx->error || !$tx->keep_alive;
# Build new transaction for leftovers
- return $self->ioloop->stream($id)->timeout($self->keep_alive_timeout)
- unless length(my $leftovers = $tx->req->content->leftovers);
- $tx = $c->{tx} = $self->_build_tx($id, $c);
- $tx->server_read($leftovers);
+ if (length(my $leftovers = $tx->req->content->leftovers)) {
+ $tx = $c->{tx} = $self->_build_tx($id, $c);
+ $tx->server_read($leftovers);
+ }
+
+ # Keep-alive connection
+ $self->ioloop->stream($id)->timeout($self->keep_alive_timeout)
+ unless $c->{tx};
}
sub _listen {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/Transaction/HTTP.pm
new/Mojolicious-8.39/lib/Mojo/Transaction/HTTP.pm
--- old/Mojolicious-8.37/lib/Mojo/Transaction/HTTP.pm 2020-03-31
22:31:14.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojo/Transaction/HTTP.pm 2020-04-21
21:48:51.000000000 +0200
@@ -246,13 +246,13 @@
$tx->client_read($bytes);
-Read data client-side. Used to implement user agents such as
L<Mojo::UserAgent>.
+Read data client-side, used to implement user agents such as
L<Mojo::UserAgent>.
=head2 client_write
my $bytes = $tx->client_write;
-Write data client-side. Used to implement user agents such as
+Write data client-side, used to implement user agents such as
L<Mojo::UserAgent>.
=head2 is_empty
@@ -287,14 +287,14 @@
$tx->server_read($bytes);
-Read data server-side. Used to implement web servers such as
+Read data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>.
=head2 server_write
my $bytes = $tx->server_write;
-Write data server-side. Used to implement web servers such as
+Write data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>.
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/Transaction/WebSocket.pm
new/Mojolicious-8.39/lib/Mojo/Transaction/WebSocket.pm
--- old/Mojolicious-8.37/lib/Mojo/Transaction/WebSocket.pm 2020-03-31
22:31:35.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojo/Transaction/WebSocket.pm 2020-04-21
21:48:51.000000000 +0200
@@ -376,13 +376,13 @@
$ws->client_read($data);
-Read data client-side. Used to implement user agents such as
L<Mojo::UserAgent>.
+Read data client-side, used to implement user agents such as
L<Mojo::UserAgent>.
=head2 client_write
my $bytes = $ws->client_write;
-Write data client-side. Used to implement user agents such as
+Write data client-side, used to implement user agents such as
L<Mojo::UserAgent>.
=head2 closed
@@ -492,14 +492,14 @@
$ws->server_read($data);
-Read data server-side. Used to implement web servers such as
+Read data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>.
=head2 server_write
my $bytes = $ws->server_write;
-Write data server-side. Used to implement web servers such as
+Write data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>.
=head2 with_compression
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/Transaction.pm
new/Mojolicious-8.39/lib/Mojo/Transaction.pm
--- old/Mojolicious-8.37/lib/Mojo/Transaction.pm 2020-03-31
22:30:50.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojo/Transaction.pm 2020-04-21
21:48:51.000000000 +0200
@@ -194,14 +194,14 @@
$tx->client_read($bytes);
-Read data client-side. Used to implement user agents such as
L<Mojo::UserAgent>.
+Read data client-side, used to implement user agents such as
L<Mojo::UserAgent>.
Meant to be overloaded in a subclass.
=head2 client_write
my $bytes = $tx->client_write;
-Write data client-side. Used to implement user agents such as
+Write data client-side, used to implement user agents such as
L<Mojo::UserAgent>. Meant to be overloaded in a subclass.
=head2 closed
@@ -278,14 +278,14 @@
$tx->server_read($bytes);
-Read data server-side. Used to implement web servers such as
+Read data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>. Meant to be overloaded in a subclass.
=head2 server_write
my $bytes = $tx->server_write;
-Write data server-side. Used to implement web servers such as
+Write data server-side, used to implement web servers such as
L<Mojo::Server::Daemon>. Meant to be overloaded in a subclass.
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojo/UserAgent.pm
new/Mojolicious-8.39/lib/Mojo/UserAgent.pm
--- old/Mojolicious-8.37/lib/Mojo/UserAgent.pm 2020-04-19 16:28:48.000000000
+0200
+++ new/Mojolicious-8.39/lib/Mojo/UserAgent.pm 2020-04-22 14:28:48.000000000
+0200
@@ -324,7 +324,11 @@
my $max = $self->max_response_size;
$tx->res->max_message_size($max) if defined $max;
$self->emit(start => $tx);
+
+ # Allow test servers sharing the same event loop to clean up connections
+ $loop->next_tick(sub { }) or $loop->one_tick unless $loop->is_running;
return undef unless my $id = $self->_connection($loop, $tx, $cb);
+
if (my $t = $self->request_timeout) {
weaken $self;
$self->{connections}{$id}{timeout}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/cpanify.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/cpanify.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/cpanify.pm
2020-03-31 22:34:49.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/cpanify.pm
2020-04-21 21:48:51.000000000 +0200
@@ -76,14 +76,14 @@
my $description = $cpanify->description;
$cpanify = $cpanify->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $cpanify->usage;
$cpanify = $cpanify->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/app.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/app.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/app.pm
2020-03-31 22:35:32.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/app.pm
2020-04-21 21:48:51.000000000 +0200
@@ -79,14 +79,14 @@
my $description = $app->description;
$app = $app->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $app->usage;
$app = $app->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/lite_app.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/lite_app.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/lite_app.pm
2020-03-31 22:35:41.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/lite_app.pm
2020-04-21 21:48:51.000000000 +0200
@@ -49,14 +49,14 @@
my $description = $app->description;
$app = $app->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $app->usage;
$app = $app->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/makefile.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/makefile.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/makefile.pm
2020-03-31 22:35:51.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/makefile.pm
2020-04-21 21:48:51.000000000 +0200
@@ -44,14 +44,14 @@
my $description = $makefile->description;
$makefile = $makefile->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $makefile->usage;
$makefile = $makefile->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/plugin.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/plugin.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate/plugin.pm
2020-03-31 22:36:09.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate/plugin.pm
2020-04-21 21:48:51.000000000 +0200
@@ -68,14 +68,14 @@
my $description = $plugin->description;
$plugin = $plugin->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $plugin->usage;
$plugin = $plugin->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/generate.pm
2020-03-31 22:35:10.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/generate.pm
2020-04-21 21:48:51.000000000 +0200
@@ -47,7 +47,7 @@
my $description = $generator->description;
$generator = $generator->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 hint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.37/lib/Mojolicious/Command/Author/inflate.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/Author/inflate.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/Author/inflate.pm
2020-03-31 22:35:21.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/Author/inflate.pm
2020-04-21 21:48:51.000000000 +0200
@@ -70,14 +70,14 @@
my $description = $inflate->description;
$inflate = $inflate->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $inflate->usage;
$inflate = $inflate->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/cgi.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/cgi.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/cgi.pm 2020-03-31
22:33:16.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/cgi.pm 2020-04-21
21:48:51.000000000 +0200
@@ -56,14 +56,14 @@
my $description = $cgi->description;
$cgi = $cgi->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $cgi->usage;
$cgi = $cgi->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/daemon.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/daemon.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/daemon.pm 2020-04-19
16:31:12.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/daemon.pm 2020-04-21
21:48:51.000000000 +0200
@@ -88,14 +88,14 @@
my $description = $daemon->description;
$daemon = $daemon->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $daemon->usage;
$daemon = $daemon->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/eval.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/eval.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/eval.pm 2020-03-31
22:33:37.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/eval.pm 2020-04-21
21:48:51.000000000 +0200
@@ -76,14 +76,14 @@
my $description = $eval->description;
$eval = $eval->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $eval->usage;
$eval = $eval->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/get.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/get.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/get.pm 2020-04-19
16:43:00.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/get.pm 2020-04-21
21:48:51.000000000 +0200
@@ -209,14 +209,14 @@
my $description = $get->description;
$get = $get->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $get->usage;
$get = $get->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/prefork.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/prefork.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/prefork.pm 2020-04-19
16:31:47.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/prefork.pm 2020-04-21
21:48:51.000000000 +0200
@@ -106,14 +106,14 @@
my $description = $prefork->description;
$prefork = $prefork->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $prefork->usage;
$prefork = $prefork->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/psgi.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/psgi.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/psgi.pm 2020-03-31
22:34:19.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/psgi.pm 2020-04-21
21:48:51.000000000 +0200
@@ -50,14 +50,14 @@
my $description = $psgi->description;
$psgi = $psgi->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $psgi->usage;
$psgi = $psgi->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/routes.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/routes.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/routes.pm 2020-03-31
22:34:29.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/routes.pm 2020-04-21
21:48:51.000000000 +0200
@@ -95,14 +95,14 @@
my $description = $routes->description;
$routes = $routes->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $routes->usage;
$routes = $routes->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command/version.pm
new/Mojolicious-8.39/lib/Mojolicious/Command/version.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command/version.pm 2020-04-19
16:04:53.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command/version.pm 2020-04-21
21:48:51.000000000 +0200
@@ -90,14 +90,14 @@
my $description = $v->description;
$v = $v->description('Foo');
-Short description of this command. Used for the command list.
+Short description of this command, used for the command list.
=head2 usage
my $usage = $v->usage;
$v = $v->usage('Foo');
-Usage information for this command. Used for the help screen.
+Usage information for this command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Command.pm
new/Mojolicious-8.39/lib/Mojolicious/Command.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Command.pm 2020-03-31
22:33:04.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Command.pm 2020-04-21
21:48:51.000000000 +0200
@@ -139,7 +139,7 @@
my $description = $command->description;
$command = $command->description('Foo');
-Short description of command. Used for the command list.
+Short description of command, used for the command list.
=head2 quiet
@@ -161,7 +161,7 @@
my $usage = $command->usage;
$command = $command->usage('Foo');
-Usage information for command. Used for the help screen.
+Usage information for command, used for the help screen.
=head1 METHODS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Guides/Cookbook.pod
new/Mojolicious-8.39/lib/Mojolicious/Guides/Cookbook.pod
--- old/Mojolicious-8.37/lib/Mojolicious/Guides/Cookbook.pod 2020-03-30
11:30:57.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Guides/Cookbook.pod 2020-04-21
15:56:17.000000000 +0200
@@ -838,26 +838,25 @@
# Operation that would block the event loop for 5 seconds
get '/' => sub {
my $c = shift;
- Mojo::IOLoop->subprocess(
- sub {
- my $subprocess = shift;
- sleep 5;
- return '♥', 'Mojolicious';
- },
- sub {
- my ($subprocess, $err, @results) = @_;
- $c->reply->exception($err) and return if $err;
- $c->render(text => "I $results[0] $results[1]!");
- }
- );
+
+ Mojo::IOLoop->subprocess->run_p(sub {
+ sleep 5;
+ return '♥', 'Mojolicious';
+ })->then( sub {
+ my @results = @_;
+ $c->render(text => "I $results[0] $results[1]!");
+ })->catch(sub {
+ my $err = shift;
+ $c->reply->exception($err);
+ });
};
app->start;
-The first callback will be executed in a child process, without blocking the
-event loop of the parent process. The results of the first callback will then
be
-shared between both processes, and the second callback executed in the parent
-process.
+The callback passed to L<Mojo::IOLoop::Subprocess/"run_p"> will be executed in
a
+child process, without blocking the event loop of the parent process. The
+results of the callback will then be shared between both processes, and the
+promise fulfilled or rejected in the parent process.
=head2 Exceptions in non-blocking operations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Guides/Tutorial.pod
new/Mojolicious-8.39/lib/Mojolicious/Guides/Tutorial.pod
--- old/Mojolicious-8.37/lib/Mojolicious/Guides/Tutorial.pod 2020-03-30
11:30:57.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Guides/Tutorial.pod 2020-04-21
21:46:29.000000000 +0200
@@ -342,6 +342,32 @@
A list of all built-in ones can be found in
L<Mojolicious::Plugin::DefaultHelpers> and L<Mojolicious::Plugin::TagHelpers>.
+=head2 Plugins
+
+Plugins are application extensions that help with code sharing and
+organization. You can load a plugin with the keyword
+L<Mojolicious::Lite/"plugin">, which can omit the C<Mojolicious::Plugin::> part
+of the name, and optionally provide configuration for the plugin.
+
+ use Mojolicious::Lite;
+
+ plugin Config => {file => '/etc/myapp.conf', default => {foo => 'bar'}};
+
+ # Return configured foo value, or default if no configuration file
+ get '/foo' => sub {
+ my $c = shift;
+ my $foo = $c->app->config('foo');
+ $c->render(json => {foo => $foo});
+ };
+
+ app->start;
+
+L<Mojolicious::Plugin::Config> is a built-in plugin which can populate
+L<Mojolicious/"config"> using a config file. Plugins can also set up routes,
+hooks, handlers, or even load other plugins. A list of built-in plugins can be
+found at L<Mojolicious::Plugins/"PLUGINS">, and many more are available from
+L<CPAN|https://metacpan.org/search?q=Mojolicious+Plugin>.
+
=head2 Placeholders
Route placeholders allow capturing parts of a request path until a C</> or C<.>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious/Routes/Route.pm
new/Mojolicious-8.39/lib/Mojolicious/Routes/Route.pm
--- old/Mojolicious-8.37/lib/Mojolicious/Routes/Route.pm 2020-03-31
22:32:01.000000000 +0200
+++ new/Mojolicious-8.39/lib/Mojolicious/Routes/Route.pm 2020-04-21
21:48:51.000000000 +0200
@@ -247,7 +247,7 @@
my $children = $r->children;
$r = $r->children([Mojolicious::Routes::Route->new]);
-The children of this route. Used for nesting routes.
+The children of this route, used for nesting routes.
=head2 inline
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Mojolicious.pm
new/Mojolicious-8.39/lib/Mojolicious.pm
--- old/Mojolicious-8.37/lib/Mojolicious.pm 2020-04-02 11:05:32.000000000
+0200
+++ new/Mojolicious-8.39/lib/Mojolicious.pm 2020-04-21 21:53:05.000000000
+0200
@@ -59,7 +59,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Supervillain';
-our $VERSION = '8.37';
+our $VERSION = '8.39';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/lib/Test/Mojo.pm
new/Mojolicious-8.39/lib/Test/Mojo.pm
--- old/Mojolicious-8.37/lib/Test/Mojo.pm 2020-03-31 22:32:41.000000000
+0200
+++ new/Mojolicious-8.39/lib/Test/Mojo.pm 2020-04-21 21:50:08.000000000
+0200
@@ -1137,10 +1137,8 @@
$t = $t->test('is', 'first value', 'second value', 'right value');
-Use L<Test::More> functions such as C<is>, C<ok> and C<is_deeply> safely
-(telling L<Test::Builder> how far up the call stack to look when something
-fails) through L</"handler"> and store the result in L</"success">. Used to
-implement L<Test::Mojo> roles.
+Call L<Test::More> functions through L</"handler">, used to implement
+L<Test::Mojo> roles. Result is stored in L</"success">.
=head2 text_is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/t/mojo/subprocess.t
new/Mojolicious-8.39/t/mojo/subprocess.t
--- old/Mojolicious-8.37/t/mojo/subprocess.t 2020-03-30 11:31:53.000000000
+0200
+++ new/Mojolicious-8.39/t/mojo/subprocess.t 2020-04-21 15:47:56.000000000
+0200
@@ -62,6 +62,21 @@
ok !$fail, 'no error';
is_deeply $result, ['♥', [{two => 2}], 3], 'right structure';
+# Promises
+$result = [];
+$subprocess = Mojo::IOLoop::Subprocess->new;
+$subprocess->run_p(sub { return '♥', [{two => 2}], 3 })
+ ->then(sub { $result = [@_] })->wait;
+is_deeply $result, ['♥', [{two => 2}], 3], 'right structure';
+$fail = undef;
+$subprocess = Mojo::IOLoop::Subprocess->new;
+$subprocess->run_p(sub { die 'Whatever' })->catch(sub { $fail = shift })->wait;
+like $fail, qr/Whatever/, 'right error';
+$result = [];
+Mojo::IOLoop->subprocess->run_p(sub { return '♥' })
+ ->then(sub { $result = [@_] })->wait;
+is_deeply $result, ['♥'], 'right structure';
+
# Event loop in subprocess
($fail, $result) = ();
$subprocess = Mojo::IOLoop::Subprocess->new;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/t/mojo/user_agent.t
new/Mojolicious-8.39/t/mojo/user_agent.t
--- old/Mojolicious-8.37/t/mojo/user_agent.t 2020-04-19 16:29:27.000000000
+0200
+++ new/Mojolicious-8.39/t/mojo/user_agent.t 2020-04-22 14:27:42.000000000
+0200
@@ -8,6 +8,7 @@
use Test::More;
use Mojo::IOLoop;
use Mojo::Message::Request;
+use Mojo::Server::Daemon;
use Mojo::UserAgent;
use Mojo::UserAgent::Server;
use Mojo::Util qw(gzip);
@@ -489,13 +490,33 @@
'right "Content-Encoding" value';
isnt $tx->res->body, 'Hello GZip!', 'different content';
+# Keep-alive timeout in between requests
+my $daemon = Mojo::Server::Daemon->new(
+ app => app,
+ ioloop => $ua->ioloop,
+ keep_alive_timeout => 0.5,
+ listen => ['http://127.0.0.1'],
+ silent => 1
+);
+my $port = $daemon->start->ports->[0];
+$tx = $ua->get("http://127.0.0.1:$port");
+ok $tx->keep_alive, 'keep connection alive';
+is $tx->res->code, 200, 'right status';
+is $tx->res->body, 'works!', 'right content';
+sleep 1;
+$tx = $ua->get("http://127.0.0.1:$port");
+ok !$tx->kept_alive, 'kept connection not alive';
+ok $tx->keep_alive, 'keep connection alive';
+is $tx->res->code, 200, 'right status';
+is $tx->res->body, 'works!', 'right content';
+
# Fork-safety
$tx = $ua->get('/');
ok $tx->keep_alive, 'keep connection alive';
is $tx->res->body, 'works!', 'right content';
my $last = $tx->connection;
-my $port = $ua->server->url->port;
-$tx = $ua->get('/');
+$port = $ua->server->url->port;
+$tx = $ua->get('/');
is $tx->res->body, 'works!', 'right content';
is $tx->connection, $last, 'same connection';
is $ua->server->url->port, $port, 'same port';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.37/t/mojolicious/websocket_lite_app.t
new/Mojolicious-8.39/t/mojolicious/websocket_lite_app.t
--- old/Mojolicious-8.37/t/mojolicious/websocket_lite_app.t 2020-03-30
11:32:05.000000000 +0200
+++ new/Mojolicious-8.39/t/mojolicious/websocket_lite_app.t 2020-04-22
13:53:33.000000000 +0200
@@ -47,6 +47,17 @@
);
};
+websocket '/timeout' => sub {
+ my $c = shift;
+ $c->on(
+ message => sub {
+ my ($c, $msg) = @_;
+ $c->inactivity_timeout($msg) unless $msg eq 'timeout';
+ $c->send("$msg: " . Mojo::IOLoop->stream($c->tx->connection)->timeout);
+ }
+ );
+};
+
get '/plain' => {text => 'Nothing to see here!'};
websocket '/push' => sub {
@@ -202,6 +213,11 @@
ok length $payload < 10000, 'message has been compressed';
$t->finish_ok->finished_ok(1005);
+# Timeout
+$t->websocket_ok('/timeout')->send_ok('timeout')
+ ->message_ok->message_is('timeout: 30')->send_ok('120')
+ ->message_ok->message_is('120: 120')->finish_ok;
+
# Compressed message exceeding the limit when decompressed
$t->websocket_ok(
'/echo' => {'Sec-WebSocket-Extensions' => 'permessage-deflate'})