Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2015-11-22 11:01:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old) and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes 2015-11-17 14:22:52.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2015-11-22 11:03:03.000000000 +0100 @@ -1,0 +2,14 @@ +Fri Nov 20 09:46:29 UTC 2015 - co...@suse.com + +- updated to 6.32 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.32 2015-11-18 + - Deprecated Mojolicious::Routes::Pattern::format_regex. + - Added support for new HTTP status code. + - Improved router performance. + - Improved Mojo::DOM::CSS performance slightly. (jamadam) + - Fixed a few case-sensitivity and An+B notation bugs in Mojo::DOM::CSS. + (jamadam) + +------------------------------------------------------------------- Old: ---- Mojolicious-6.31.tar.gz New: ---- Mojolicious-6.32.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.ehH4gl/_old 2015-11-22 11:03:04.000000000 +0100 +++ /var/tmp/diff_new_pack.ehH4gl/_new 2015-11-22 11:03:04.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 6.31 +Version: 6.32 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-6.31.tar.gz -> Mojolicious-6.32.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/Changes new/Mojolicious-6.32/Changes --- old/Mojolicious-6.31/Changes 2015-11-13 20:54:41.000000000 +0100 +++ new/Mojolicious-6.32/Changes 2015-11-18 05:48:29.000000000 +0100 @@ -1,4 +1,12 @@ +6.32 2015-11-18 + - Deprecated Mojolicious::Routes::Pattern::format_regex. + - Added support for new HTTP status code. + - Improved router performance. + - Improved Mojo::DOM::CSS performance slightly. (jamadam) + - Fixed a few case-sensitivity and An+B notation bugs in Mojo::DOM::CSS. + (jamadam) + 6.31 2015-11-13 - Improved documentation browser CSS. - Fixed handling of invalid URLs in Mojo::UserAgent::CookieJar. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/META.json new/Mojolicious-6.32/META.json --- old/Mojolicious-6.31/META.json 2015-11-14 20:37:36.000000000 +0100 +++ new/Mojolicious-6.32/META.json 2015-11-18 19:15:02.000000000 +0100 @@ -58,5 +58,5 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.31" + "version" : "6.32" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/META.yml new/Mojolicious-6.32/META.yml --- old/Mojolicious-6.31/META.yml 2015-11-14 20:37:35.000000000 +0100 +++ new/Mojolicious-6.32/META.yml 2015-11-18 19:15:02.000000000 +0100 @@ -31,4 +31,4 @@ homepage: http://mojolicio.us license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '6.31' +version: '6.32' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/README.md new/Mojolicious-6.32/README.md --- old/Mojolicious-6.31/README.md 2015-10-08 20:29:38.000000000 +0200 +++ new/Mojolicious-6.32/README.md 2015-11-14 20:54:51.000000000 +0100 @@ -29,7 +29,7 @@ highly scalable web services. * JSON and HTML/XML parser with CSS selector support. * Fresh code based upon years of experience developing - [Catalyst](http://www.catalystframework.org). + [Catalyst](http://www.catalystframework.org), free and open source. ## Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojo/Content.pm new/Mojolicious-6.32/lib/Mojo/Content.pm --- old/Mojolicious-6.31/lib/Mojo/Content.pm 2015-11-02 13:08:18.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojo/Content.pm 2015-11-17 05:42:02.000000000 +0100 @@ -484,13 +484,13 @@ my $bool = $content->is_chunked; -Check if content is chunked. +Check if C<Transfer-Encoding> header indicates chunked tranfer encoding. =head2 is_compressed my $bool = $content->is_compressed; -Check if content is gzip compressed. +Check C<Content-Encoding> header for C<gzip> value. =head2 is_dynamic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojo/DOM/CSS.pm new/Mojolicious-6.32/lib/Mojo/DOM/CSS.pm --- old/Mojolicious-6.31/lib/Mojo/DOM/CSS.pm 2015-11-13 19:05:08.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojo/DOM/CSS.pm 2015-11-17 22:15:40.000000000 +0100 @@ -98,9 +98,23 @@ push @$last, ['attr', _name($1), _value($2 // '', $3 // $4 // $5, $6)]; } - # Pseudo-class (":not" contains more selectors) + # Pseudo-class elsif ($css =~ /\G:([\w\-]+)(?:\(((?:\([^)]+\)|[^)])+)\))?/gcs) { - push @$last, ['pc', lc $1, $1 eq 'not' ? _compile($2) : _equation($2)]; + my ($name, $args) = (lc $1, $2); + + # ":not" (contains more selectors) + $args = _compile($args) if $name eq 'not'; + + # ":nth-*" (with An+B notation) + $args = _equation($args) if $name =~ /^nth-/; + + # ":first-*" (rewrite to ":nth-*") + ($name, $args) = ("nth-$1", [0, 1]) if $name =~ /^first-(.+)$/; + + # ":last-*" (rewrite to ":nth-*") + ($name, $args) = ("nth-$name", [-1, 1]) if $name =~ /^last-/; + + push @$last, ['pc', $name, $args]; } # Tag @@ -117,7 +131,7 @@ sub _empty { $_[0][0] eq 'comment' || $_[0][0] eq 'pi' } sub _equation { - return [] unless my $equation = shift; + return [0, 0] unless my $equation = shift; # "even" return [2, 2] if $equation =~ /^\s*even\s*$/i; @@ -128,8 +142,8 @@ # "4", "+4" or "-4" return [0, $1] if $equation =~ /^\s*((?:\+|-)?\d+)\s*$/; - # "n", "4n", "+4n", "-4n", "n+1" or "4n-1" - return [] + # "n", "4n", "+4n", "-4n", "n+1", "4n-1", "+4n-1" (and other variations) + return [0, 0] unless $equation =~ /^\s*((?:\+|-)?(?:\d+)?)?n\s*((?:\+|-)\s*\d+)?\s*$/i; return [$1 eq '-' ? -1 : $1 eq '' ? 1 : $1, join('', split(' ', $2 // 0))]; } @@ -145,29 +159,23 @@ sub _pc { my ($class, $args, $current) = @_; - # ":empty" - return !grep { !_empty($_) } @$current[4 .. $#$current] if $class eq 'empty'; - - # ":root" - return $current->[3] && $current->[3][0] eq 'root' if $class eq 'root'; + # ":checked" + return exists $current->[2]{checked} || exists $current->[2]{selected} + if $class eq 'checked'; # ":not" return !_match($args, $current, $current) if $class eq 'not'; - # ":checked" - return exists $current->[2]{checked} || exists $current->[2]{selected} - if $class eq 'checked'; + # ":empty" + return !grep { !_empty($_) } @$current[4 .. $#$current] if $class eq 'empty'; - # ":first-*" or ":last-*" (rewrite with equation) - ($class, $args) = $1 ? ("nth-$class", [0, 1]) : ("nth-last-$class", [-1, 1]) - if $class =~ s/^(?:(first)|last)-//; + # ":root" + return $current->[3] && $current->[3][0] eq 'root' if $class eq 'root'; - # ":nth-*" - if ($class =~ /^nth-/) { + # ":nth-child", ":nth-last-child", ":nth-of-type" or ":nth-last-of-type" + if (ref $args) { my $type = $class =~ /of-type$/ ? $current->[1] : undef; my @siblings = @{_siblings($current, $type)}; - - # ":nth-last-*" @siblings = reverse @siblings if $class =~ /^nth-last/; for my $i (0 .. $#siblings) { @@ -177,10 +185,10 @@ } } - # ":only-*" - elsif ($class =~ /^only-(?:child|(of-type))$/) { - $_ ne $current and return undef - for @{_siblings($current, $1 ? $current->[1] : undef)}; + # ":only-child" or ":only-of-type" + elsif ($class eq 'only-child' || $class eq 'only-of-type') { + my $type = $class eq 'only-of-type' ? $current->[1] : undef; + $_ ne $current and return undef for @{_siblings($current, $type)}; return 1; } @@ -305,6 +313,7 @@ =head1 DESCRIPTION L<Mojo::DOM::CSS> is the CSS selector engine used by L<Mojo::DOM> and based on +the L<HTML Living Standard|https://html.spec.whatwg.org> as well as L<Selectors Level 3|http://www.w3.org/TR/css3-selectors/>. =head1 SELECTORS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojo/Message/Response.pm new/Mojolicious-6.32/lib/Mojo/Message/Response.pm --- old/Mojolicious-6.31/lib/Mojo/Message/Response.pm 2015-10-21 20:50:10.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojo/Message/Response.pm 2015-11-18 01:08:49.000000000 +0100 @@ -56,6 +56,7 @@ 428 => 'Precondition Required', # RFC 6585 429 => 'Too Many Requests', # RFC 6585 431 => 'Request Header Fields Too Large', # RFC 6585 + 451 => 'Unavailable For Legal Reasons', # Draft 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/cgi.pm new/Mojolicious-6.32/lib/Mojolicious/Command/cgi.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/cgi.pm 2015-10-09 20:01:54.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/cgi.pm 2015-11-18 06:17:33.000000000 +0100 @@ -25,6 +25,8 @@ Usage: APPLICATION cgi [OPTIONS] + ./myapp.pl cgi + Options: -h, --help Show this summary of available options --home <path> Path to home directory of your application, defaults to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/generate/app.pm new/Mojolicious-6.32/lib/Mojolicious/Command/generate/app.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/generate/app.pm 2015-10-09 12:35:05.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/generate/app.pm 2015-11-18 06:18:45.000000000 +0100 @@ -55,6 +55,9 @@ Usage: APPLICATION generate app [OPTIONS] [NAME] + mojo generate app + mojo generate app TestApp + Options: -h, --help Show this summary of available options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/generate/lite_app.pm new/Mojolicious-6.32/lib/Mojolicious/Command/generate/lite_app.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/generate/lite_app.pm 2015-10-09 12:34:45.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/generate/lite_app.pm 2015-11-18 06:18:32.000000000 +0100 @@ -23,6 +23,9 @@ Usage: APPLICATION generate lite_app [OPTIONS] [NAME] + mojo generate lite_app + mojo generate lite_app foo.pl + Options: -h, --help Show this summary of available options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/generate/makefile.pm new/Mojolicious-6.32/lib/Mojolicious/Command/generate/makefile.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/generate/makefile.pm 2015-10-09 12:35:19.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/generate/makefile.pm 2015-11-18 06:18:58.000000000 +0100 @@ -20,6 +20,8 @@ Usage: APPLICATION generate makefile [OPTIONS] + mojo generate makefile + Options: -h, --help Show this summary of available options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/generate/plugin.pm new/Mojolicious-6.32/lib/Mojolicious/Command/generate/plugin.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/generate/plugin.pm 2015-10-09 12:35:34.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/generate/plugin.pm 2015-11-18 06:19:30.000000000 +0100 @@ -37,6 +37,9 @@ Usage: APPLICATION generate plugin [OPTIONS] [NAME] + mojo generate plugin + mojo generate plugin TestPlugin + Options: -h, --help Show this summary of available options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/generate.pm new/Mojolicious-6.32/lib/Mojolicious/Command/generate.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/generate.pm 2015-10-09 12:42:08.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/generate.pm 2015-11-18 06:23:17.000000000 +0100 @@ -24,6 +24,9 @@ Usage: APPLICATION generate GENERATOR [OPTIONS] + mojo generate app + mojo generate lite_app + =head1 DESCRIPTION L<Mojolicious::Command::generate> lists available generators. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/inflate.pm new/Mojolicious-6.32/lib/Mojolicious/Command/inflate.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/inflate.pm 2015-10-09 20:04:05.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/inflate.pm 2015-11-18 06:23:32.000000000 +0100 @@ -40,6 +40,8 @@ Usage: APPLICATION inflate [OPTIONS] + ./myapp.pl inflate + Options: -h, --help Show this summary of available options --home <path> Path to home directory of your application, defaults to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/psgi.pm new/Mojolicious-6.32/lib/Mojolicious/Command/psgi.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/psgi.pm 2015-10-09 20:03:36.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/psgi.pm 2015-11-18 06:23:53.000000000 +0100 @@ -20,6 +20,8 @@ Usage: APPLICATION psgi [OPTIONS] + ./myapp.pl psgi + Options: -h, --help Show this summary of available options --home <path> Path to home directory of your application, defaults to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/routes.pm new/Mojolicious-6.32/lib/Mojolicious/Command/routes.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/routes.pm 2015-10-09 20:03:25.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/routes.pm 2015-11-18 06:19:33.000000000 +0100 @@ -45,9 +45,7 @@ # Regex (verbose) my $pattern = $route->pattern; $pattern->match('/', $route->is_endpoint && !$partial); - my $regex = (regexp_pattern $pattern->regex)[0]; - my $format = (regexp_pattern($pattern->format_regex))[0]; - push @$row, $regex, $format ? $format : '' if $verbose; + push @$row, (regexp_pattern $pattern->regex)[0] if $verbose; $depth++; _walk($_, $depth, $rows, $verbose) for @{$route->children}; @@ -66,6 +64,9 @@ Usage: APPLICATION routes [OPTIONS] + ./myapp.pl routes + ./myapp.pl routes -v + Options: -h, --help Show this summary of available options --home <path> Path to home directory of your application, defaults to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Command/version.pm new/Mojolicious-6.32/lib/Mojolicious/Command/version.pm --- old/Mojolicious-6.31/lib/Mojolicious/Command/version.pm 2015-10-09 12:51:01.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Command/version.pm 2015-11-18 06:24:11.000000000 +0100 @@ -55,6 +55,8 @@ Usage: APPLICATION version [OPTIONS] + mojo version + Options: -h, --help Show this summary of available options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Commands.pm new/Mojolicious-6.32/lib/Mojolicious/Commands.pm --- old/Mojolicious-6.31/lib/Mojolicious/Commands.pm 2015-11-12 20:05:36.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Commands.pm 2015-11-18 07:37:57.000000000 +0100 @@ -106,6 +106,12 @@ Usage: APPLICATION COMMAND [OPTIONS] + mojo version + mojo generate lite_app + ./myapp.pl daemon -m production -l http://*:8080 + ./myapp.pl get /foo + ./myapp.pl routes -v + Tip: CGI and PSGI environments can be automatically detected very often and work without commands. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Controller.pm new/Mojolicious-6.32/lib/Mojolicious/Controller.pm --- old/Mojolicious-6.31/lib/Mojolicious/Controller.pm 2015-10-29 17:27:53.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Controller.pm 2015-11-18 07:29:53.000000000 +0100 @@ -168,7 +168,7 @@ my $plugins = $app->plugins->emit_hook(before_render => $self, $args); my $maybe = delete $args->{'mojo.maybe'}; - my $ts = $args->{'mojo.to_string'}; + my $ts = $args->{'mojo.string'}; my ($output, $format) = $app->renderer->render($self, $args); # Maybe no 404 @@ -187,7 +187,7 @@ sub render_maybe { shift->render(@_, 'mojo.maybe' => 1) } -sub render_to_string { shift->render(@_, 'mojo.to_string' => 1) } +sub render_to_string { shift->render(@_, 'mojo.string' => 1) } sub rendered { my ($self, $status) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Guides/Routing.pod new/Mojolicious-6.32/lib/Mojolicious/Guides/Routing.pod --- old/Mojolicious-6.31/lib/Mojolicious/Guides/Routing.pod 2015-11-10 18:30:13.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Guides/Routing.pod 2015-11-18 09:55:37.000000000 +0100 @@ -787,10 +787,10 @@ expressions. $ ./myapp.pl routes -v - /foo/:name .... POST fooname ^/foo/([^/\.]+) ^/?(?:\.([^/]+))?$ + /foo/:name .... POST fooname ^/foo/([^/.]+)/?(?:\.([^/]+))?$ /bar ..U. * bar ^/bar - +/baz ...W GET baz ^/baz ^/?(?:\.([^/]+))?$ - /yada .... * yada ^/yada ^/?(?:\.([^/]+))?$ + +/baz ...W GET baz ^/baz/?(?:\.([^/]+))?$ + /yada .... * yada ^/yada/?(?:\.([^/]+))?$ =head1 ADVANCED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Plugin/DefaultHelpers.pm new/Mojolicious-6.32/lib/Mojolicious/Plugin/DefaultHelpers.pm --- old/Mojolicious-6.31/lib/Mojolicious/Plugin/DefaultHelpers.pm 2015-11-10 13:24:17.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Plugin/DefaultHelpers.pm 2015-11-17 05:43:01.000000000 +0100 @@ -68,7 +68,7 @@ sub _csrf_token { my $c = shift; return $c->session->{csrf_token} - ||= hmac_sha1_sum $$ . steady_time . rand 999, $c->app->secrets->[0]; + ||= hmac_sha1_sum($$ . steady_time . rand 999, $c->app->secrets->[0]); } sub _current_route { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Plugin/Mount.pm new/Mojolicious-6.32/lib/Mojolicious/Plugin/Mount.pm --- old/Mojolicious-6.31/lib/Mojolicious/Plugin/Mount.pm 2015-11-01 04:34:26.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Plugin/Mount.pm 2015-11-17 21:36:26.000000000 +0100 @@ -12,10 +12,8 @@ # Extract host my $host; - if ($path =~ m!^(\*\.)?([^/]+)(/.*)?$!) { - $host = $1 ? qr/^(?:.*\.)?\Q$2\E$/i : qr/^\Q$2\E$/i; - $path = $3; - } + ($host, $path) = ($1 ? qr/^(?:.*\.)?\Q$2\E$/i : qr/^\Q$2\E$/i, $3) + if $path =~ m!^(\*\.)?([^/]+)(/.*)?$!; my $route = $app->routes->route($path)->detour(app => $embed); return $host ? $route->over(host => $host) : $route; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Renderer.pm new/Mojolicious-6.32/lib/Mojolicious/Renderer.pm --- old/Mojolicious-6.31/lib/Mojolicious/Renderer.pm 2015-11-10 19:56:02.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious/Renderer.pm 2015-11-18 07:33:29.000000000 +0100 @@ -91,8 +91,8 @@ local $stash->{extends} = $stash->{extends} if exists $stash->{extends}; # Rendering to string - local @{$stash}{keys %$args} if my $ts = delete $args->{'mojo.to_string'}; - delete @{$stash}{qw(layout extends)} if $ts; + local @{$stash}{keys %$args} if my $string = delete $args->{'mojo.string'}; + delete @{$stash}{qw(layout extends)} if $string; # All other arguments just become part of the stash @$stash{keys %$args} = values %$args; @@ -145,7 +145,7 @@ # Encoding $output = encode $options->{encoding}, $output - if !$ts && $options->{encoding} && $output; + if !$string && $options->{encoding} && $output; return $output, $options->{format}; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious/Routes/Pattern.pm new/Mojolicious-6.32/lib/Mojolicious/Routes/Pattern.pm --- old/Mojolicious-6.31/lib/Mojolicious/Routes/Pattern.pm 2015-08-29 13:14:33.000000000 +0200 +++ new/Mojolicious-6.32/lib/Mojolicious/Routes/Pattern.pm 2015-11-18 10:06:00.000000000 +0100 @@ -1,8 +1,10 @@ package Mojolicious::Routes::Pattern; use Mojo::Base -base; +use Mojo::Util 'deprecated'; + has [qw(constraints defaults)] => sub { {} }; -has [qw(format_regex regex unparsed)]; +has [qw(regex unparsed)]; has placeholder_start => ':'; has [qw(placeholders tree)] => sub { [] }; has quote_end => ')'; @@ -10,6 +12,12 @@ has relaxed_start => '#'; has wildcard_start => '*'; +# DEPRECATED in Clinking Beer Mugs! +sub format_regex { + deprecated 'Mojolicious::Routes::Pattern::format_regex is DEPRECATED'; + return @_ > 1 ? $_[0] : undef; +} + sub match { my ($self, $path, $detect) = @_; my $captures = $self->match_partial(\$path, $detect); @@ -20,24 +28,19 @@ my ($self, $pathref, $detect) = @_; # Compile on demand - $self->_compile unless $self->{regex}; - $self->_compile_format if $detect && !$self->{format_regex}; + $self->_compile($detect) unless $self->{regex}; # Path return undef unless my @captures = $$pathref =~ $self->regex; $$pathref = ${^POSTMATCH}; + @captures = () if $#+ == 0; my $captures = {%{$self->defaults}}; - for my $placeholder (@{$self->placeholders}) { + for my $placeholder (@{$self->placeholders}, 'format') { last unless @captures; my $capture = shift @captures; $captures->{$placeholder} = $capture if defined $capture; } - # Format - return $captures unless $detect && (my $regex = $self->format_regex); - return undef unless $$pathref =~ $regex; - $captures->{format} = $1 if defined $1; - $$pathref = ''; return $captures; } @@ -49,8 +52,8 @@ my $pattern = @_ % 2 ? (shift // '/') : '/'; $pattern =~ s!^/*|/+!/!g; return $self->constraints({@_}) if $pattern eq '/'; - $pattern =~ s!/$!!; + $pattern =~ s!/$!!; return $self->constraints({@_})->_tokenize($pattern); } @@ -87,7 +90,7 @@ } sub _compile { - my $self = shift; + my ($self, $detect) = @_; my $placeholders = $self->placeholders; my $constraints = $self->constraints; @@ -135,23 +138,25 @@ # Not rooted with a slash $regex = "$block$regex" if $block; + # Format + $regex .= _compile_format($constraints->{format}, $defaults->{format}) + if $detect; + $self->regex(qr/^$regex/ps); } sub _compile_format { - my $self = shift; + my ($format, $default) = @_; # Default regex - my $format = $self->constraints->{format}; - return $self->format_regex(qr!^/?(?:\.([^/]+))?$!) unless defined $format; + return '/?(?:\.([^/]+))?$' unless defined $format; # No regex - return undef unless $format; + return '' unless $format; # Compile custom regex my $regex = '\.' . _compile_req($format); - $regex = "(?:$regex)?" if $self->defaults->{format}; - $self->format_regex(qr!^/?$regex$!); + return $default ? "/?(?:$regex)?\$" : "/?$regex\$"; } sub _compile_req { @@ -257,13 +262,6 @@ Default parameters. -=head2 format_regex - - my $regex = $pattern->format_regex; - $pattern = $pattern->format_regex($regex); - -Compiled regular expression for format matching. - =head2 placeholder_start my $start = $pattern->placeholder_start; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/lib/Mojolicious.pm new/Mojolicious-6.32/lib/Mojolicious.pm --- old/Mojolicious-6.31/lib/Mojolicious.pm 2015-11-12 03:58:57.000000000 +0100 +++ new/Mojolicious-6.32/lib/Mojolicious.pm 2015-11-17 05:42:33.000000000 +0100 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.31'; +our $VERSION = '6.32'; sub AUTOLOAD { my $self = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/mojo/dom.t new/Mojolicious-6.32/t/mojo/dom.t --- old/Mojolicious-6.31/t/mojo/dom.t 2015-11-13 19:04:12.000000000 +0100 +++ new/Mojolicious-6.32/t/mojo/dom.t 2015-11-17 20:29:23.000000000 +0100 @@ -977,28 +977,28 @@ is_deeply \@li, [qw(D H)], 'found the right li elements'; @li = (); $dom->find('li:nth-child(4n+4)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(D H)], 'found the right li element'; +is_deeply \@li, [qw(D H)], 'found the right li elements'; @li = (); $dom->find('li:nth-last-child(4n+4)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A E)], 'found the right li element'; +is_deeply \@li, [qw(A E)], 'found the right li elements'; @li = (); $dom->find('li:nth-child(4n)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(D H)], 'found the right li element'; +is_deeply \@li, [qw(D H)], 'found the right li elements'; @li = (); $dom->find('li:nth-child( 4n )')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(D H)], 'found the right li element'; +is_deeply \@li, [qw(D H)], 'found the right li elements'; @li = (); $dom->find('li:nth-last-child(4n)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A E)], 'found the right li element'; +is_deeply \@li, [qw(A E)], 'found the right li elements'; @li = (); $dom->find('li:nth-child(5n-2)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(C H)], 'found the right li element'; +is_deeply \@li, [qw(C H)], 'found the right li elements'; @li = (); $dom->find('li:nth-child( 5n - 2 )')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(C H)], 'found the right li element'; +is_deeply \@li, [qw(C H)], 'found the right li elements'; @li = (); $dom->find('li:nth-last-child(5n-2)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A F)], 'found the right li element'; +is_deeply \@li, [qw(A F)], 'found the right li elements'; @li = (); $dom->find('li:nth-child(-n+3)')->each(sub { push @li, shift->text }); is_deeply \@li, [qw(A B C)], 'found first three li elements'; @@ -1034,28 +1034,36 @@ is_deeply \@li, ['F'], 'found third last li element'; @li = (); $dom->find('li:nth-child(1n+0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:nth-child(1n-0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:nth-child(n+0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:nth-child(n)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:nth-child(n+0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:NTH-CHILD(N+0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:Nth-Child(N+0)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; @li = (); $dom->find('li:nth-child(n)')->each(sub { push @li, shift->text }); -is_deeply \@li, [qw(A B C D E F G)], 'found first three li elements'; +is_deeply \@li, [qw(A B C D E F G)], 'found all li elements'; +@li = (); +$dom->find('li:nth-child(0n+1)')->each(sub { push @li, shift->text }); +is_deeply \@li, [qw(A)], 'found first li element'; +is $dom->find('li:nth-child(0n+0)')->size, 0, 'no results'; +is $dom->find('li:nth-child(0)')->size, 0, 'no results'; +is $dom->find('li:nth-child()')->size, 0, 'no results'; +is $dom->find('li:nth-child(whatever)')->size, 0, 'no results'; +is $dom->find('li:whatever(whatever)')->size, 0, 'no results'; # Even more pseudo-classes $dom = Mojo::DOM->new(<<EOF); @@ -1134,6 +1142,9 @@ $dom->find('ul :nth-child(-n+3):not(li)')->each(sub { push @e, shift->text }); is_deeply \@e, ['B'], 'found first p element'; @e = (); +$dom->find('ul :nth-child(-n+3):NOT(li)')->each(sub { push @e, shift->text }); +is_deeply \@e, ['B'], 'found first p element'; +@e = (); $dom->find('ul :nth-child(-n+3):not(:first-child)') ->each(sub { push @e, shift->text }); is_deeply \@e, [qw(B C)], 'found second and third element'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/mojo/ioloop.t new/Mojolicious-6.32/t/mojo/ioloop.t --- old/Mojolicious-6.31/t/mojo/ioloop.t 2015-08-29 01:31:17.000000000 +0200 +++ new/Mojolicious-6.32/t/mojo/ioloop.t 2015-11-17 05:38:53.000000000 +0100 @@ -85,8 +85,8 @@ $loop->start; $loop->one_tick; $loop->remove($id); -ok $count > 1, 'more than one recurring event'; -ok $count < 10, 'less than ten recurring events'; +ok($count > 1, 'more than one recurring event'); +ok($count < 10, 'less than ten recurring events'); # Handle and reset my ($handle, $handle2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/mojo/response.t new/Mojolicious-6.32/t/mojo/response.t --- old/Mojolicious-6.31/t/mojo/response.t 2015-08-29 01:31:26.000000000 +0200 +++ new/Mojolicious-6.32/t/mojo/response.t 2015-11-18 01:09:26.000000000 +0100 @@ -64,6 +64,8 @@ is $res->code(429)->default_message, 'Too Many Requests', 'right message'; is $res->code(431)->default_message, 'Request Header Fields Too Large', 'right message'; +is $res->code(451)->default_message, 'Unavailable For Legal Reasons', + 'right message'; is $res->code(500)->default_message, 'Internal Server Error', 'right message'; is $res->code(501)->default_message, 'Not Implemented', 'right message'; is $res->code(502)->default_message, 'Bad Gateway', 'right message'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/mojolicious/pattern.t new/Mojolicious-6.32/t/mojolicious/pattern.t --- old/Mojolicious-6.31/t/mojolicious/pattern.t 2015-11-10 18:23:06.000000000 +0100 +++ new/Mojolicious-6.32/t/mojolicious/pattern.t 2015-11-18 10:05:31.000000000 +0100 @@ -148,19 +148,15 @@ # Format detection $pattern = Mojolicious::Routes::Pattern->new('/test'); $pattern->defaults({action => 'index'}); -ok !$pattern->regex, 'no regex'; -ok !$pattern->format_regex, 'no format regex'; +ok !$pattern->regex, 'no regex'; is_deeply $pattern->match('/test.xml', 1), {action => 'index', format => 'xml'}, 'right structure'; -ok $pattern->regex, 'regex has been compiled on demand'; -ok $pattern->format_regex, 'format regex has been compiled on demand'; +ok $pattern->regex, 'regex has been compiled on demand'; $pattern = Mojolicious::Routes::Pattern->new('/test.json'); $pattern->defaults({action => 'index'}); -ok !$pattern->regex, 'no regex'; -ok !$pattern->format_regex, 'no format regex'; +ok !$pattern->regex, 'no regex'; is_deeply $pattern->match('/test.json'), {action => 'index'}, 'right structure'; ok $pattern->regex, 'regex has been compiled on demand'; -ok !$pattern->format_regex, 'no format regex'; is_deeply $pattern->match('/test.json', 1), {action => 'index'}, 'right structure'; ok !$pattern->match('/test.xml'), 'no result'; @@ -169,21 +165,17 @@ # Formats without detection $pattern = Mojolicious::Routes::Pattern->new('/test'); $pattern->defaults({action => 'index'}); -ok !$pattern->regex, 'no regex'; -ok !$pattern->format_regex, 'no format regex'; +ok !$pattern->regex, 'no regex'; ok !$pattern->match('/test.xml'), 'no result'; ok $pattern->regex, 'regex has been compiled on demand'; -ok !$pattern->format_regex, 'no format regex'; is_deeply $pattern->match('/test'), {action => 'index'}, 'right structure'; # Format detection disabled $pattern = Mojolicious::Routes::Pattern->new('/test', format => 0); $pattern->defaults({action => 'index'}); -ok !$pattern->regex, 'no regex'; -ok !$pattern->format_regex, 'no format regex'; +ok !$pattern->regex, 'no regex'; is_deeply $pattern->match('/test', 1), {action => 'index'}, 'right structure'; ok $pattern->regex, 'regex has been compiled on demand'; -ok !$pattern->format_regex, 'no format regex'; ok !$pattern->match('/test.xml', 1), 'no result'; # Special pattern for disabling format detection diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/mojolicious/routes.t new/Mojolicious-6.32/t/mojolicious/routes.t --- old/Mojolicious-6.31/t/mojolicious/routes.t 2015-08-29 01:31:48.000000000 +0200 +++ new/Mojolicious-6.32/t/mojolicious/routes.t 2015-11-18 10:05:34.000000000 +0100 @@ -75,7 +75,7 @@ $r->route('/')->to(controller => 'hello', action => 'world'); # /wildcards/1/* -$r->route('/wildcards/1/(*wildcard)', wildcard => qr/(.*)/) +$r->route('/wildcards/1/(*wildcard)', wildcard => qr/(?:.*)/) ->to(controller => 'wild', action => 'card'); # /wildcards/2/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.31/t/pod_coverage.t new/Mojolicious-6.32/t/pod_coverage.t --- old/Mojolicious-6.31/t/pod_coverage.t 2015-09-15 18:51:48.000000000 +0200 +++ new/Mojolicious-6.32/t/pod_coverage.t 2015-11-18 03:35:46.000000000 +0100 @@ -7,4 +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 => ['collecting']}); +all_pod_coverage_ok({also_private => [qw(collecting format_regex)]});