Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2015-06-23 11:59:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-05-18 22:29:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2015-06-23 11:59:40.000000000 +0200 @@ -1,0 +2,13 @@ +Sun Jun 21 08:34:09 UTC 2015 - co...@suse.com + +- updated to 6.12 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 6.12 2015-06-18 + - Welcome to the Mojolicious core team Dan Book. + - Added TO_JSON method to Mojo::Collection. (wttw) + - Added find_packages function to Mojo::Loader. + - Fixed bug in Mojo::Message where multipart content would get downgraded + unnecessarily. + +------------------------------------------------------------------- Old: ---- Mojolicious-6.11.tar.gz New: ---- Mojolicious-6.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.vC72hF/_old 2015-06-23 11:59:40.000000000 +0200 +++ /var/tmp/diff_new_pack.vC72hF/_new 2015-06-23 11:59:40.000000000 +0200 @@ -17,14 +17,14 @@ Name: perl-Mojolicious -Version: 6.11 +Version: 6.12 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework License: Artistic-2.0 Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Mojolicious/ -Source0: http://www.cpan.org/authors/id/S/SR/SRI/%{cpan_name}-%{version}.tar.gz +Source0: http://www.cpan.org/authors/id/D/DB/DBOOK/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ Mojolicious-6.11.tar.gz -> Mojolicious-6.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/Changes new/Mojolicious-6.12/Changes --- old/Mojolicious-6.11/Changes 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.12/Changes 2015-06-18 23:42:06.000000000 +0200 @@ -1,6 +1,13 @@ +6.12 2015-06-18 + - Welcome to the Mojolicious core team Dan Book. + - Added TO_JSON method to Mojo::Collection. (wttw) + - Added find_packages function to Mojo::Loader. + - Fixed bug in Mojo::Message where multipart content would get downgraded + unnecessarily. + 6.11 2015-05-16 - - Deprecated build_body and build_headers methods in Mojo::Content. + - Deprecated Mojo::Content::build_body and Mojo::Content::build_headers. - Added headers_contain method to Mojo::Content. - Updated jQuery to version 2.1.4. - Fixed indentation of ASCII art in documentation browser. (jberger) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/META.json new/Mojolicious-6.12/META.json --- old/Mojolicious-6.11/META.json 2015-05-17 00:13:27.000000000 +0200 +++ new/Mojolicious-6.12/META.json 2015-06-18 23:44:58.000000000 +0200 @@ -4,7 +4,7 @@ "Sebastian Riedel <s...@cpan.org>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001", + "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001", "license" : [ "artistic_2" ], @@ -54,5 +54,5 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "6.11" + "version" : "6.12" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/META.yml new/Mojolicious-6.12/META.yml --- old/Mojolicious-6.11/META.yml 2015-05-17 00:13:27.000000000 +0200 +++ new/Mojolicious-6.12/META.yml 2015-06-18 23:44:58.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001' +generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -29,4 +29,4 @@ homepage: http://mojolicio.us license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '6.11' +version: '6.12' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Asset/File.pm new/Mojolicious-6.12/lib/Mojo/Asset/File.pm --- old/Mojolicious-6.11/lib/Mojo/Asset/File.pm 2015-02-24 23:50:22.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Asset/File.pm 2015-06-10 16:14:05.000000000 +0200 @@ -223,7 +223,7 @@ my $true = $file->is_file; -True. +True, this is a L<Mojo::Asset::File> object. =head2 move_to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Asset.pm new/Mojolicious-6.12/lib/Mojo/Asset.pm --- old/Mojolicious-6.11/lib/Mojo/Asset.pm 2015-02-25 22:40:32.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Asset.pm 2015-06-10 16:14:05.000000000 +0200 @@ -97,7 +97,7 @@ my $false = $asset->is_file; -False. +False, this is not a L<Mojo::Asset::File> object. =head2 is_range diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Collection.pm new/Mojolicious-6.12/lib/Mojo/Collection.pm --- old/Mojolicious-6.11/lib/Mojo/Collection.pm 2015-02-25 00:02:13.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Collection.pm 2015-06-10 16:14:05.000000000 +0200 @@ -9,6 +9,8 @@ our @EXPORT_OK = ('c'); +sub TO_JSON { [@{shift()}] } + sub c { __PACKAGE__->new(@_) } sub compact { @@ -152,6 +154,12 @@ L<Mojo::Collection> implements the following methods. +=head2 TO_JSON + + my $array = $collection->TO_JSON; + +Alias for L</"to_array">. + =head2 compact my $new = $collection->compact; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Content/MultiPart.pm new/Mojolicious-6.12/lib/Mojo/Content/MultiPart.pm --- old/Mojolicious-6.11/lib/Mojo/Content/MultiPart.pm 2015-05-16 18:41:56.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojo/Content/MultiPart.pm 2015-06-10 16:14:05.000000000 +0200 @@ -286,7 +286,7 @@ my $true = $multi->is_multipart; -True. +True, this is a L<Mojo::Content::MultiPart> object. =head2 new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Content.pm new/Mojolicious-6.12/lib/Mojo/Content.pm --- old/Mojolicious-6.11/lib/Mojo/Content.pm 2015-05-16 19:59:39.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojo/Content.pm 2015-06-10 16:14:05.000000000 +0200 @@ -538,7 +538,7 @@ my $false = $content->is_multipart; -False. +False, this is not a L<Mojo::Content::MultiPart> object. =head2 is_parsing_body diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Loader.pm new/Mojolicious-6.12/lib/Mojo/Loader.pm --- old/Mojolicious-6.11/lib/Mojo/Loader.pm 2015-03-16 03:48:12.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Loader.pm 2015-06-18 23:27:54.000000000 +0200 @@ -7,7 +7,8 @@ use Mojo::Exception; use Mojo::Util qw(b64_decode class_to_path); -our @EXPORT_OK = qw(data_section file_is_binary find_modules load_class); +our @EXPORT_OK + = qw(data_section file_is_binary find_modules find_packages load_class); my (%BIN, %CACHE); @@ -33,6 +34,12 @@ return sort keys %modules; } +sub find_packages { + my $ns = shift; + no strict 'refs'; + return sort map { /^(.+)::$/ ? "${ns}::$1" : () } keys %{"${ns}::"}; +} + sub load_class { my $class = shift; @@ -148,6 +155,12 @@ Check if embedded file from the C<DATA> section of a class was Base64 encoded. +=head2 find_packages + + my @pkgs = find_packages 'MyApp::Namespace'; + +Search for packages in a namespace non-recursively. + =head2 find_modules my @modules = find_modules 'MyApp::Namespace'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Message.pm new/Mojolicious-6.12/lib/Mojo/Message.pm --- old/Mojolicious-6.11/lib/Mojo/Message.pm 2015-05-16 19:59:36.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojo/Message.pm 2015-06-10 16:14:05.000000000 +0200 @@ -20,15 +20,13 @@ sub body { my $self = shift; - # Multipart content needs to be downgraded + # Get my $content = $self->content; + return $content->is_multipart ? '' : $content->asset->slurp unless @_; + + # Set (multipart content needs to be downgraded) $content = $self->content(Mojo::Content::Single->new)->content if $content->is_multipart; - - # Get - return $content->asset->slurp unless @_; - - # Set $content->asset(Mojo::Asset::Memory->new->add_chunk(@_)); return $self; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Template.pm new/Mojolicious-6.12/lib/Mojo/Template.pm --- old/Mojolicious-6.11/lib/Mojo/Template.pm 2015-03-16 03:50:25.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Template.pm 2015-06-10 16:14:05.000000000 +0200 @@ -343,7 +343,7 @@ <%== Perl expression, replaced with XML escaped result %> <%# Comment, useful for debugging %> <%% Replaced with "<%", useful for generating templates %> - % Perl code line, treated as "<% line =%>" + % Perl code line, treated as "<% line =%>" (explained later) %= Perl expression line, treated as "<%= line %>" %== Perl expression line, treated as "<%== line %>" %# Comment line, useful for debugging @@ -363,7 +363,9 @@ Whitespace characters around tags can be trimmed by adding an additional equal sign to the end of a tag. - <%= All whitespace characters around this expression will be trimmed =%> + <% for (1 .. 3) { %> + <%= 'Trim all whitespace characters around this expression' =%> + <% } %> Newline characters can be escaped with a backslash. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Transaction/WebSocket.pm new/Mojolicious-6.12/lib/Mojo/Transaction/WebSocket.pm --- old/Mojolicious-6.11/lib/Mojo/Transaction/WebSocket.pm 2015-04-09 03:46:14.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojo/Transaction/WebSocket.pm 2015-06-10 16:14:05.000000000 +0200 @@ -586,7 +586,7 @@ my $true = $ws->is_websocket; -True. +True, this is a L<Mojo::Transaction::WebSocket> object. =head2 kept_alive diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Transaction.pm new/Mojolicious-6.12/lib/Mojo/Transaction.pm --- old/Mojolicious-6.11/lib/Mojo/Transaction.pm 2015-03-16 03:50:30.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojo/Transaction.pm 2015-06-10 16:14:05.000000000 +0200 @@ -237,7 +237,7 @@ my $false = $tx->is_websocket; -False. +False, this is not a L<Mojo::Transaction::WebSocket> object. =head2 is_writing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojo/Util.pm new/Mojolicious-6.12/lib/Mojo/Util.pm --- old/Mojolicious-6.11/lib/Mojo/Util.pm 2015-04-22 21:37:08.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojo/Util.pm 2015-06-10 16:14:05.000000000 +0200 @@ -775,7 +775,7 @@ C<^A-Za-z0-9\-._~>. # "foo%3Bbar" - url_unescape 'foo;bar'; + url_escape 'foo;bar'; =head2 url_unescape diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Commands.pm new/Mojolicious-6.12/lib/Mojolicious/Commands.pm --- old/Mojolicious-6.11/lib/Mojolicious/Commands.pm 2015-02-24 23:45:00.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/Commands.pm 2015-06-18 23:27:54.000000000 +0200 @@ -2,7 +2,7 @@ use Mojo::Base 'Mojolicious::Command'; use Getopt::Long 'GetOptionsFromArray'; -use Mojo::Loader qw(find_modules load_class); +use Mojo::Loader qw(find_modules find_packages load_class); use Mojo::Server; use Mojo::Util 'tablify'; @@ -62,7 +62,7 @@ my %all; for my $ns (@{$self->namespaces}) { $all{substr $_, length "${ns}::"} //= $_->new->description - for grep { _command($_) } find_modules $ns; + for grep { _command($_) } find_modules($ns), find_packages($ns); } my @rows = map { [" $_", $all{$_}] } sort keys %all; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Controller.pm new/Mojolicious-6.12/lib/Mojolicious/Controller.pm --- old/Mojolicious-6.11/lib/Mojolicious/Controller.pm 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojolicious/Controller.pm 2015-06-18 23:27:54.000000000 +0200 @@ -896,6 +896,9 @@ # "http://127.0.0.1:3000/index.html" if application was started with Morbo $c->url_for('/index.html')->to_abs; + # "https://127.0.0.1:443/index.html" if application was started with Morbo + $c->url_for('/index.html')->to_abs->scheme('https')->port(443); + # "/index.html?foo=bar" if application is deployed under "/" $c->url_for('/index.html')->query(foo => 'bar'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Guides/Cookbook.pod new/Mojolicious-6.12/lib/Mojolicious/Guides/Cookbook.pod --- old/Mojolicious-6.11/lib/Mojolicious/Guides/Cookbook.pod 2015-04-17 15:39:36.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojolicious/Guides/Cookbook.pod 2015-06-10 16:14:05.000000000 +0200 @@ -212,7 +212,7 @@ =head2 Apache/CGI C<CGI> is supported out of the box and your L<Mojolicious> application will -automatically detect that it is executed as a C<CGI> script. It's use in +automatically detect that it is executed as a C<CGI> script. Its use in production environments is discouraged though, because as a result of how C<CGI> works, it is very slow and many web servers are making it exceptionally hard to configure properly. @@ -452,7 +452,7 @@ =head2 Timers -Another primary feature of the event loop are timers, which are created with +Timers, another primary feature of the event loop, are created with L<Mojo::IOLoop/"timer"> and can for example be used to delay rendering of a response, and unlike C<sleep>, won't block any other requests that might be processed concurrently. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Guides/Rendering.pod new/Mojolicious-6.12/lib/Mojolicious/Guides/Rendering.pod --- old/Mojolicious-6.11/lib/Mojolicious/Guides/Rendering.pod 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojolicious/Guides/Rendering.pod 2015-06-10 16:14:05.000000000 +0200 @@ -72,7 +72,7 @@ <%== Perl expression, replaced with result %> <%# Comment, useful for debugging %> <%% Replaced with "<%", useful for generating templates %> - % Perl code line, treated as "<% line =%>" + % Perl code line, treated as "<% line =%>" (explained later) %= Perl expression line, treated as "<%= line %>" %== Perl expression line, treated as "<%== line %>" %# Comment line, useful for debugging @@ -129,7 +129,7 @@ sign to the end of a tag. <% for (1 .. 3) { %> - <%= 'trim all whitespace characters around this expression' =%> + <%= 'Trim all whitespace characters around this expression' =%> <% } %> Newline characters can be escaped with a backslash. @@ -443,10 +443,10 @@ By now you've probably already encountered the built-in 404 (Not Found) and 500 (Server Error) pages, that get rendered automatically when you make a mistake. -Those are fallbacks for when your own exception handling fails, but especially -during development they can also be a great help, you can render them manually -with the helpers L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>exception"> -and L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>not_found">. +Those are fallbacks for when your own exception handling fails, which can be +especially helpful during development. You can also render them manually with +the helpers L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>exception"> and +L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>not_found">. use Mojolicious::Lite; use Scalar::Util 'looks_like_number'; @@ -1128,8 +1128,8 @@ 1; -The C<register> method will be called when you load the plugin and to add your -helper to the application you can use L<Mojolicious/"helper">. +The C<register> method will be called when you load the plugin. And to add your +helper to the application, you can use L<Mojolicious/"helper">. use Mojolicious::Lite; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Guides/Routing.pod new/Mojolicious-6.12/lib/Mojolicious/Guides/Routing.pod --- old/Mojolicious-6.11/lib/Mojolicious/Guides/Routing.pod 2015-04-25 06:33:02.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojolicious/Guides/Routing.pod 2015-06-18 23:27:54.000000000 +0200 @@ -372,7 +372,8 @@ $r->get('/bye') ->to(namespace => 'MyApp::MyController::Foo::Bar', action => 'bye'); -The C<controller> is always appended to this C<namespace> if available. +The C<controller> is always converted from C<snake_case> to C<CamelCase> with +L<Mojo::Util/"camelize">, and then appended to this C<namespace>. # /bye -> MyApp::MyController::Foo::Bar->bye $r->get('/bye')->to('foo-bar#bye', namespace => 'MyApp::MyController'); @@ -381,7 +382,9 @@ $r->get('/hey')->to('Foo::Bar#hey', namespace => 'MyApp::MyController'); You can also change the default namespaces for all routes in the application -with the router attribute L<Mojolicious::Routes/"namespaces">. +with the router attribute L<Mojolicious::Routes/"namespaces">, which usually +defaults to a namespace based on the application class (C<MyApp::Controller>), +as well as the bare application class (C<MyApp>). $r->namespaces(['MyApp::MyController']); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Guides/Tutorial.pod new/Mojolicious-6.12/lib/Mojolicious/Guides/Tutorial.pod --- old/Mojolicious-6.11/lib/Mojolicious/Guides/Tutorial.pod 2015-03-27 23:55:03.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/Guides/Tutorial.pod 2015-06-18 23:27:54.000000000 +0200 @@ -935,10 +935,11 @@ done_testing(); -Run all tests with the command L<Mojolicious::Command::test>. +Just run your tests with the command L<Mojolicious::Command::test> or L<prove>. $ ./myapp.pl test - $ ./myapp.pl test -v + $ ./myapp.pl test -v t/basic.t + $ prove -l -v t/basic.t =head1 MORE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Renderer.pm new/Mojolicious-6.12/lib/Mojolicious/Renderer.pm --- old/Mojolicious-6.11/lib/Mojolicious/Renderer.pm 2015-03-16 03:07:23.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/Renderer.pm 2015-06-18 23:27:54.000000000 +0200 @@ -290,7 +290,9 @@ Classes to use for finding templates in C<DATA> sections with L<Mojo::Loader>, first one has the highest precedence, defaults to C<main>. Only files with -exactly two extensions will be used, like C<index.html.ep>. +exactly two extensions will be used, like C<index.html.ep>. Note that these +classes need to have already been loaded during application startup for +templates to be detected. # Add another class with templates in DATA section push @{$renderer->classes}, 'Mojolicious::Plugin::Fun'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Routes.pm new/Mojolicious-6.12/lib/Mojolicious/Routes.pm --- old/Mojolicious-6.11/lib/Mojolicious/Routes.pm 2015-03-26 23:58:32.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/Routes.pm 2015-06-18 23:27:54.000000000 +0200 @@ -265,7 +265,7 @@ =head2 namespaces my $namespaces = $r->namespaces; - $r = $r->namespaces(['Foo::Bar::Controller']); + $r = $r->namespaces(['MyApp::Controller', 'MyApp']); Namespaces to load controllers from. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/Static.pm new/Mojolicious-6.12/lib/Mojolicious/Static.pm --- old/Mojolicious-6.11/lib/Mojolicious/Static.pm 2015-02-26 22:22:45.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/Static.pm 2015-06-18 23:27:54.000000000 +0200 @@ -177,7 +177,9 @@ Classes to use for finding files in C<DATA> sections with L<Mojo::Loader>, first one has the highest precedence, defaults to C<main>. Only files with -exactly one extension will be used, like C<index.html>. +exactly one extension will be used, like C<index.html>. Note that these classes +need to have already been loaded during application startup for files to be +detected. # Add another class with static files in DATA section push @{$static->classes}, 'Mojolicious::Plugin::Fun'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious/templates/exception.html.ep new/Mojolicious-6.12/lib/Mojolicious/templates/exception.html.ep --- old/Mojolicious-6.11/lib/Mojolicious/templates/exception.html.ep 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.12/lib/Mojolicious/templates/exception.html.ep 2015-06-10 16:14:05.000000000 +0200 @@ -16,3 +16,9 @@ </style> <body><div id="raptor"></div></body> </html> +<!-- a padding to disable MSIE and Chrome friendly error page --> +<!-- a padding to disable MSIE and Chrome friendly error page --> +<!-- a padding to disable MSIE and Chrome friendly error page --> +<!-- a padding to disable MSIE and Chrome friendly error page --> +<!-- a padding to disable MSIE and Chrome friendly error page --> +<!-- a padding to disable MSIE and Chrome friendly error page --> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Mojolicious.pm new/Mojolicious-6.12/lib/Mojolicious.pm --- old/Mojolicious-6.11/lib/Mojolicious.pm 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.12/lib/Mojolicious.pm 2015-06-18 23:27:54.000000000 +0200 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Clinking Beer Mugs'; -our $VERSION = '6.11'; +our $VERSION = '6.12'; sub AUTOLOAD { my $self = shift; @@ -391,7 +391,8 @@ $app = $app->controller_class('Mojolicious::Controller'); Class to be used for the default controller, defaults to -L<Mojolicious::Controller>. +L<Mojolicious::Controller>. Note that this class needs to have already been +loaded before the first request arrives. =head2 mode @@ -751,6 +752,8 @@ 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> @@ -831,8 +834,6 @@ Curt Tilmes -Dan Book - Daniel Kimsey Danijel Tasov @@ -995,6 +996,8 @@ Stephane Este-Gracias +Steve Atkins + Tatsuhiko Miyagawa Terrence Brannon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/lib/Test/Mojo.pm new/Mojolicious-6.12/lib/Test/Mojo.pm --- old/Mojolicious-6.11/lib/Test/Mojo.pm 2015-05-16 18:24:25.000000000 +0200 +++ new/Mojolicious-6.12/lib/Test/Mojo.pm 2015-06-10 16:14:05.000000000 +0200 @@ -510,6 +510,11 @@ # Allow redirects $t->ua->max_redirects(10); + $t->get_ok('/redirect')->status_is(200)->content_like(qr/redirected/); + + # Switch protocol from HTTP to HTTPS + $t->ua->server->url('https'); + $t->get_ok('/secure')->status_is(200)->content_like(qr/secure/); # Use absolute URL for request with Basic authentication my $url = $t->ua->server->url->userinfo('sri:secr3t')->path('/secrets.json'); @@ -522,6 +527,7 @@ my ($ua, $tx) = @_; $tx->req->headers->accept_language('en-US'); }); + $t->get_ok('/hello')->status_is(200)->content_like(qr/Howdy/); =head1 METHODS @@ -552,10 +558,13 @@ $c->render(text => 'This request did not reach the router.') if $c->req->url->path->contains('/user'); }); + $t->get_ok('/user')->status_is(200)->content_like(qr/not reach the router/); # Extract additional information my $stash; $t->app->hook(after_dispatch => sub { $stash = shift->stash }); + $t->get_ok('/hello')->status_is(200); + is $stash->{foo}, 'bar', 'right value'; =head2 content_is diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojo/collection.t new/Mojolicious-6.12/t/mojo/collection.t --- old/Mojolicious-6.11/t/mojo/collection.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.12/t/mojo/collection.t 2015-06-10 16:14:05.000000000 +0200 @@ -3,6 +3,7 @@ use Test::More; use Mojo::ByteStream 'b'; use Mojo::Collection 'c'; +use Mojo::JSON 'encode_json'; # Array is c(1, 2, 3)->[1], 2, 'right result'; @@ -154,4 +155,7 @@ is_deeply $collection->uniq->reverse->uniq->to_array, [5, 4, 3, 2, 1], 'right result'; +# TO_JSON +is encode_json(c(1, 2, 3)), '[1,2,3]', 'right result'; + done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojo/loader.t new/Mojolicious-6.12/t/mojo/loader.t --- old/Mojolicious-6.11/t/mojo/loader.t 2015-03-17 05:03:05.000000000 +0100 +++ new/Mojolicious-6.12/t/mojo/loader.t 2015-06-18 23:27:54.000000000 +0200 @@ -7,7 +7,14 @@ use FindBin; use lib "$FindBin::Bin/lib"; -use Mojo::Loader qw(data_section file_is_binary find_modules load_class); +use Mojo::Loader + qw(data_section file_is_binary find_packages find_modules load_class); + +package MyLoaderTest::Foo::Bar; + +package MyLoaderTest::Foo::Baz; + +package main; # Single character core module ok !load_class('B'), 'loaded'; @@ -49,7 +56,7 @@ is $e->lines_after->[1][1], '1;', 'right line'; like "$e", qr/Exception/, 'right message'; -# Search +# Search modules my @modules = find_modules 'Mojo::LoaderTest'; is_deeply \@modules, [qw(Mojo::LoaderTest::A Mojo::LoaderTest::B Mojo::LoaderTest::C)], @@ -57,6 +64,14 @@ is_deeply [find_modules "Mojo'LoaderTest"], [qw(Mojo'LoaderTest::A Mojo'LoaderTest::B Mojo'LoaderTest::C)], 'found the right modules'; +is_deeply [find_modules 'MyLoaderTest::DoesNotExist'], [], 'no modules found'; + +# Search packages +my @pkgs = find_packages 'MyLoaderTest::Foo'; +is_deeply \@pkgs, ['MyLoaderTest::Foo::Bar', 'MyLoaderTest::Foo::Baz'], + 'found the right packages'; +is_deeply [find_packages 'MyLoaderTest::DoesNotExist'], [], + 'no packages found'; # Load ok !load_class("Mojo'LoaderTest::A"), 'loaded successfully'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojo/request.t new/Mojolicious-6.12/t/mojo/request.t --- old/Mojolicious-6.11/t/mojo/request.t 2015-05-16 18:42:28.000000000 +0200 +++ new/Mojolicious-6.12/t/mojo/request.t 2015-06-10 16:14:05.000000000 +0200 @@ -741,6 +741,7 @@ is $req->content->progress, 416, 'right progress'; ok $req->is_finished, 'request is finished'; ok $req->content->is_multipart, 'multipart content'; +is $req->body, '', 'no content'; is $req->method, 'GET', 'right method'; is $req->version, '1.1', 'right version'; is $req->url, '/foo/bar/baz.html?foo13#23', 'right URL'; @@ -808,6 +809,7 @@ $req->parse("Bye!\x0d\x0a------------0xKhTmLbOuNdArY--"); ok $req->is_finished, 'request is finished'; ok $req->content->is_multipart, 'multipart content'; +is $req->body, '', 'no content'; is $req->method, 'GET', 'right method'; is $req->version, '1.1', 'right version'; is $req->url, '/foo/bar/baz.html?foo13#23', 'right URL'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojo/template.t new/Mojolicious-6.12/t/mojo/template.t --- old/Mojolicious-6.11/t/mojo/template.t 2015-04-06 23:13:52.000000000 +0200 +++ new/Mojolicious-6.12/t/mojo/template.t 2015-06-18 23:27:54.000000000 +0200 @@ -26,6 +26,11 @@ my $output = $mt->render(''); is $output, '', 'empty string'; +# Named template +$mt = Mojo::Template->new; +$output = $mt->name('foo/bar.mt')->render('<%= __FILE__ %>'); +is $output, "foo/bar.mt\n", 'template name'; + # Consistent scalar context $mt->prepend('my @foo = (3, 4);')->parse('<%= @foo %>:<%== @foo %>'); $output = $mt->build->compile || $mt->interpret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojo/user_agent_online.t new/Mojolicious-6.12/t/mojo/user_agent_online.t --- old/Mojolicious-6.11/t/mojo/user_agent_online.t 2015-02-21 07:08:18.000000000 +0100 +++ new/Mojolicious-6.12/t/mojo/user_agent_online.t 2015-06-18 23:27:54.000000000 +0200 @@ -163,23 +163,23 @@ is $tx->res->code, 302, 'right status'; # Simple keep-alive requests -$tx = $ua->get('http://www.wikipedia.org'); -is $tx->req->method, 'GET', 'right method'; -is $tx->req->url, 'http://www.wikipedia.org', 'right url'; -is $tx->req->body, '', 'no content'; -is $tx->res->code, 200, 'right status'; +$tx = $ua->get('https://www.wikipedia.org'); +is $tx->req->method, 'GET', 'right method'; +is $tx->req->url, 'https://www.wikipedia.org', 'right url'; +is $tx->req->body, '', 'no content'; +is $tx->res->code, 200, 'right status'; ok $tx->keep_alive, 'connection will be kept alive'; ok !$tx->kept_alive, 'connection was not kept alive'; -$tx = $ua->get('http://www.wikipedia.org'); -is $tx->req->method, 'GET', 'right method'; -is $tx->req->url, 'http://www.wikipedia.org', 'right url'; -is $tx->res->code, 200, 'right status'; +$tx = $ua->get('https://www.wikipedia.org'); +is $tx->req->method, 'GET', 'right method'; +is $tx->req->url, 'https://www.wikipedia.org', 'right url'; +is $tx->res->code, 200, 'right status'; ok $tx->keep_alive, 'connection will be kept alive'; ok $tx->kept_alive, 'connection was kept alive'; -$tx = $ua->get('http://www.wikipedia.org'); -is $tx->req->method, 'GET', 'right method'; -is $tx->req->url, 'http://www.wikipedia.org', 'right url'; -is $tx->res->code, 200, 'right status'; +$tx = $ua->get('https://www.wikipedia.org'); +is $tx->req->method, 'GET', 'right method'; +is $tx->req->url, 'https://www.wikipedia.org', 'right url'; +is $tx->res->code, 200, 'right status'; ok $tx->keep_alive, 'connection will be kept alive'; ok $tx->kept_alive, 'connection was kept alive'; @@ -240,14 +240,14 @@ $ua->max_redirects(3); $tx = $ua->get('http://wikipedia.org/wiki/Perl'); $ua->max_redirects(0); -is $tx->req->method, 'GET', 'right method'; -is $tx->req->url, 'http://en.wikipedia.org/wiki/Perl', 'right url'; -is $tx->res->code, 200, 'right status'; +is $tx->req->method, 'GET', 'right method'; +is $tx->req->url, 'https://en.wikipedia.org/wiki/Perl', 'right url'; +is $tx->res->code, 200, 'right status'; is $tx->previous->req->method, 'GET', 'right method'; -is $tx->previous->req->url, 'http://www.wikipedia.org/wiki/Perl', 'right url'; +is $tx->previous->req->url, 'https://www.wikipedia.org/wiki/Perl', 'right url'; is $tx->previous->res->code, 301, 'right status'; is $tx->redirects->[-1]->req->method, 'GET', 'right method'; -is $tx->redirects->[-1]->req->url, 'http://www.wikipedia.org/wiki/Perl', +is $tx->redirects->[-1]->req->url, 'https://www.wikipedia.org/wiki/Perl', 'right url'; is $tx->redirects->[-1]->res->code, 301, 'right status'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-6.11/t/mojolicious/commands.t new/Mojolicious-6.12/t/mojolicious/commands.t --- old/Mojolicious-6.11/t/mojolicious/commands.t 2015-02-23 19:08:15.000000000 +0100 +++ new/Mojolicious-6.12/t/mojolicious/commands.t 2015-06-18 23:27:54.000000000 +0200 @@ -13,6 +13,13 @@ use Cwd 'cwd'; use File::Temp 'tempdir'; +package Mojolicious::Command::my_fake_test_command; + +package Mojolicious::Command::my_test_command; +use Mojo::Base 'Mojolicious::Command'; + +package main; + # Make sure @ARGV is not changed { local $ENV{MOJO_MODE}; @@ -97,8 +104,10 @@ local $ENV{HARNESS_ACTIVE} = 0; $commands->run; } -like $buffer, qr/Usage: APPLICATION COMMAND \[OPTIONS\].*daemon.*version/s, +like $buffer, + qr/Usage: APPLICATION COMMAND \[OPTIONS\].*daemon.*my_test_command.*version/s, 'right output'; +unlike $buffer, qr/my_fake_test_command/, 'fake command has been ignored'; # help $buffer = '';