Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2015-11-15 12:46:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-10 10:03:24.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2015-11-15 12:48:09.000000000 +0100 @@ -1,0 +2,10 @@ +Sat Nov 14 09:58:53 UTC 2015 - co...@suse.com + +- updated to 6.30 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.30 2015-11-11 + - Fixed bug in Mojolicious::Renderer where layouts could not be used with + template inheritance. (nic, sri) + +------------------------------------------------------------------- Old: ---- Mojolicious-6.29.tar.gz New: ---- Mojolicious-6.30.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.BXBNGI/_old 2015-11-15 12:48:10.000000000 +0100 +++ /var/tmp/diff_new_pack.BXBNGI/_new 2015-11-15 12:48:10.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 6.29 +Version: 6.30 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework @@ -41,8 +41,7 @@ %{perl_requires} %description -Take a look at our excellent documentation in the Mojolicious::Guides -manpage! +Take a look at our excellent documentation in Mojolicious::Guides! %prep %setup -q -n %{cpan_name}-%{version} ++++++ Mojolicious-6.29.tar.gz -> Mojolicious-6.30.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/Changes new/Mojolicious-6.30/Changes --- old/Mojolicious-6.29/Changes 2015-11-03 17:20:56.000000000 +0100 +++ new/Mojolicious-6.30/Changes 2015-11-11 13:52:40.000000000 +0100 @@ -1,4 +1,8 @@ +6.30 2015-11-11 + - Fixed bug in Mojolicious::Renderer where layouts could not be used with + template inheritance. (nic, sri) + 6.29 2015-11-03 - Fixed a few bugs in built-in templates. (Zoffix, sri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/META.json new/Mojolicious-6.30/META.json --- old/Mojolicious-6.29/META.json 2015-11-04 11:04:11.000000000 +0100 +++ new/Mojolicious-6.30/META.json 2015-11-12 03:58:23.000000000 +0100 @@ -58,5 +58,5 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.29" + "version" : "6.30" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/META.yml new/Mojolicious-6.30/META.yml --- old/Mojolicious-6.29/META.yml 2015-11-04 11:04:11.000000000 +0100 +++ new/Mojolicious-6.30/META.yml 2015-11-12 03:58:22.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.29' +version: '6.30' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojo/DOM.pm new/Mojolicious-6.30/lib/Mojo/DOM.pm --- old/Mojolicious-6.29/lib/Mojo/DOM.pm 2015-11-01 04:32:19.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojo/DOM.pm 2015-11-11 20:46:35.000000000 +0100 @@ -449,8 +449,8 @@ my $dom = Mojo::DOM->new('<P ID="greeting">Hi!</P>'); say $dom->at('p[id]')->text; -If XML processing instructions are found, the parser will automatically switch -into XML mode and everything becomes case-sensitive. +If an XML declaration is found, the parser will automatically switch into XML +mode and everything becomes case-sensitive. # XML semantics my $dom = Mojo::DOM->new('<?xml version="1.0"?><P ID="greeting">Hi!</P>'); @@ -738,6 +738,9 @@ Return L<Mojo::DOM> object for parent of this node or C<undef> if this node has no parent. + # "<b><i>Test</i></b>" + $dom->parse('<p><b><i>Test</i></b></p>')->at('i')->parent; + =head2 parse $dom = $dom->parse('<foo bar="baz">I ♥ Mojolicious!</foo>'); @@ -745,7 +748,7 @@ Parse HTML/XML fragment with L<Mojo::DOM::HTML>. # Parse XML - my $dom = Mojo::DOM->new->xml(1)->parse($xml); + my $dom = Mojo::DOM->new->xml(1)->parse('<foo>I ♥ Mojolicious!<foo/>'); =head2 preceding diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojo/Server/Morbo.pm new/Mojolicious-6.30/lib/Mojo/Server/Morbo.pm --- old/Mojolicious-6.29/lib/Mojo/Server/Morbo.pm 2015-10-30 17:02:17.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojo/Server/Morbo.pm 2015-11-11 13:48:45.000000000 +0100 @@ -36,7 +36,7 @@ $self->{finished} = 1; kill 'TERM', $self->{worker} if $self->{worker}; }; - unshift @{$self->watch}, $app; + unshift @{$self->watch}, $0 = $app; $self->{modified} = 1; # Prepare and cache listen sockets for smooth restarting diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojolicious/Guides/Rendering.pod new/Mojolicious-6.30/lib/Mojolicious/Guides/Rendering.pod --- old/Mojolicious-6.29/lib/Mojolicious/Guides/Rendering.pod 2015-10-29 17:28:02.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojolicious/Guides/Rendering.pod 2015-11-10 14:55:24.000000000 +0100 @@ -769,49 +769,6 @@ <body><%= content %></body> </html> -=head2 Template inheritance - -Inheritance takes the layout concept above one step further, the helpers -L<Mojolicious::Plugin::DefaultHelpers/"content"> and -L<Mojolicious::Plugin::DefaultHelpers/"extends"> allow you to build a skeleton -template with named blocks that child templates can override. - - use Mojolicious::Lite; - - get '/' => 'third'; - - app->start; - __DATA__ - - @@ first.html.ep - <!DOCTYPE html> - <html> - <head><title>Hello</title></head> - <body> - %= content header => begin - Default header - % end - <div>Hello World!</div> - %= content footer => begin - Default footer - % end - </body> - </html> - - @@ second.html.ep - % extends 'first'; - % content header => begin - New header - % end - - @@ third.html.ep - % extends 'second'; - % content footer => begin - New footer - % end - -This chain could go on and on to allow a very high level of template reuse. - =head2 Forms To build HTML forms more efficiently you can use tag helpers like @@ -1034,6 +991,54 @@ Less commonly used and more powerful features. +=head2 Template inheritance + +Inheritance takes the layout concept above one step further, the helpers +L<Mojolicious::Plugin::DefaultHelpers/"content"> and +L<Mojolicious::Plugin::DefaultHelpers/"extends"> allow you to build skeleton +templates with named blocks that child templates can override. + + use Mojolicious::Lite; + + # first > mylayout + get '/first' => {template => 'first', layout => 'mylayout'}; + + # third > second > first > mylayout + get '/third' => {template => 'third', layout => 'mylayout'}; + + app->start; + __DATA__ + + @@ layouts/mylayout.html.ep + <!DOCTYPE html> + <html> + <head><title>Hello</title></head> + <body><%= content %></body> + </html> + + @@ first.html.ep + %= content header => begin + Default header + % end + <div>Hello World!</div> + %= content footer => begin + Default footer + % end + + @@ second.html.ep + % extends 'first'; + % content header => begin + New header + % end + + @@ third.html.ep + % extends 'second'; + % content footer => begin + New footer + % end + +This chain could go on and on to allow a very high level of template reuse. + =head2 Serving static files Static files are automatically served from the C<public> directories of the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojolicious/Guides/Routing.pod new/Mojolicious-6.30/lib/Mojolicious/Guides/Routing.pod --- old/Mojolicious-6.29/lib/Mojolicious/Guides/Routing.pod 2015-11-03 10:25:26.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojolicious/Guides/Routing.pod 2015-11-10 18:30:13.000000000 +0100 @@ -858,6 +858,16 @@ Especially for rearranging routes created by plugins this can be very useful, to find routes by their name you can use L<Mojolicious::Routes::Route/"find">. + # GET /example/test -> {controller => 'example', action => 'test'} + $r->get('/something/else')->to('something#else')->name('test'); + my $test = $r->find('test'); + $test->pattern->parse('/example/test'); + $test->pattern->defaults({controller => 'example', action => 'test'}); + +Even the route pattern and destination can still be changed with +L<Mojolicious::Routes::Pattern/"parse"> and +L<Mojolicious::Routes::Pattern/"defaults">. + =head2 Adding conditions You can also add your own conditions with the method diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojolicious/Renderer.pm new/Mojolicious-6.30/lib/Mojolicious/Renderer.pm --- old/Mojolicious-6.29/lib/Mojolicious/Renderer.pm 2015-10-28 04:26:02.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojolicious/Renderer.pm 2015-11-10 19:56:02.000000000 +0100 @@ -132,11 +132,11 @@ return unless $self->_render_template($c, \$output, $options); } - # Extends + # Inheritance my $content = $stash->{'mojo.content'} ||= {}; local $content->{content} = $output if $stash->{extends} || $stash->{layout}; - while ((my $extends = $self->_extends($stash)) && !defined $inline) { - @$options{qw(handler template)} = ($stash->{handler}, $extends); + while ((my $next = _next($stash)) && !defined $inline) { + @$options{qw(handler template)} = ($stash->{handler}, $next); $options->{format} = $stash->{format} || $self->default_format; $self->_render_template($c, \$output, $options); $content->{content} = $output @@ -224,11 +224,11 @@ } } -sub _extends { - my ($self, $stash) = @_; - my $layout = delete $stash->{layout}; - $stash->{extends} ||= join('/', 'layouts', $layout) if $layout; - return delete $stash->{extends}; +sub _next { + my $stash = shift; + return delete $stash->{extends} if $stash->{extends}; + return undef unless my $layout = delete $stash->{layout}; + return join '/', 'layouts', $layout; } sub _render_template { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/lib/Mojolicious.pm new/Mojolicious-6.30/lib/Mojolicious.pm --- old/Mojolicious-6.29/lib/Mojolicious.pm 2015-11-02 16:16:41.000000000 +0100 +++ new/Mojolicious-6.30/lib/Mojolicious.pm 2015-11-11 17:43:47.000000000 +0100 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.29'; +our $VERSION = '6.30'; sub AUTOLOAD { my $self = shift; @@ -700,7 +700,7 @@ =head2 jQuery - Copyright (C) 2005, 2014 jQuery Foundation, Inc. + Copyright (C) 2005, 2015 jQuery Foundation, Inc. Licensed under the MIT License, L<http://creativecommons.org/licenses/MIT>. @@ -757,8 +757,6 @@ Abhijit Menon-Sen, C<a...@cpan.org> -Dan Book, C<db...@cpan.org> - Glen Hinkle, C<temp...@cpan.org> Jan Henning Thorsen, C<jhthor...@cpan.org> @@ -839,6 +837,8 @@ Curt Tilmes +Dan Book + Daniel Kimsey Danijel Tasov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/t/mojolicious/exception_lite_app.t new/Mojolicious-6.30/t/mojolicious/exception_lite_app.t --- old/Mojolicious-6.29/t/mojolicious/exception_lite_app.t 2015-11-03 23:57:33.000000000 +0100 +++ new/Mojolicious-6.30/t/mojolicious/exception_lite_app.t 2015-11-10 13:24:22.000000000 +0100 @@ -156,7 +156,8 @@ # Dead template with layout $t->get_ok('/dead_template_with_layout')->status_is(500) - ->content_like(qr/dead template with layout!/)->content_like(qr/line 2/); + ->content_like(qr/dead template with layout!/)->content_like(qr/line 2/) + ->content_unlike(qr/Green/); like $log, qr/dead template with layout!/, 'right result'; # Dead action @@ -264,7 +265,7 @@ __DATA__ @@ layouts/green.html.ep -%= content +Green<%= content %> @@ dead_template.html.ep % die 'dead template!'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/t/mojolicious/layouted_lite_app.t new/Mojolicious-6.30/t/mojolicious/layouted_lite_app.t --- old/Mojolicious-6.29/t/mojolicious/layouted_lite_app.t 2015-08-29 01:31:41.000000000 +0200 +++ new/Mojolicious-6.30/t/mojolicious/layouted_lite_app.t 2015-11-10 14:57:54.000000000 +0100 @@ -48,6 +48,12 @@ get '/triple_inheritance'; +get '/mixed_inheritance/first' => {template => 'first'}; + +get '/mixed_inheritance/second' => {template => 'second', layout => 'green'}; + +get '/mixed_inheritance/third' => {template => 'third'}; + get '/nested-includes' => sub { my $c = shift; $c->render( @@ -71,7 +77,11 @@ get '/outerextends' => sub { my $c = shift; - $c->render(template => 'outerlayout', extends => 'layouts/layout'); + $c->render( + template => 'outerlayout', + extends => 'layouts/layout', + layout => undef + ); }; get '/outerlayouttwo' => {layout => 'layout'} => sub { @@ -188,6 +198,17 @@ ->content_is("<title>Works!</title>\n<br>\nSidebar too!\n" . "New <content>.\n\nDefault footer!\n"); +# Mixed inheritance (with layout) +$t->get_ok('/mixed_inheritance/first')->status_is(200) + ->header_is(Server => 'Mojolicious (Perl)') + ->content_is("Default\n Default header\nStuff\n\n Default footer\n\n"); +$t->get_ok('/mixed_inheritance/second')->status_is(200) + ->header_is(Server => 'Mojolicious (Perl)') + ->content_is("Green New header\nStuff\n\n Default footer\n\n"); +$t->get_ok('/mixed_inheritance/third')->status_is(200) + ->header_is(Server => 'Mojolicious (Perl)') + ->content_is("Default New header\nStuff\n New footer\n\n"); + # Template from plugin $t->get_ok('/plugin_with_template')->status_is(200) ->content_is("layout_with_template\nwith template\n\n"); @@ -285,6 +306,7 @@ Mixed <%= content %> @@ blue.html.ep +% layout undef; Blue<%= title %><%= content %> @@ works.html.ep @@ -309,6 +331,27 @@ % extends 'blue' if param 'blue'; Not found happened! +@@ first.html.ep +%= content header => begin + Default header +% end +Stuff +%= content footer => begin + Default footer +% end + +@@ second.html.ep +% extends 'first'; +% content header => begin + New header +% end + +@@ third.html.ep +% extends 'second'; +% content footer => begin + New footer +% end + @@ template_inheritance.html.ep % layout 'template_inheritance'; % title 'Works!'; @@ -353,6 +396,7 @@ @@ localized.html.ep % extends 'localized1'; +% layout undef; <%= $test %> <%= include 'localized_include', test => 321, extends => 'localized2' %> <%= $test %> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.29/t/mojolicious/pattern.t new/Mojolicious-6.30/t/mojolicious/pattern.t --- old/Mojolicious-6.29/t/mojolicious/pattern.t 2015-08-29 01:31:44.000000000 +0200 +++ new/Mojolicious-6.30/t/mojolicious/pattern.t 2015-11-10 18:23:06.000000000 +0100 @@ -271,4 +271,12 @@ is_deeply $result, {one => 'i', two => 'mojolicious'}, 'right structure'; is $pattern->render($result, 1), '/i♥mojolicious', 'right result'; +# Pattern reuse +$pattern = Mojolicious::Routes::Pattern->new->parse('/first')->parse('/second') + ->defaults({test => 'works'}); +ok !$pattern->match('/first'), 'no result'; +$result = $pattern->match('/second'); +is_deeply $result, {test => 'works'}, 'right structure'; +is $pattern->render($result, 1), '/second', 'right result'; + done_testing();