Hello community,
here is the log from the commit of package perl-Mojolicious for
openSUSE:Factory checked in at 2019-12-06 12:08:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Fri Dec 6 12:08:45 2019 rev:118 rq:754474 version:8.27
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes
2019-11-06 14:05:31.988750057 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.4691/perl-Mojolicious.changes
2019-12-06 12:08:53.260126543 +0100
@@ -1,0 +2,13 @@
+Thu Dec 5 03:18:03 UTC 2019 - <[email protected]>
+
+- updated to 8.27
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 8.27 2019-12-04
+ - Added EXPERIMENTAL before_command hook.
+ - Added EXPERIMENTAL scope_guard function to Mojo::Util.
+ - Removed experimental status from context method in Mojo::Log.
+ - Changed default MIME type of content_type method in Mojolicious::Types to
+ application/octet-stream. (aitap)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-8.26.tar.gz
New:
----
Mojolicious-8.27.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.L4jLxM/_old 2019-12-06 12:08:53.944126211 +0100
+++ /var/tmp/diff_new_pack.L4jLxM/_new 2019-12-06 12:08:53.944126211 +0100
@@ -17,7 +17,7 @@
Name: perl-Mojolicious
-Version: 8.26
+Version: 8.27
Release: 0
%define cpan_name Mojolicious
Summary: Real-time web framework
@@ -51,7 +51,7 @@
%prep
%setup -q -n %{cpan_name}-%{version}
-find . -type f ! -path "*/t/*" ! -name "*.pl" ! -name "*.sh" ! -path "*/bin/*"
! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
%build
perl Makefile.PL INSTALLDIRS=vendor
++++++ Mojolicious-8.26.tar.gz -> Mojolicious-8.27.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/Changes new/Mojolicious-8.27/Changes
--- old/Mojolicious-8.26/Changes 2019-11-02 17:41:48.000000000 +0100
+++ new/Mojolicious-8.27/Changes 2019-12-04 18:30:14.000000000 +0100
@@ -1,4 +1,11 @@
+8.27 2019-12-04
+ - Added EXPERIMENTAL before_command hook.
+ - Added EXPERIMENTAL scope_guard function to Mojo::Util.
+ - Removed experimental status from context method in Mojo::Log.
+ - Changed default MIME type of content_type method in Mojolicious::Types to
+ application/octet-stream. (aitap)
+
8.26 2019-11-02
- Removed deprecated slice method from Mojo::Collection.
- Moved HTML entities from Mojo::Util into a separate file. (rage311)
@@ -13,7 +20,7 @@
- Added EXPERIMENTAL cleanup event to Mojo::IOLoop::Subprocess.
- Added log helper to Mojolicious::Plugin::DefaultHelpers.
- Improved log messages generated by Mojolicious to include request ids when
- possible
+ possible.
8.23 2019-08-12
- Updated Cpanel::JSON::XS requirement to 4.09 for duplicate keys support.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/META.json
new/Mojolicious-8.27/META.json
--- old/Mojolicious-8.26/META.json 2019-11-03 16:47:38.000000000 +0100
+++ new/Mojolicious-8.27/META.json 2019-12-04 20:47:12.000000000 +0100
@@ -21,8 +21,8 @@
"t"
],
"package" : [
- "Mojo::Exception::_Guard",
- "Mojo::Server::PSGI::_IO"
+ "Mojo::Server::PSGI::_IO",
+ "Mojo::Util::_Guard"
]
},
"prereqs" : {
@@ -62,6 +62,6 @@
},
"x_IRC" : "irc://irc.freenode.net/#mojo"
},
- "version" : "8.26",
+ "version" : "8.27",
"x_serialization_backend" : "JSON::PP version 4.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/META.yml
new/Mojolicious-8.27/META.yml
--- old/Mojolicious-8.26/META.yml 2019-11-03 16:47:38.000000000 +0100
+++ new/Mojolicious-8.27/META.yml 2019-12-04 20:47:12.000000000 +0100
@@ -20,8 +20,8 @@
- examples
- t
package:
- - Mojo::Exception::_Guard
- Mojo::Server::PSGI::_IO
+ - Mojo::Util::_Guard
requires:
IO::Socket::IP: '0.37'
JSON::PP: '2.27103'
@@ -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.26'
+version: '8.27'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/Makefile.PL
new/Mojolicious-8.27/Makefile.PL
--- old/Mojolicious-8.26/Makefile.PL 2019-07-09 22:57:59.000000000 +0200
+++ new/Mojolicious-8.27/Makefile.PL 2019-12-03 22:07:30.000000000 +0100
@@ -20,7 +20,7 @@
'meta-spec' => {version => 2},
no_index => {
directory => [qw(examples t)],
- package => [qw(Mojo::Exception::_Guard Mojo::Server::PSGI::_IO)],
+ package => [qw(Mojo::Server::PSGI::_IO Mojo::Util::_Guard)],
},
prereqs => {runtime => {requires => {perl => '5.010001'}}},
resources => {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/Base.pm
new/Mojolicious-8.27/lib/Mojo/Base.pm
--- old/Mojolicious-8.26/lib/Mojo/Base.pm 2019-09-29 15:16:54.000000000
+0200
+++ new/Mojolicious-8.27/lib/Mojo/Base.pm 2019-11-25 22:39:57.000000000
+0100
@@ -153,6 +153,7 @@
sub with_roles {
Carp::croak 'Role::Tiny 2.000001+ is required for roles' unless ROLES;
my ($self, @roles) = @_;
+ return $self unless @roles;
return Role::Tiny->create_class_with_roles($self,
map { /^\+(.+)$/ ? "${self}::Role::$1" : $_ } @roles)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/Exception.pm
new/Mojolicious-8.27/lib/Mojo/Exception.pm
--- old/Mojolicious-8.26/lib/Mojo/Exception.pm 2019-09-29 15:16:40.000000000
+0200
+++ new/Mojolicious-8.27/lib/Mojo/Exception.pm 2019-12-03 21:54:28.000000000
+0100
@@ -3,7 +3,7 @@
use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1;
use Exporter 'import';
-use Mojo::Util 'decode';
+use Mojo::Util qw(decode scope_guard);
use Scalar::Util 'blessed';
has [qw(frames line lines_after lines_before)] => sub { [] };
@@ -18,8 +18,7 @@
# Finally (search backwards since it is usually at the end)
my $guard;
for (my $i = $#spec - 1; $i >= 0; $i -= 2) {
- ($guard = Mojo::Exception::_Guard->new(finally => $spec[$i + 1])) and last
- if $spec[$i] eq 'finally';
+ ($guard = scope_guard($spec[$i + 1])) and last if $spec[$i] eq 'finally';
}
return undef unless $err;
@@ -155,11 +154,6 @@
}
}
-package Mojo::Exception::_Guard;
-use Mojo::Base -base;
-
-sub DESTROY { shift->{finally}->() }
-
1;
=encoding utf8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/IOLoop/Delay.pm
new/Mojolicious-8.27/lib/Mojo/IOLoop/Delay.pm
--- old/Mojolicious-8.26/lib/Mojo/IOLoop/Delay.pm 2019-09-29
15:16:54.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojo/IOLoop/Delay.pm 2019-11-25
22:42:01.000000000 +0100
@@ -100,7 +100,7 @@
# These deep nested closures are often referred to as "Callback Hell"
Mojo::IOLoop->timer(3 => sub {
- my loop = shift;
+ my $loop = shift;
say '3 seconds';
Mojo::IOLoop->timer(3 => sub {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/IOLoop/Server.pm
new/Mojolicious-8.27/lib/Mojo/IOLoop/Server.pm
--- old/Mojolicious-8.26/lib/Mojo/IOLoop/Server.pm 2019-09-29
15:16:53.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojo/IOLoop/Server.pm 2019-11-25
22:39:55.000000000 +0100
@@ -67,7 +67,7 @@
# IP socket
else {
$options{LocalAddr} = $address;
- $options{LocalAddr} =~ s/[\[\]]//g;
+ $options{LocalAddr} =~ y/[]//d;
$options{LocalPort} = $port if $port;
$options{ReuseAddr} = 1;
$options{ReusePort} = $args->{reuse};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/Log.pm
new/Mojolicious-8.27/lib/Mojo/Log.pm
--- old/Mojolicious-8.26/lib/Mojo/Log.pm 2019-09-29 15:16:42.000000000
+0200
+++ new/Mojolicious-8.27/lib/Mojo/Log.pm 2019-12-04 18:28:24.000000000
+0100
@@ -215,13 +215,12 @@
my $new = $log->context('[extra] [information]');
Construct a new child L<Mojo::Log> object that will include context information
-with every log message. Note that this method is B<EXPERIMENTAL> and might
-change without warning!
+with every log message.
# Log with context
my $log = Mojo::Log->new;
my $context = $log->context('[17a60115]');
- $context->debug('This is a log message with context information');
+ $context->debug('This is a log message with context information');
$context->info('And another');
=head2 debug
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojo/Util.pm
new/Mojolicious-8.27/lib/Mojo/Util.pm
--- old/Mojolicious-8.26/lib/Mojo/Util.pm 2019-10-15 20:41:32.000000000
+0200
+++ new/Mojolicious-8.27/lib/Mojo/Util.pm 2019-12-03 22:00:42.000000000
+0100
@@ -75,10 +75,10 @@
qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize),
qw(decode deprecated dumper encode extract_usage getopt gunzip gzip),
qw(hmac_sha1_sum html_attr_unescape html_unescape md5_bytes md5_sum),
- qw(monkey_patch punycode_decode punycode_encode quote secure_compare),
- qw(sha1_bytes sha1_sum slugify split_cookie_header split_header steady_time),
- qw(tablify term_escape trim unindent unquote url_escape url_unescape),
- qw(xml_escape xor_encode)
+ qw(monkey_patch punycode_decode punycode_encode quote scope_guard),
+ qw(secure_compare sha1_bytes sha1_sum slugify split_cookie_header),
+ qw(split_header steady_time tablify term_escape trim unindent unquote),
+ qw(url_escape url_unescape xml_escape xor_encode)
);
# Aliases
@@ -276,6 +276,8 @@
return qq{"$str"};
}
+sub scope_guard { Mojo::Util::_Guard->new(cb => shift) }
+
sub secure_compare {
my ($one, $two) = @_;
return undef if length $one != length $two;
@@ -311,7 +313,7 @@
my @spec;
for my $row (@$rows) {
for my $i (0 .. $#$row) {
- ($row->[$i] //= '') =~ s/[\r\n]//g;
+ ($row->[$i] //= '') =~ y/\r\n//d;
my $len = length $row->[$i];
$spec[$i] = $len if $len >= ($spec[$i] // 0);
}
@@ -504,6 +506,11 @@
delete_package $class;
}
+package Mojo::Util::_Guard;
+use Mojo::Base -base;
+
+sub DESTROY { shift->{cb}() }
+
1;
=encoding utf8
@@ -766,6 +773,20 @@
Quote string.
+=head2 scope_guard
+
+ my $guard = scope_guard sub {...};
+
+Create anonymous scope guard object that will execute the passed callback when
+the object is destroyed. Note that this function is B<EXPERIMENTAL> and might
+change without warning
+
+ # Execute closure at end of scope
+ {
+ my $guard = scope_guard sub { say "Mojo!" };
+ say "Hello";
+ }
+
=head2 secure_compare
my $bool = secure_compare $str1, $str2;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojolicious/Command/get.pm
new/Mojolicious-8.27/lib/Mojolicious/Command/get.pm
--- old/Mojolicious-8.26/lib/Mojolicious/Command/get.pm 2019-09-29
15:17:03.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojolicious/Command/get.pm 2019-11-25
22:40:04.000000000 +0100
@@ -1,6 +1,7 @@
package Mojolicious::Command::get;
use Mojo::Base 'Mojolicious::Command';
+use Mojo::Collection 'c';
use Mojo::DOM;
use Mojo::IOLoop;
use Mojo::JSON qw(to_json j);
@@ -108,7 +109,7 @@
while (defined(my $command = shift @args)) {
# Number
- ($results = $results->slice($command)) and next if $command =~ /^\d+$/;
+ ($results = c($results->[$command])) and next if $command =~ /^\d+$/;
# Text
return _say($results->map('text')->each) if $command eq 'text';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojolicious/Commands.pm
new/Mojolicious-8.27/lib/Mojolicious/Commands.pm
--- old/Mojolicious-8.26/lib/Mojolicious/Commands.pm 2019-09-29
15:17:04.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojolicious/Commands.pm 2019-11-25
22:40:05.000000000 +0100
@@ -39,7 +39,7 @@
# Help
$name = shift @args if my $help = $name eq 'help';
- $help = $ENV{MOJO_HELP} ||= $help;
+ local $ENV{MOJO_HELP} = $help = $ENV{MOJO_HELP} || $help;
# Remove options shared by all commands before loading the command
_args(\@args);
@@ -51,8 +51,11 @@
unless $module;
# Run command
- my $command = $module->new(app => $self->app);
- return $help ? $command->help(@args) : $command->run(@args);
+ my $app = $self->app;
+ my $command = $module->new(app => $app);
+ return $command->help(@args) if $help;
+ $app->plugins->emit_hook(before_command => $command, \@args);
+ return $command->run(@args);
}
# Hide list for tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mojolicious-8.26/lib/Mojolicious/Guides/Rendering.pod
new/Mojolicious-8.27/lib/Mojolicious/Guides/Rendering.pod
--- old/Mojolicious-8.26/lib/Mojolicious/Guides/Rendering.pod 2019-09-25
21:21:29.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojolicious/Guides/Rendering.pod 2019-11-25
22:53:33.000000000 +0100
@@ -503,7 +503,8 @@
return unless $template eq 'exception';
# Switch to JSON rendering if content negotiation allows it
- $args->{json} = {exception => $args->{exception}} if $c->accepts('json');
+ return unless $c->accepts('json');
+ $args->{json} = {exception => $c->stash('exception')};
};
get '/' => sub { die "This sho...ALL GLORY TO THE HYPNOTOAD!\n" };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojolicious/Types.pm
new/Mojolicious-8.27/lib/Mojolicious/Types.pm
--- old/Mojolicious-8.26/lib/Mojolicious/Types.pm 2019-09-29
15:16:59.000000000 +0200
+++ new/Mojolicious-8.27/lib/Mojolicious/Types.pm 2019-11-25
22:40:01.000000000 +0100
@@ -40,7 +40,7 @@
return undef if $headers->content_type;
my $type = $o->{file} ? $self->file_type($o->{file}) :
$self->type($o->{ext});
- $headers->content_type($type // $self->type('txt'));
+ $headers->content_type($type // 'application/octet-stream');
}
sub detect {
@@ -144,9 +144,9 @@
$types->content_type(Mojolicious::Controller->new, {ext => 'json'});
Detect MIME type for L<Mojolicious::Controller> object unless a C<Content-Type>
-response header has already been set, defaults to using the MIME type for the
-C<txt> extension if no better alternative could be found. Note that this method
-is B<EXPERIMENTAL> and might change without warning!
+response header has already been set, defaults to using
+C<application/octet-stream> if no better alternative could be found. Note that
+this method is B<EXPERIMENTAL> and might change without warning!
These options are currently available:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/lib/Mojolicious.pm
new/Mojolicious-8.27/lib/Mojolicious.pm
--- old/Mojolicious-8.26/lib/Mojolicious.pm 2019-10-29 18:11:01.000000000
+0100
+++ new/Mojolicious-8.27/lib/Mojolicious.pm 2019-11-25 22:39:44.000000000
+0100
@@ -59,7 +59,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Supervillain';
-our $VERSION = '8.26';
+our $VERSION = '8.27';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
@@ -249,6 +249,20 @@
L<Mojolicious> will emit the following hooks in the listed order.
+=head2 before_command
+
+Emitted right before the application runs a command through the command line
+interface. Note that this hook is B<EXPERIMENTAL> and might change without
+warning!
+
+ $app->hook(before_command => sub {
+ my ($command, $args) = @_;
+ ...
+ });
+
+Useful for reconfiguring the application before running a command or to modify
+the behavior of a command. (Passed the command object and the command
arguments)
+
=head2 before_server_start
Emitted right before the application server is started, for web servers that
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojo/roles.t
new/Mojolicious-8.27/t/mojo/roles.t
--- old/Mojolicious-8.26/t/mojo/roles.t 2019-09-29 15:18:24.000000000 +0200
+++ new/Mojolicious-8.27/t/mojo/roles.t 2019-11-25 22:40:11.000000000 +0100
@@ -58,6 +58,16 @@
is $obj->name, 'Ted', 'attribute';
is $obj->hello, 'hello Ted', 'method';
+# Empty roles
+my $fred = Mojo::RoleTest->with_roles()->new(name => 'Fred');
+is $fred->name, 'Fred', 'attribute';
+is $fred->hello, 'hello Fred', 'method';
+
+# Empty object roles
+my $obj_empty = $obj->with_roles();
+is $obj_empty->name, 'Ted', 'attribute';
+is $obj_empty->hello, 'hello Ted', 'method';
+
# Single role
my $obj2 = Mojo::RoleTest->with_roles('Mojo::RoleTest::Role::LOUD')->new;
is $obj2->hello, 'HEY! BOB!!!', 'role method';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojo/util.t
new/Mojolicious-8.27/t/mojo/util.t
--- old/Mojolicious-8.26/t/mojo/util.t 2019-09-29 15:18:38.000000000 +0200
+++ new/Mojolicious-8.27/t/mojo/util.t 2019-12-03 22:03:21.000000000 +0100
@@ -12,9 +12,10 @@
qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize),
qw(decode dumper encode extract_usage getopt gunzip gzip hmac_sha1_sum),
qw(html_unescape html_attr_unescape md5_bytes md5_sum monkey_patch),
- qw(punycode_decode punycode_encode quote secure_compare sha1_bytes sha1_sum),
- qw(slugify split_cookie_header split_header steady_time tablify term_escape),
- qw(trim unindent unquote url_escape url_unescape xml_escape xor_encode);
+ qw(punycode_decode punycode_encode quote scope_guard secure_compare),
+ qw(sha1_bytes sha1_sum slugify split_cookie_header split_header steady_time),
+ qw(tablify term_escape trim unindent unquote url_escape url_unescape),
+ qw(xml_escape xor_encode);
# camelize
is camelize('foo_bar_baz'), 'FooBarBaz', 'right camelized result';
@@ -553,6 +554,15 @@
my $result = gunzip $compressed;
is $result, $uncompressed, 'same string';
+# scope_guard
+$test = 'a';
+{
+ my $guard = scope_guard sub { $test .= 'c' };
+ $test .= 'b';
+}
+$test .= 'd';
+is $test, 'abcd', 'right order';
+
# Hide DATA usage from error messages
eval { die 'whatever' };
unlike $@, qr/DATA/, 'DATA has been hidden';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/app.t
new/Mojolicious-8.27/t/mojolicious/app.t
--- old/Mojolicious-8.26/t/mojolicious/app.t 2019-09-29 15:18:48.000000000
+0200
+++ new/Mojolicious-8.27/t/mojolicious/app.t 2019-11-25 22:40:32.000000000
+0100
@@ -394,7 +394,7 @@
# Static file /another/file (no extension)
$t->get_ok('/another/file')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
- ->content_type_is('text/plain;charset=UTF-8')
+ ->content_type_is('application/octet-stream')
->content_like(qr/Hello Mojolicious!/);
# Static directory /another
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/commands.t
new/Mojolicious-8.27/t/mojolicious/commands.t
--- old/Mojolicious-8.26/t/mojolicious/commands.t 2019-09-29
15:18:47.000000000 +0200
+++ new/Mojolicious-8.27/t/mojolicious/commands.t 2019-11-25
22:40:32.000000000 +0100
@@ -151,14 +151,14 @@
}
like $buffer, qr/Your Mojo is working!/, 'right output';
my $template
- = '<p><%= param "just" %> <%= $c->req->headers->header("X-Test") %></p>';
+ = '<p></p><p><%= param "just" %> <%= $c->req->headers->header("X-Test")
%></p>';
$get->app->plugins->once(
before_dispatch => sub { shift->render(inline => $template) });
$buffer = '';
{
open my $handle, '>', \$buffer;
local *STDOUT = $handle;
- $get->run('-f', 'just=works', '-H', 'X-Test: fine', '/html', 'p', 'text');
+ $get->run('-f', 'just=works', '-H', 'X-Test: fine', '/html', 'p', 1, 'text');
}
like $buffer, qr/works fine/, 'right output';
$get->app->plugins->once(
@@ -406,4 +406,22 @@
like $buffer, qr/You might want to update your Mojolicious to 1000!/,
'right output';
+# Hooks
+$app = Mojolicious->new;
+$app->hook(
+ before_command => sub {
+ my ($command, $args) = @_;
+ return unless $command->isa('Mojolicious::Command::eval');
+ $command->app->config->{test} = 'works!';
+ unshift @$args, '-v';
+ }
+);
+$buffer = '';
+{
+ open my $handle, '>', \$buffer;
+ local *STDOUT = $handle;
+ $app->start('eval', 'app->config->{test}');
+}
+like $buffer, qr/works!/, 'right output';
+
done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/layouted_lite_app.t
new/Mojolicious-8.27/t/mojolicious/layouted_lite_app.t
--- old/Mojolicious-8.26/t/mojolicious/layouted_lite_app.t 2019-09-29
15:18:48.000000000 +0200
+++ new/Mojolicious-8.27/t/mojolicious/layouted_lite_app.t 2019-11-25
22:40:33.000000000 +0100
@@ -230,7 +230,7 @@
# Filter
$t->get_ok('/plain/reverse')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
- ->content_type_is('text/plain;charset=UTF-8')->content_is('oof!olleH');
+ ->content_type_is('application/octet-stream')->content_is('oof!olleH');
# Layout in render call
$t->get_ok('/outerlayout')->status_is(200)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/lite_app.t
new/Mojolicious-8.27/t/mojolicious/lite_app.t
--- old/Mojolicious-8.26/t/mojolicious/lite_app.t 2019-09-29
15:18:52.000000000 +0200
+++ new/Mojolicious-8.27/t/mojolicious/lite_app.t 2019-11-25
22:40:36.000000000 +0100
@@ -779,7 +779,7 @@
# Render static file outside of public directory
$t->get_ok('/source')->status_is(200)
- ->content_type_is('text/plain;charset=UTF-8')->header_isnt('X-Missing' => 1)
+ ->content_type_is('application/octet-stream')->header_isnt('X-Missing' => 1)
->content_like(qr!get_ok\('/source!);
# File does not exist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/static_lite_app.t
new/Mojolicious-8.27/t/mojolicious/static_lite_app.t
--- old/Mojolicious-8.26/t/mojolicious/static_lite_app.t 2019-09-29
15:18:46.000000000 +0200
+++ new/Mojolicious-8.27/t/mojolicious/static_lite_app.t 2019-11-25
22:40:30.000000000 +0100
@@ -204,7 +204,7 @@
# File
$t->get_ok('/file' => {'Range' => 'bytes=4-9'})->status_is(206)
- ->content_type_is('text/plain;charset=UTF-8')
+ ->content_type_is('application/octet-stream')
->header_is(Server => 'Mojolicious (Perl)')->content_is('answer');
# Empty file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.26/t/mojolicious/types.t
new/Mojolicious-8.27/t/mojolicious/types.t
--- old/Mojolicious-8.26/t/mojolicious/types.t 2019-09-29 15:18:45.000000000
+0200
+++ new/Mojolicious-8.27/t/mojolicious/types.t 2019-11-25 22:40:30.000000000
+0100
@@ -97,7 +97,7 @@
is $c->res->headers->content_type, 'text/html;charset=UTF-8', 'right type';
$c->res->headers->remove('Content-Type');
$t->content_type($c, {ext => 'unknown'});
-is $c->res->headers->content_type, 'text/plain;charset=UTF-8', 'right type';
+is $c->res->headers->content_type, 'application/octet-stream', 'right type';
$c->res->headers->remove('Content-Type');
$t->content_type($c, {file => 'foo/bar.png'});
is $c->res->headers->content_type, 'image/png', 'right type';