Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2016-03-17 16:34:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-03-09 16:49:02.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2016-03-17 16:47:41.000000000 +0100 @@ -1,0 +2,14 @@ +Fri Mar 11 10:25:08 UTC 2016 - [email protected] + +- updated to 6.55 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.55 2016-03-08 + - Deprecated Mojo::Server::Morbo::check in favor of + Mojo::Server::Morbo::modified_files. (leejo, nugged) + - Added modified_files method to Mojo::Server::Morbo. (leejo, nugged) + - Improved renderer performance slightly. + - Fixed a bug where Morbo would restart more than once if multiple files + changed at the same time. (leejo, nugged) + +------------------------------------------------------------------- Old: ---- Mojolicious-6.54.tar.gz New: ---- Mojolicious-6.55.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.vSPW8y/_old 2016-03-17 16:47:42.000000000 +0100 +++ /var/tmp/diff_new_pack.vSPW8y/_new 2016-03-17 16:47:42.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 6.54 +Version: 6.55 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-6.54.tar.gz -> Mojolicious-6.55.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/Changes new/Mojolicious-6.55/Changes --- old/Mojolicious-6.54/Changes 2016-03-06 16:36:29.000000000 +0100 +++ new/Mojolicious-6.55/Changes 2016-03-08 19:08:01.000000000 +0100 @@ -1,8 +1,15 @@ +6.55 2016-03-08 + - Deprecated Mojo::Server::Morbo::check in favor of + Mojo::Server::Morbo::modified_files. (leejo, nugged) + - Added modified_files method to Mojo::Server::Morbo. (leejo, nugged) + - Improved renderer performance slightly. + - Fixed a bug where Morbo would restart more than once if multiple files + changed at the same time. (leejo, nugged) + 6.54 2016-03-06 + - Deprecated Mojo::Template::build and Mojo::Template::compile. - Deprecated Mojo::Template::interpret in favor of Mojo::Template::process. - - Deprecated Mojo::Template::build. - - Deprecated Mojo::Template::compile. - Added support for named variables to Mojo::Template. - Added vars attribute to Mojo::Template. - Added process method to Mojo::Template. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/META.json new/Mojolicious-6.55/META.json --- old/Mojolicious-6.54/META.json 2016-03-07 16:08:54.000000000 +0100 +++ new/Mojolicious-6.55/META.json 2016-03-08 21:42:16.000000000 +0100 @@ -58,5 +58,5 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.54" + "version" : "6.55" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/META.yml new/Mojolicious-6.55/META.yml --- old/Mojolicious-6.54/META.yml 2016-03-07 16:08:54.000000000 +0100 +++ new/Mojolicious-6.55/META.yml 2016-03-08 21:42:16.000000000 +0100 @@ -31,4 +31,4 @@ homepage: http://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '6.54' +version: '6.55' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojo/Home.pm new/Mojolicious-6.55/lib/Mojo/Home.pm --- old/Mojolicious-6.54/lib/Mojo/Home.pm 2016-03-03 23:13:24.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojo/Home.pm 2016-03-08 17:37:54.000000000 +0100 @@ -60,7 +60,7 @@ =head1 NAME -Mojo::Home - Home sweet home! +Mojo::Home - Home sweet home =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojo/Server/Hypnotoad.pm new/Mojolicious-6.55/lib/Mojo/Server/Hypnotoad.pm --- old/Mojolicious-6.54/lib/Mojo/Server/Hypnotoad.pm 2016-03-06 10:57:59.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojo/Server/Hypnotoad.pm 2016-03-08 17:40:58.000000000 +0100 @@ -138,7 +138,7 @@ =head1 NAME -Mojo::Server::Hypnotoad - ALL GLORY TO THE HYPNOTOAD! +Mojo::Server::Hypnotoad - A production web serv...ALL GLORY TO THE HYPNOTOAD! =head1 SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojo/Server/Morbo.pm new/Mojolicious-6.55/lib/Mojo/Server/Morbo.pm --- old/Mojolicious-6.54/lib/Mojo/Server/Morbo.pm 2016-03-03 23:13:24.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojo/Server/Morbo.pm 2016-03-08 17:48:01.000000000 +0100 @@ -5,17 +5,33 @@ # effects of sudden, intense global warming. # Morbo: Morbo is pleased but sticky." use Mojo::Server::Daemon; -use Mojo::Util 'files'; +use Mojo::Util qw(deprecated files); use POSIX 'WNOHANG'; has daemon => sub { Mojo::Server::Daemon->new }; has watch => sub { [qw(lib templates)] }; +# DEPRECATED! sub check { + deprecated 'Mojo::Server::Morbo::check is DEPRECATED' + . ' in favor of Mojo::Server::Morbo::modified_files'; + return shift->modified_files->[0]; +} + +sub modified_files { my $self = shift; - $self->_check($_) and return $_ - for map { -f $_ && -r _ ? $_ : files $_ } @{$self->watch}; - return undef; + + my $cache = $self->{cache} ||= {}; + my @files; + for my $file (map { -f $_ && -r _ ? $_ : files $_ } @{$self->watch}) { + my ($size, $mtime) = (stat $file)[7, 9]; + my $stats = $cache->{$file} ||= [$^T, $size]; + next if $mtime <= $stats->[0] && $size == $stats->[1]; + @$stats = ($mtime, $size); + push @files, $file; + } + + return \@files; } sub run { @@ -36,23 +52,14 @@ exit 0; } -sub _check { - my ($self, $file) = @_; - - # Check if modify time and/or size have changed - my ($size, $mtime) = (stat $file)[7, 9]; - return undef unless defined $mtime; - my $cache = $self->{cache} ||= {}; - my $stats = $cache->{$file} ||= [$^T, $size]; - return undef if $mtime <= $stats->[0] && $size == $stats->[1]; - return !!($cache->{$file} = [$mtime, $size]); -} - sub _manage { my $self = shift; - if (defined(my $file = $self->check)) { - say qq{File "$file" changed, restarting.} if $ENV{MORBO_VERBOSE}; + if (my @files = @{$self->modified_files}) { + say @files == 1 + ? qq{File "@{[$files[0]]}" changed, restarting.} + : qq{@{[scalar @files]} files changed, restarting.} + if $ENV{MORBO_DEBUG}; kill 'TERM', $self->{worker} if $self->{worker}; $self->{modified} = 1; } @@ -87,7 +94,7 @@ =head1 NAME -Mojo::Server::Morbo - DOOOOOOOOOOOOOOOOOOM! +Mojo::Server::Morbo - Tonight at 11...DOOOOOOOOOOOOOOOM! =head1 SYNOPSIS @@ -152,12 +159,15 @@ L<Mojo::Server::Morbo> inherits all methods from L<Mojo::Base> and implements the following new ones. -=head2 check +=head2 modified_files + + my $files = $morbo->modified_files; - my $file = $morbo->check; +Check if files from L</"watch"> have been modified since the last check and +return an array reference with the results. -Check if file from L</"watch"> has been modified since last check and return -its name, or C<undef> if there have been no changes. + # All files that have been modified + say for @{$morbo->modified_files}; =head2 run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojo/Template.pm new/Mojolicious-6.55/lib/Mojo/Template.pm --- old/Mojolicious-6.54/lib/Mojo/Template.pm 2016-03-07 15:52:00.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojo/Template.pm 2016-03-07 18:16:56.000000000 +0100 @@ -631,7 +631,7 @@ data to templates. # "works!" - Mojo::Template->new(vars => 1)->render('<%= $test %>', {test => 'works!'}); + Mojo::Template->new(vars => 1)->render('<%= $test %>!', {test => 'works'}); =head1 METHODS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojolicious/Guides/Rendering.pod new/Mojolicious-6.55/lib/Mojolicious/Guides/Rendering.pod --- old/Mojolicious-6.54/lib/Mojolicious/Guides/Rendering.pod 2016-03-07 16:00:25.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojolicious/Guides/Rendering.pod 2016-03-08 14:50:25.000000000 +0100 @@ -842,16 +842,16 @@ %= form_for index => begin %= label_for user => 'Username (required, 1-20 characters, only e-t)' <br> - %= text_field 'user' + %= text_field 'user', id => 'user' %= submit_button <br> %= label_for pass => 'Password (optional, 7-500 characters)' <br> - %= password_field 'pass' + %= password_field 'pass', id => 'pass' <br> %= label_for pass_again => 'Password again (equal to the value above)' <br> - %= password_field 'pass_again' + %= password_field 'pass_again', id => 'pass_again' % end </body> </html> @@ -964,7 +964,7 @@ %= form_for target => begin %= csrf_field %= label_for city => 'Which city to point low orbit ion cannon at?' - %= text_field 'city' + %= text_field 'city', id => 'city' %= submit_button %= end </body> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojolicious/Renderer.pm new/Mojolicious-6.55/lib/Mojolicious/Renderer.pm --- old/Mojolicious-6.54/lib/Mojolicious/Renderer.pm 2016-03-06 10:57:59.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojolicious/Renderer.pm 2016-03-08 19:11:26.000000000 +0100 @@ -13,9 +13,8 @@ has default_format => 'html'; has 'default_handler'; has encoding => 'UTF-8'; -has handlers => sub { {data => \&_data, json => \&_json, text => \&_text} }; -has helpers => sub { {} }; -has paths => sub { [] }; +has [qw(handlers helpers)] => sub { {} }; +has paths => sub { [] }; # Bundled templates my $TEMPLATES = Mojo::Home->new(Mojo::Home->new->mojo_lib_dir) @@ -98,26 +97,16 @@ $options->{format} = $stash->{format} || $self->default_format; # Data - my $output; - if (defined(my $data = delete $stash->{data})) { - $self->handlers->{data}($self, $c, \$output, {data => $data}); - return $output, $options->{format}; - } + return delete $stash->{data}, $options->{format} if defined $stash->{data}; # JSON - elsif (exists $stash->{json}) { - my $json = delete $stash->{json}; - $self->handlers->{json}($self, $c, \$output, {json => $json}); - return $output, 'json'; - } + return encode_json(delete $stash->{json}), 'json' if exists $stash->{json}; # Text - elsif (defined(my $text = delete $stash->{text})) { - $self->handlers->{text}($self, $c, \$output, {text => $text}); - } + my $output = delete $stash->{text}; # Template or templateless handler - else { + unless (defined $output) { $options->{template} //= $self->template_for($c); return () unless $self->_render_template($c, \$output, $options); } @@ -206,10 +195,6 @@ } } -sub _data { ${$_[2]} = $_[3]{data} } - -sub _json { ${$_[2]} = encode_json($_[3]{json}) } - sub _next { my $stash = shift; return delete $stash->{extends} if $stash->{extends}; @@ -229,8 +214,6 @@ return 1 if defined $$output; } -sub _text { ${$_[2]} = $_[3]{text} } - 1; =encoding utf8 @@ -312,8 +295,7 @@ my $handlers = $renderer->handlers; $renderer = $renderer->handlers({epl => sub {...}}); -Registered handlers, by default only C<data>, C<text> and C<json> are already -defined. +Registered handlers. =head2 helpers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/lib/Mojolicious.pm new/Mojolicious-6.55/lib/Mojolicious.pm --- old/Mojolicious-6.54/lib/Mojolicious.pm 2016-03-06 10:58:41.000000000 +0100 +++ new/Mojolicious-6.55/lib/Mojolicious.pm 2016-03-08 10:43:32.000000000 +0100 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.54'; +our $VERSION = '6.55'; sub AUTOLOAD { my $self = shift; @@ -791,6 +791,8 @@ Andrew Fresh +Andrew Nugged + Andrey Khozov Andrey Kuzmin @@ -905,6 +907,8 @@ Lars Balker Rasmussen +Lee Johnson + Leon Brocard Magnus Holm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/t/mojo/morbo.t new/Mojolicious-6.55/t/mojo/morbo.t --- old/Mojolicious-6.54/t/mojo/morbo.t 2016-03-03 23:13:24.000000000 +0100 +++ new/Mojolicious-6.55/t/mojo/morbo.t 2016-03-08 10:59:01.000000000 +0100 @@ -25,7 +25,7 @@ my $subdir = catdir $dir, 'test', 'stuff'; mkpath $subdir; my $morbo = Mojo::Server::Morbo->new(watch => [$subdir, $script]); -is $morbo->check, undef, 'file has not changed'; +is_deeply $morbo->modified_files, [], 'no files have changed'; spurt <<EOF, $script; use Mojolicious::Lite; @@ -67,7 +67,7 @@ app->start; EOF -is $morbo->check, $script, 'file has changed'; +is_deeply $morbo->modified_files, [$script], 'file has changed'; ok((stat $script)[9] > $mtime, 'modify time has changed'); is((stat $script)[7], $size, 'still equal size'); sleep 3; @@ -86,7 +86,7 @@ # Update script without changing mtime ($size, $mtime) = (stat $script)[7, 9]; -is $morbo->check, undef, 'file has not changed'; +is_deeply $morbo->modified_files, [], 'no files have changed'; spurt <<EOF, $script; use Mojolicious::Lite; @@ -97,7 +97,7 @@ app->start; EOF utime $mtime, $mtime, $script; -is $morbo->check, $script, 'file has changed'; +is_deeply $morbo->modified_files, [$script], 'file has changed'; ok((stat $script)[9] == $mtime, 'modify time has not changed'); isnt((stat $script)[7], $size, 'size has changed'); sleep 3; @@ -114,12 +114,12 @@ is $tx->res->code, 200, 'right status'; is $tx->res->body, 'Hello!', 'right content'; -# New file -is $morbo->check, undef, 'directory has not changed'; -my $new = catfile $subdir, 'test.txt'; -spurt 'whatever', $new; -is $morbo->check, $new, 'directory has changed'; -is $morbo->check, undef, 'directory has not changed again'; +# New file(s) +is_deeply $morbo->modified_files, [], 'directory has not changed'; +my @new = map { catfile $subdir, "$_.txt" } qw/test testing/; +spurt 'whatever', $_ for @new; +is_deeply $morbo->modified_files, \@new, 'two files have changed'; +is_deeply $morbo->modified_files, [], 'directory has not changed again'; # Stop kill 'INT', $pid; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/t/mojolicious/tag_helper_lite_app.t new/Mojolicious-6.55/t/mojolicious/tag_helper_lite_app.t --- old/Mojolicious-6.54/t/mojolicious/tag_helper_lite_app.t 2016-03-03 23:13:24.000000000 +0100 +++ new/Mojolicious-6.55/t/mojolicious/tag_helper_lite_app.t 2016-03-08 14:49:27.000000000 +0100 @@ -144,11 +144,11 @@ $t->get_ok('/basicform')->status_is(200)->content_is(<<EOF); <form action="/links"> <label for="foo"><Foo></label> - <input name="foo" type="text" value="bar"> + <input id="foo" name="foo" type="text" value="bar"> <label for="bar"> Bar<br> </label> - <input class="test" name="bar" type="text" value="baz"> + <input class="test" id="bar" name="bar" type="text" value="baz"> <input name="yada" type="text" value=""> <input class="tset" name="baz" value="yada"> <input type="submit" value="Ok"> @@ -568,11 +568,11 @@ @@ basicform.html.ep %= form_for links => begin %= label_for foo => '<Foo>' - %= text_field foo => 'bar' + %= text_field foo => 'bar', id => 'foo' %= label_for bar => begin Bar<br> %= end - %= text_field bar => 'baz', class => 'test' + %= text_field bar => 'baz', class => 'test', id => 'bar' %= text_field yada => '' %= input_tag baz => 'yada', class => 'tset' %= submit_button diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/t/mojolicious/validation_lite_app.t new/Mojolicious-6.55/t/mojolicious/validation_lite_app.t --- old/Mojolicious-6.54/t/mojolicious/validation_lite_app.t 2016-03-03 23:13:24.000000000 +0100 +++ new/Mojolicious-6.55/t/mojolicious/validation_lite_app.t 2016-03-08 14:46:42.000000000 +0100 @@ -352,12 +352,12 @@ % } %= form_for index => begin %= label_for foo => '<Foo>', class => 'custom' - %= text_field 'foo', class => 'custom' + %= text_field 'foo', class => 'custom', id => 'foo' %= text_area 'bar' %= label_for baz => (class => 'custom') => begin Baz % end - %= select_field baz => [qw(yada yada)] + %= select_field baz => [qw(yada yada)], id => 'baz' %= password_field 'yada' % end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.54/t/pod_coverage.t new/Mojolicious-6.55/t/pod_coverage.t --- old/Mojolicious-6.54/t/pod_coverage.t 2016-03-06 10:58:41.000000000 +0100 +++ new/Mojolicious-6.55/t/pod_coverage.t 2016-03-08 10:44:20.000000000 +0100 @@ -11,6 +11,7 @@ 'Mojo::IOLoop' => {also_private => ['multi_accept']}, 'Mojo::IOLoop::Server' => {also_private => ['multi_accept']}, 'Mojo::Server::Daemon' => {also_private => ['multi_accept']}, + 'Mojo::Server::Morbo' => {also_private => ['check']}, 'Mojo::Template' => {also_private => ['build', 'compile', 'interpret']}, 'Mojo::Transaction::WebSocket' => {also_private => [qw(build_frame parse_frame)]},
