Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2015-08-28 08:26:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-08-01 11:34:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2015-08-28 08:26:23.000000000 +0200 @@ -1,0 +2,25 @@ +Sun Aug 23 09:02:18 UTC 2015 - co...@suse.com + +- updated to 6.17 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.17 2015-08-21 + - Improved slurp method in Mojo::Asset::File to only use one file descriptor. + + 6.16 2015-08-19 + - Improved check_box, radio_button and select_field tag helpers to handle the + attributes "checked" and "selected" correctly. + - Improved performance of slurp function in Mojo::Util slightly. + +------------------------------------------------------------------- +Wed Aug 19 09:15:05 UTC 2015 - co...@suse.com + +- updated to 6.15 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.15 2015-08-13 + - Removed deprecated build_body and build_headers methods from Mojo::Content. + - Improved Mojo::Transaction::HTTP performance slightly. + - Fixed warnings in Mojo::DOM. + +------------------------------------------------------------------- Old: ---- Mojolicious-6.14.tar.gz New: ---- Mojolicious-6.17.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.NXLkSC/_old 2015-08-28 08:26:24.000000000 +0200 +++ /var/tmp/diff_new_pack.NXLkSC/_new 2015-08-28 08:26:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 6.14 +Version: 6.17 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-6.14.tar.gz -> Mojolicious-6.17.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/Changes new/Mojolicious-6.17/Changes --- old/Mojolicious-6.14/Changes 2015-07-12 17:31:04.000000000 +0200 +++ new/Mojolicious-6.17/Changes 2015-08-21 18:49:30.000000000 +0200 @@ -1,4 +1,17 @@ +6.17 2015-08-21 + - Improved slurp method in Mojo::Asset::File to only use one file descriptor. + +6.16 2015-08-19 + - Improved check_box, radio_button and select_field tag helpers to handle the + attributes "checked" and "selected" correctly. + - Improved performance of slurp function in Mojo::Util slightly. + +6.15 2015-08-13 + - Removed deprecated build_body and build_headers methods from Mojo::Content. + - Improved Mojo::Transaction::HTTP performance slightly. + - Fixed warnings in Mojo::DOM. + 6.14 2015-07-12 - Improved app generator command not to create a log directory. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/META.json new/Mojolicious-6.17/META.json --- old/Mojolicious-6.14/META.json 2015-07-14 05:25:00.000000000 +0200 +++ new/Mojolicious-6.17/META.json 2015-08-22 21:37:44.000000000 +0200 @@ -55,6 +55,6 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.14", + "version" : "6.17", "x_serialization_backend" : "JSON::PP version 2.27300" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/META.yml new/Mojolicious-6.17/META.yml --- old/Mojolicious-6.14/META.yml 2015-07-14 05:24:59.000000000 +0200 +++ new/Mojolicious-6.17/META.yml 2015-08-22 21:37:44.000000000 +0200 @@ -30,5 +30,5 @@ homepage: http://mojolicio.us license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '6.14' +version: '6.17' x_serialization_backend: 'CPAN::Meta::YAML version 0.016' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/examples/microhttpd.pl new/Mojolicious-6.17/examples/microhttpd.pl --- old/Mojolicious-6.14/examples/microhttpd.pl 2015-03-31 19:49:57.000000000 +0200 +++ new/Mojolicious-6.17/examples/microhttpd.pl 2015-08-13 03:31:46.000000000 +0200 @@ -18,8 +18,8 @@ # Write a minimal HTTP response # (the "Hello World!" message has been optimized away!) - $stream->write("HTTP/1.1 200 OK\x0d\x0aContent-Length: 0\x0d\x0a" - . "Connection: keep-alive\x0d\x0a\x0d\x0a"); + $stream->write( + "HTTP/1.1 200 OK\x0d\x0aContent-Length: 0\x0d\x0a\x0d\x0a"); } } ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Asset/File.pm new/Mojolicious-6.17/lib/Mojo/Asset/File.pm --- old/Mojolicious-6.14/lib/Mojo/Asset/File.pm 2015-06-30 20:02:38.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Asset/File.pm 2015-08-21 19:31:12.000000000 +0200 @@ -46,9 +46,7 @@ sub add_chunk { my ($self, $chunk) = @_; - $chunk //= ''; - croak "Can't write to asset: $!" - unless defined $self->handle->syswrite($chunk, length $chunk); + defined $self->handle->syswrite($chunk) or croak "Can't write to asset: $!"; return $self; } @@ -124,8 +122,11 @@ sub size { -s shift->handle } sub slurp { - return '' unless defined(my $file = shift->path); - return Mojo::Util::slurp $file; + my $handle = shift->handle; + $handle->sysseek(0, SEEK_SET); + defined $handle->sysread(my $content, -s $handle, 0) + or croak qq{Can't read from asset: $!}; + return $content; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Asset/Memory.pm new/Mojolicious-6.17/lib/Mojo/Asset/Memory.pm --- old/Mojolicious-6.14/lib/Mojo/Asset/Memory.pm 2015-04-22 20:47:10.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Asset/Memory.pm 2015-08-18 18:05:52.000000000 +0200 @@ -47,7 +47,7 @@ sub move_to { my ($self, $to) = @_; - spurt $self->{content}, $to; + spurt $self->{content} // '', $to; return $self; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Base.pm new/Mojolicious-6.17/lib/Mojo/Base.pm --- old/Mojolicious-6.14/lib/Mojo/Base.pm 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Base.pm 2015-08-16 04:23:39.000000000 +0200 @@ -11,7 +11,7 @@ # Only Perl 5.14+ requires it on demand use IO::Handle (); -# Will be shipping with Perl 5.22 +# Supported on Perl 5.22+ my $NAME = eval { require Sub::Util; Sub::Util->can('set_subname') } || sub { $_[1] }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Content.pm new/Mojolicious-6.17/lib/Mojo/Content.pm --- old/Mojolicious-6.14/lib/Mojo/Content.pm 2015-06-30 20:02:38.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Content.pm 2015-08-16 04:23:41.000000000 +0200 @@ -4,7 +4,6 @@ use Carp 'croak'; use Compress::Raw::Zlib qw(WANT_GZIP Z_STREAM_END); use Mojo::Headers; -use Mojo::Util 'deprecated'; use Scalar::Util 'looks_like_number'; has [qw(auto_decompress auto_relax expect_close relaxed skip_body)]; @@ -25,10 +24,6 @@ (shift->headers->content_type // '') =~ $BOUNDARY_RE ? $1 // $2 : undef; } -# DEPRECATED in Clinking Beer Mugs! -sub build_body { shift->_build('get_body_chunk') } -sub build_headers { shift->_build('get_header_chunk') } - sub charset { my $type = shift->headers->content_type // ''; return $type =~ /charset\s*=\s*"?([^"\s;]+)"?/i ? $1 : undef; @@ -169,23 +164,6 @@ return $self; } -# DEPRECATED in Clinking Beer Mugs! -sub _build { - deprecated 'Mojo::Content::build_body and Mojo::Content::build_headers' - . ' are DEPRECATED'; - my ($self, $method) = @_; - - my ($buffer, $offset) = ('', 0); - while (1) { - next unless defined(my $chunk = $self->$method($offset)); - last unless my $len = length $chunk; - $offset += $len; - $buffer .= $chunk; - } - - return $buffer; -} - sub _build_chunk { my ($self, $chunk) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/DOM/CSS.pm new/Mojolicious-6.17/lib/Mojo/DOM/CSS.pm --- old/Mojolicious-6.14/lib/Mojo/DOM/CSS.pm 2015-04-05 17:50:23.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/DOM/CSS.pm 2015-08-16 04:23:43.000000000 +0200 @@ -24,11 +24,14 @@ sub select_one { _select(1, shift->tree, _compile(@_)) } sub _ancestor { - my ($selectors, $current, $tree, $pos) = @_; + my ($selectors, $current, $tree, $one, $pos) = @_; + while ($current = $current->[3]) { return undef if $current->[0] eq 'root' || $current eq $tree; return 1 if _combinator($selectors, $current, $tree, $pos); + last if $one; } + return undef; } @@ -56,7 +59,7 @@ } # ">" (parent only) - return _parent($selectors, $current, $tree, ++$pos) if $c eq '>'; + return _ancestor($selectors, $current, $tree, 1, ++$pos) if $c eq '>'; # "~" (preceding siblings) return _sibling($selectors, $current, $tree, 0, ++$pos) if $c eq '~'; @@ -65,7 +68,7 @@ return _sibling($selectors, $current, $tree, 1, ++$pos) if $c eq '+'; # " " (ancestor) - return _ancestor($selectors, $current, $tree, ++$pos); + return _ancestor($selectors, $current, $tree, 0, ++$pos); } sub _compile { @@ -138,13 +141,6 @@ sub _name {qr/(?:^|:)\Q@{[_unescape(shift)]}\E$/} -sub _parent { - my ($selectors, $current, $tree, $pos) = @_; - return undef unless my $parent = $current->[3]; - return undef if $parent->[0] eq 'root' || $parent eq $tree; - return _combinator($selectors, $parent, $tree, $pos); -} - sub _pc { my ($class, $args, $current) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/DOM.pm new/Mojolicious-6.17/lib/Mojo/DOM.pm --- old/Mojolicious-6.14/lib/Mojo/DOM.pm 2015-07-03 15:34:12.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/DOM.pm 2015-08-16 04:23:44.000000000 +0200 @@ -185,10 +185,9 @@ # Detect "pre" tag my $tree = $self->tree; - if (!defined $trim || $trim) { - $trim = 1; - $_->[1] eq 'pre' and $trim = 0 for $self->_ancestors, $tree; - } + $trim = 1 unless defined $trim; + map { $_->[1] eq 'pre' and $trim = 0 } $self->_ancestors, $tree + if $trim && $tree->[0] ne 'root'; return _text([_nodes($tree)], $recurse, $trim); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Headers.pm new/Mojolicious-6.17/lib/Mojo/Headers.pm --- old/Mojolicious-6.14/lib/Mojo/Headers.pm 2015-04-01 22:43:17.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Headers.pm 2015-08-16 04:23:45.000000000 +0200 @@ -7,7 +7,7 @@ has max_lines => sub { $ENV{MOJO_MAX_LINES} || 100 }; # Common headers -my %NORMALCASE = map { lc($_) => $_ } ( +my %NORMALCASE = map { lc() => $_ } ( qw(Accept Accept-Charset Accept-Encoding Accept-Language Accept-Ranges), qw(Access-Control-Allow-Origin Allow Authorization Cache-Control Connection), qw(Content-Disposition Content-Encoding Content-Language Content-Length), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/JSON.pm new/Mojolicious-6.17/lib/Mojo/JSON.pm --- old/Mojolicious-6.14/lib/Mojo/JSON.pm 2015-05-27 22:14:27.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/JSON.pm 2015-08-16 04:23:48.000000000 +0200 @@ -161,11 +161,11 @@ # High surrogate ($ord & 0xfc00) == 0xd800 - or pos($_) = $pos + pos($str), _throw('Missing high-surrogate'); + or pos = $pos + pos($str), _throw('Missing high-surrogate'); # Low surrogate $str =~ /\G\\u([Dd][C-Fc-f]..)/gc - or pos($_) = $pos + pos($str), _throw('Missing low-surrogate'); + or pos = $pos + pos($str), _throw('Missing low-surrogate'); $ord = 0x10000 + ($ord - 0xd800) * 0x400 + (hex($1) - 0xdc00); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Loader.pm new/Mojolicious-6.17/lib/Mojo/Loader.pm --- old/Mojolicious-6.14/lib/Mojo/Loader.pm 2015-06-30 20:02:38.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Loader.pm 2015-08-16 19:47:39.000000000 +0200 @@ -147,6 +147,7 @@ Extract embedded file from the C<DATA> section of a class, all files will be cached once they have been accessed for the first time. + # List embedded files say for keys %{data_section 'Foo::Bar'}; =head2 file_is_binary @@ -174,6 +175,7 @@ Load a class and catch exceptions. Note that classes are checked for a C<new> method to see if they are already loaded. + # Handle exceptions if (my $e = load_class 'Foo::Bar') { die ref $e ? "Exception: $e" : 'Not found!'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Reactor/Poll.pm new/Mojolicious-6.17/lib/Mojo/Reactor/Poll.pm --- old/Mojolicious-6.14/lib/Mojo/Reactor/Poll.pm 2015-04-27 03:01:29.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Reactor/Poll.pm 2015-08-16 04:23:51.000000000 +0200 @@ -64,7 +64,7 @@ } # Wait for timeout if poll can't be used - elsif ($timeout) { usleep $timeout * 1000 } + elsif ($timeout) { usleep($timeout * 1000) } # Timers (time should not change in between timers) my $now = steady_time; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Server.pm new/Mojolicious-6.17/lib/Mojo/Server.pm --- old/Mojolicious-6.14/lib/Mojo/Server.pm 2015-07-05 22:07:50.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Server.pm 2015-08-16 04:23:54.000000000 +0200 @@ -5,7 +5,7 @@ use Cwd 'abs_path'; use Mojo::Loader 'load_class'; use Mojo::Util 'md5_sum'; -use POSIX; +use POSIX (); use Scalar::Util 'blessed'; has app => sub { shift->build_app('Mojo::HelloWorld') }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Transaction/HTTP.pm new/Mojolicious-6.17/lib/Mojo/Transaction/HTTP.pm --- old/Mojolicious-6.14/lib/Mojo/Transaction/HTTP.pm 2015-02-24 23:59:20.000000000 +0100 +++ new/Mojolicious-6.17/lib/Mojo/Transaction/HTTP.pm 2015-08-16 04:23:55.000000000 +0200 @@ -142,16 +142,8 @@ # Nothing written yet $self->{$_} ||= 0 for qw(offset write); my $msg = $server ? $self->res : $self->req; - unless ($self->{http_state}) { - - # Connection header - my $headers = $msg->headers; - $headers->connection($self->keep_alive ? 'keep-alive' : 'close') - unless $headers->connection; - - # Switch to start-line - @$self{qw(http_state write)} = ('start_line', $msg->start_line_size); - } + @$self{qw(http_state write)} = ('start_line', $msg->start_line_size) + unless $self->{http_state}; # Start-line my $chunk = ''; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojo/Util.pm new/Mojolicious-6.17/lib/Mojo/Util.pm --- old/Mojolicious-6.14/lib/Mojo/Util.pm 2015-06-30 20:02:38.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojo/Util.pm 2015-08-21 19:29:42.000000000 +0200 @@ -233,9 +233,9 @@ sub slurp { my $path = shift; - croak qq{Can't open file "$path": $!} unless open my $file, '<', $path; - my $content = ''; - while ($file->sysread(my $buffer, 131072, 0)) { $content .= $buffer } + open my $file, '<', $path or croak qq{Can't open file "$path": $!}; + defined $file->sysread(my $content, -s $file, 0) + or croak qq{Can't read from file "$path": $!}; return $content; } @@ -244,9 +244,9 @@ sub spurt { my ($content, $path) = @_; - croak qq{Can't open file "$path": $!} unless open my $file, '>', $path; - croak qq{Can't write to file "$path": $!} - unless defined $file->syswrite($content); + open my $file, '>', $path or croak qq{Can't open file "$path": $!}; + defined $file->syswrite($content) + or croak qq{Can't write to file "$path": $!}; return $content; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious/Guides/FAQ.pod new/Mojolicious-6.17/lib/Mojolicious/Guides/FAQ.pod --- old/Mojolicious-6.14/lib/Mojolicious/Guides/FAQ.pod 2015-03-31 05:18:20.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojolicious/Guides/FAQ.pod 2015-08-13 03:31:46.000000000 +0200 @@ -66,7 +66,7 @@ First of all, you need to be aware that according to the L<perlpolicy>, only the two most recent stable release series of Perl are supported by the -community and receive bug fixes, which are currently 5.20.x and 5.18.x. +community and receive bug fixes, which are currently 5.22.x and 5.20.x. L<Mojolicious> follows this model and fully supports these two release series. In addition we will also keep the distribution installable up to a certain legacy version that we deem worthy of supporting, but not specifically optimize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious/Guides/Rendering.pod new/Mojolicious-6.17/lib/Mojolicious/Guides/Rendering.pod --- old/Mojolicious-6.14/lib/Mojolicious/Guides/Rendering.pod 2015-05-30 04:09:11.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojolicious/Guides/Rendering.pod 2015-08-19 05:20:41.000000000 +0200 @@ -292,18 +292,8 @@ These mappings can be easily extended or changed with L<Mojolicious/"types">. - # Application - package MyApp; - use Mojo::Base 'Mojolicious'; - - sub startup { - my $self = shift; - - # Add new MIME type - $self->types->type(txt => 'text/plain; charset=utf-8'); - } - - 1; + # Add new MIME type + $app->types->type(md => 'text/markdown'); =head2 Stash data @@ -572,18 +562,7 @@ To set a C<layout> stash value application wide you can use L<Mojolicious/"defaults">. - # Application - package MyApp; - use Mojo::Base 'Mojolicious'; - - sub startup { - my $self = shift; - - # Default layout - $self->defaults(layout => 'mylayout'); - } - - 1; + $app->defaults(layout => 'mylayout'); Layouts can also be used with L<Mojolicious::Controller/"render_to_string">, but the C<layout> value needs to be passed as a render argument (not a stash @@ -1319,18 +1298,7 @@ Templates stored in files are expected to be C<UTF-8> by default, but that can be easily changed with L<Mojolicious::Renderer/"encoding">. - # Application - package MyApp; - use Mojo::Base 'Mojolicious'; - - sub startup { - my $self = shift; - - # Different encoding - $self->renderer->encoding('koi8-r'); - } - - 1; + $app->renderer->encoding('koi8-r'); All templates from the C<DATA> section are bound to the encoding of the Perl script. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious/Plugin/TagHelpers.pm new/Mojolicious-6.17/lib/Mojolicious/Plugin/TagHelpers.pm --- old/Mojolicious-6.14/lib/Mojolicious/Plugin/TagHelpers.pm 2015-07-02 05:10:07.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojolicious/Plugin/TagHelpers.pm 2015-08-16 04:24:08.000000000 +0200 @@ -75,6 +75,7 @@ my $value = $attrs{value} // ''; if ($type eq 'checkbox' || $type eq 'radio') { $attrs{value} = $value; + delete $attrs{checked} if @values; $attrs{checked} = undef if grep { $_ eq $value } @values; } @@ -117,10 +118,13 @@ sub _option { my ($values, $pair) = @_; + $pair = [$pair => $pair] unless ref $pair eq 'ARRAY'; - my %attrs = (value => $pair->[1]); - $attrs{selected} = undef if exists $values->{$pair->[1]}; - return _tag('option', %attrs, @$pair[2 .. $#$pair], $pair->[0]); + my %attrs = (value => $pair->[1], @$pair[2 .. $#$pair]); + delete $attrs{selected} if keys %$values; + $attrs{selected} = undef if $values->{$pair->[1]}; + + return _tag('option', %attrs, $pair->[0]); } sub _select_field { @@ -252,13 +256,13 @@ =head2 check_box %= check_box employed => 1 - %= check_box employed => 1, disabled => 'disabled' + %= check_box employed => 1, checked => undef, id => 'foo' Generate C<input> tag of type C<checkbox>. Previous input values will automatically get picked up and shown as default. <input name="employed" type="checkbox" value="1"> - <input disabled="disabled" name="employed" type="checkbox" value="1"> + <input checked id="foo" name="employed" type="checkbox" value="1"> =head2 color_field @@ -513,13 +517,13 @@ =head2 radio_button %= radio_button country => 'germany' - %= radio_button country => 'germany', id => 'foo' + %= radio_button country => 'germany', checked => undef, id => 'foo' Generate C<input> tag of type C<radio>. Previous input values will automatically get picked up and shown as default. <input name="country" type="radio" value="germany"> - <input id="foo" name="country" type="radio" value="germany"> + <input checked id="foo" name="country" type="radio" value="germany"> =head2 range_field @@ -551,7 +555,7 @@ %= select_field country => [qw(de en)] %= select_field country => [[Germany => 'de'], 'en'], id => 'eu' - %= select_field country => [[Germany => 'de', disabled => 'disabled'], 'en'] + %= select_field country => [[Germany => 'de', selected => 'selected'], 'en'] %= select_field country => [c(EU => [[Germany => 'de'], 'en'], id => 'eu')] %= select_field country => [c(EU => [qw(de en)]), c(Asia => [qw(cn jp)])] @@ -568,7 +572,7 @@ <option value="en">en</option> </select> <select name="country"> - <option disabled="disabled" value="de">Germany</option> + <option selected="selected" value="de">Germany</option> <option value="en">en</option> </select> <select name="country"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious/Validator/Validation.pm new/Mojolicious-6.17/lib/Mojolicious/Validator/Validation.pm --- old/Mojolicious-6.14/lib/Mojolicious/Validator/Validation.pm 2015-07-07 05:56:16.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojolicious/Validator/Validation.pm 2015-08-16 04:24:12.000000000 +0200 @@ -23,10 +23,10 @@ return $self unless $self->is_valid; - my $cb = $self->validator->checks->{$check}; - my $name = $self->topic; - my $input = $self->input->{$name}; - for my $value (ref $input eq 'ARRAY' ? @$input : $input) { + my $cb = $self->validator->checks->{$check}; + my $name = $self->topic; + my $values = $self->output->{$name}; + for my $value (ref $values eq 'ARRAY' ? @$values : $values) { next unless my $result = $self->$cb($name, $value, @_); return $self->error($name => [$check, $result, @_]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious/templates/perldoc.html.ep new/Mojolicious-6.17/lib/Mojolicious/templates/perldoc.html.ep --- old/Mojolicious-6.14/lib/Mojolicious/templates/perldoc.html.ep 2015-03-03 22:20:45.000000000 +0100 +++ new/Mojolicious-6.17/lib/Mojolicious/templates/perldoc.html.ep 2015-08-13 03:31:46.000000000 +0200 @@ -24,7 +24,6 @@ } h1, h2, h3 { color: #2a2a2a; - display: inline-block; font-size: 1.5em; margin: 0; position: relative; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/lib/Mojolicious.pm new/Mojolicious-6.17/lib/Mojolicious.pm --- old/Mojolicious-6.14/lib/Mojolicious.pm 2015-07-09 02:50:05.000000000 +0200 +++ new/Mojolicious-6.17/lib/Mojolicious.pm 2015-08-20 08:09:59.000000000 +0200 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.14'; +our $VERSION = '6.17'; sub AUTOLOAD { my $self = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojo/daemon.t new/Mojolicious-6.17/t/mojo/daemon.t --- old/Mojolicious-6.14/t/mojo/daemon.t 2015-07-05 22:08:27.000000000 +0200 +++ new/Mojolicious-6.17/t/mojo/daemon.t 2015-08-13 03:31:46.000000000 +0200 @@ -162,16 +162,14 @@ $tx = $ua->get('/close/' => {Connection => 'close'}); ok !$tx->keep_alive, 'will not be kept alive'; ok $tx->kept_alive, 'was kept alive'; -is $tx->res->code, 200, 'right status'; -is $tx->res->headers->connection, 'close', 'right "Connection" value'; +is $tx->res->code, 200, 'right status'; is $tx->res->body, 'Whatever!', 'right content'; # Second non-keep-alive request $tx = $ua->get('/close/' => {Connection => 'close'}); ok !$tx->keep_alive, 'will not be kept alive'; ok !$tx->kept_alive, 'was not kept alive'; -is $tx->res->code, 200, 'right status'; -is $tx->res->headers->connection, 'close', 'right "Connection" value'; +is $tx->res->code, 200, 'right status'; is $tx->res->body, 'Whatever!', 'right content'; # HTTP/1.0 request @@ -179,10 +177,9 @@ $tx->req->version('1.0'); $tx = $ua->start($tx); ok !$tx->keep_alive, 'will not be kept alive'; -is $tx->res->version, '1.1', 'right version'; -is $tx->res->code, 200, 'right status'; -is $tx->res->headers->connection, 'close', 'right "Connection" value'; -is $tx->res->body, 'Whatever!', 'right content'; +is $tx->res->version, '1.1', 'right version'; +is $tx->res->code, 200, 'right status'; +is $tx->res->body, 'Whatever!', 'right content'; # POST request $tx = $ua->post('/fun/' => {Expect => 'fun'} => 'foo bar baz' x 128); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojo/dom.t new/Mojolicious-6.17/t/mojo/dom.t --- old/Mojolicious-6.14/t/mojo/dom.t 2015-04-22 18:30:56.000000000 +0200 +++ new/Mojolicious-6.17/t/mojo/dom.t 2015-08-14 18:45:17.000000000 +0200 @@ -9,6 +9,7 @@ is(Mojo::DOM->new->parse(''), '', 'right result'); is(Mojo::DOM->new->at('p'), undef, 'no result'); is(Mojo::DOM->new->append_content(''), '', 'right result'); +is(Mojo::DOM->new->all_text, '', 'right result'); # Simple (basics) my $dom = Mojo::DOM->new( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojo/request.t new/Mojolicious-6.17/t/mojo/request.t --- old/Mojolicious-6.14/t/mojo/request.t 2015-06-30 20:02:38.000000000 +0200 +++ new/Mojolicious-6.17/t/mojo/request.t 2015-08-13 03:31:46.000000000 +0200 @@ -1292,7 +1292,7 @@ is $clone->headers->connection, 'Upgrade', 'right "Connection" value'; is $clone->headers->upgrade, 'websocket', 'right "Upgrade" value'; is $clone->headers->host, 'example.com', 'right "Host" value'; -is $clone->headers->content_length, 0, 'right "Content-Length" value'; +is $req->headers->content_length, 0, 'right "Content-Length" value'; is $clone->headers->sec_websocket_accept, 'abcdef=', 'right "Sec-WebSocket-Key" value'; is $clone->headers->sec_websocket_protocol, 'sample', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojo/response.t new/Mojolicious-6.17/t/mojo/response.t --- old/Mojolicious-6.14/t/mojo/response.t 2015-05-16 19:59:04.000000000 +0200 +++ new/Mojolicious-6.17/t/mojo/response.t 2015-08-13 03:31:46.000000000 +0200 @@ -698,7 +698,6 @@ is $res->version, '1.1', 'right version'; is $res->headers->connection, 'keep-alive', 'right "Connection" value'; is $res->headers->date, 'Sun, 17 Aug 2008 16:27:35 GMT', 'right "Date" value'; -is $res->headers->content_length, 0, 'right "Content-Length" value'; # Build full HTTP 1.1 response $res = Mojo::Message::Response->new; @@ -879,8 +878,8 @@ is $res->version, '1.1', 'right version'; is $res->headers->connection, 'Upgrade', 'right "Connection" value'; is $res->headers->date, 'Sun, 17 Aug 2008 16:27:35 GMT', 'right "Date" value'; -is $res->headers->upgrade, 'websocket', 'right "Upgrade" value'; is $res->headers->content_length, 0, 'right "Content-Length" value'; +is $res->headers->upgrade, 'websocket', 'right "Upgrade" value'; is $res->headers->sec_websocket_accept, 'abcdef=', 'right "Sec-WebSocket-Accept" value'; is $res->headers->sec_websocket_protocol, 'sample', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojo/user_agent.t new/Mojolicious-6.17/t/mojo/user_agent.t --- old/Mojolicious-6.14/t/mojo/user_agent.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.17/t/mojo/user_agent.t 2015-08-13 03:31:46.000000000 +0200 @@ -49,7 +49,12 @@ get '/one' => sub { my $c = shift; - $c->res->version('1.0')->headers->connection('test'); + + $c->res->version('1.0'); + if (my $connection = $c->param('connection')) { + $c->res->headers->connection($connection); + } + $c->render(text => 'One!'); }; @@ -141,18 +146,24 @@ $tx = $ua->get('/'); ok $tx->success, 'successful'; ok !$tx->kept_alive, 'kept connection not alive'; -is $tx->res->code, 200, 'right status'; +is $tx->res->version, '1.1', 'right version'; +is $tx->res->code, 200, 'right status'; +ok !$tx->res->headers->connection, 'no "Connection" value'; is $tx->res->body, 'works!', 'right content'; # Again $tx = $ua->get('/'); ok $tx->success, 'successful'; ok $tx->kept_alive, 'kept connection alive'; -is $tx->res->code, 200, 'right status'; +is $tx->res->version, '1.1', 'right version'; +is $tx->res->code, 200, 'right status'; +ok !$tx->res->headers->connection, 'no "Connection" value'; is $tx->res->body, 'works!', 'right content'; $tx = $ua->get('/'); ok $tx->success, 'successful'; -is $tx->res->code, 200, 'right status'; +is $tx->res->version, '1.1', 'right version'; +is $tx->res->code, 200, 'right status'; +ok !$tx->res->headers->connection, 'no "Connection" value'; is $tx->res->body, 'works!', 'right content'; # Shortcuts for common request methods @@ -165,19 +176,29 @@ is $ua->put('/method')->res->body, 'PUT', 'right method'; # No keep-alive -$tx = $ua->get('/one'); +$tx = $ua->get('/one?connection=test'); ok $tx->success, 'successful'; ok !$tx->keep_alive, 'connection will not be kept alive'; -is $tx->res->code, 200, 'right status'; +is $tx->res->version, '1.0', 'right version'; +is $tx->res->code, 200, 'right status'; is $tx->res->headers->connection, 'test', 'right "Connection" value'; is $tx->res->body, 'One!', 'right content'; -$tx = $ua->get('/one'); +$tx = $ua->get('/one?connection=test'); ok $tx->success, 'successful'; ok !$tx->kept_alive, 'kept connection not alive'; ok !$tx->keep_alive, 'connection will not be kept alive'; -is $tx->res->code, 200, 'right status'; +is $tx->res->version, '1.0', 'right version'; +is $tx->res->code, 200, 'right status'; is $tx->res->headers->connection, 'test', 'right "Connection" value'; is $tx->res->body, 'One!', 'right content'; +$tx = $ua->get('/one'); +ok $tx->success, 'successful'; +ok !$tx->kept_alive, 'kept connection not alive'; +ok !$tx->keep_alive, 'connection will not be kept alive'; +is $tx->res->version, '1.0', 'right version'; +is $tx->res->code, 200, 'right status'; +ok !$tx->res->headers->connection, 'no "Connection" value'; +is $tx->res->body, 'One!', 'right content'; # Error in callback Mojo::IOLoop->singleton->reactor->unsubscribe('error'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojolicious/static_lite_app.t new/Mojolicious-6.17/t/mojolicious/static_lite_app.t --- old/Mojolicious-6.14/t/mojolicious/static_lite_app.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.17/t/mojolicious/static_lite_app.t 2015-08-13 03:31:46.000000000 +0200 @@ -173,8 +173,7 @@ # Empty file $t->get_ok('/hello4.txt')->status_is(200) - ->header_is(Server => 'Mojolicious (Perl)') - ->header_is('Content-Length' => 0)->content_is(''); + ->header_is(Server => 'Mojolicious (Perl)')->content_is(''); # Partial empty file $t->get_ok('/hello4.txt' => {Range => 'bytes=0-0'})->status_is(416) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojolicious/tag_helper_lite_app.t new/Mojolicious-6.17/t/mojolicious/tag_helper_lite_app.t --- old/Mojolicious-6.14/t/mojolicious/tag_helper_lite_app.t 2015-04-02 16:19:51.000000000 +0200 +++ new/Mojolicious-6.17/t/mojolicious/tag_helper_lite_app.t 2015-08-16 00:20:49.000000000 +0200 @@ -208,6 +208,7 @@ <form action="/multibox"> <input name="foo" type="checkbox" value="one"> <input name="foo" type="checkbox" value="two"> + <input checked name="foo" type="checkbox" value="three"> <input type="submit" value="Ok"> </form> EOF @@ -217,15 +218,17 @@ <form action="/multibox"> <input name="foo" type="checkbox" value="one"> <input checked name="foo" type="checkbox" value="two"> + <input name="foo" type="checkbox" value="three"> <input type="submit" value="Ok"> </form> EOF # Checkboxes with one right and one wrong value -$t->get_ok('/multibox?foo=one&foo=three')->status_is(200)->content_is(<<EOF); +$t->get_ok('/multibox?foo=one&foo=four')->status_is(200)->content_is(<<EOF); <form action="/multibox"> <input checked name="foo" type="checkbox" value="one"> <input name="foo" type="checkbox" value="two"> + <input name="foo" type="checkbox" value="three"> <input type="submit" value="Ok"> </form> EOF @@ -235,6 +238,7 @@ <form action="/multibox"> <input name="foo" type="checkbox" value="one"> <input name="foo" type="checkbox" value="two"> + <input name="foo" type="checkbox" value="three"> <input type="submit" value="Ok"> </form> EOF @@ -244,6 +248,7 @@ <form action="/multibox"> <input checked name="foo" type="checkbox" value="one"> <input checked name="foo" type="checkbox" value="two"> + <input name="foo" type="checkbox" value="three"> <input type="submit" value="Ok"> </form> EOF @@ -337,11 +342,15 @@ . '<option value="b">b</option>' . '</optgroup>' . "</select>\n " + . '<select name="h">' + . '<option selected value="i">I</option>' + . '<option value="j">J</option>' + . "</select>\n " . '<input type="submit" value="Ok">' . "\n</form>\n"); # Selection with values -$t->put_ok('/selection?a=e&foo=bar&bar=baz&yada=b')->status_is(200) +$t->put_ok('/selection?a=e&foo=bar&bar=baz&yada=b&h=j')->status_is(200) ->content_is("<form action=\"/selection?_method=PUT\" method=\"POST\">\n " . '<select name="a">' . '<option value="b">b</option>' @@ -366,11 +375,15 @@ . '<option selected value="b">b</option>' . '</optgroup>' . "</select>\n " + . '<select name="h">' + . '<option value="i">I</option>' + . '<option selected value="j">J</option>' + . "</select>\n " . '<input type="submit" value="Ok">' . "\n</form>\n"); # Selection with multiple values -$t->put_ok('/selection?foo=bar&a=e&foo=baz&bar=d&yada=a&yada=b') +$t->put_ok('/selection?foo=bar&a=e&foo=baz&bar=d&yada=a&yada=b&h=i&h=j') ->status_is(200) ->content_is("<form action=\"/selection?_method=PUT\" method=\"POST\">\n " . '<select name="a">' @@ -396,6 +409,10 @@ . '<option selected value="b">b</option>' . '</optgroup>' . "</select>\n " + . '<select name="h">' + . '<option selected value="i">I</option>' + . '<option selected value="j">J</option>' + . "</select>\n " . '<input type="submit" value="Ok">' . "\n</form>\n"); @@ -425,6 +442,10 @@ . '<option value="b">b</option>' . '</optgroup>' . "</select>\n " + . '<select name="h">' + . '<option selected value="i">I</option>' + . '<option value="j">J</option>' + . "</select>\n " . '<input type="submit" value="Ok">' . "\n</form>\n"); @@ -561,6 +582,7 @@ %= form_for multibox => begin %= check_box foo => 'one' %= check_box foo => 'two' + %= check_box foo => 'three', checked => undef %= submit_button %= end @@ -601,6 +623,7 @@ %= select_field foo => [qw(bar baz)], multiple => 'multiple' %= select_field bar => [['D' => 'd', disabled => 'disabled'], 'baz'] %= select_field yada => [c(test => [qw(a b)], class => 'x')]; + %= select_field h => [['I' => 'i', selected => undef], ['J' => 'j']] %= submit_button %= end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/mojolicious/validation_lite_app.t new/Mojolicious-6.17/t/mojolicious/validation_lite_app.t --- old/Mojolicious-6.14/t/mojolicious/validation_lite_app.t 2015-07-08 03:43:57.000000000 +0200 +++ new/Mojolicious-6.17/t/mojolicious/validation_lite_app.t 2015-08-13 03:31:46.000000000 +0200 @@ -157,7 +157,7 @@ # Multiple empty values $validation = $t->app->validation; ok !$validation->has_data, 'no data'; -$validation->input({foo => ['', 'bar', '']}); +$validation->input({foo => ['', 'bar', ''], bar => ['', 'baz', '']}); ok $validation->has_data, 'has data'; ok !$validation->required('foo')->is_valid, 'not valid'; is_deeply $validation->output, {}, 'right result'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.14/t/pod_coverage.t new/Mojolicious-6.17/t/pod_coverage.t --- old/Mojolicious-6.14/t/pod_coverage.t 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.17/t/pod_coverage.t 2015-08-13 03:30:53.000000000 +0200 @@ -7,7 +7,4 @@ plan skip_all => 'Test::Pod::Coverage 1.04+ required for this test!' unless eval 'use Test::Pod::Coverage 1.04; 1'; -# DEPRECATED in Clinking Beer Mugs! -my @mugs = qw(build_body build_headers); - -all_pod_coverage_ok({also_private => [@mugs]}); +all_pod_coverage_ok();