Hello community, here is the log from the commit of package perl-Mojolicious for openSUSE:Factory checked in at 2016-11-11 14:31:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-10-31 09:53:32.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Mojolicious.new/perl-Mojolicious.changes 2016-11-11 14:31:46.000000000 +0100 @@ -1,0 +2,9 @@ +Wed Nov 2 06:47:37 UTC 2016 - [email protected] + +- updated to 7.10 + see /usr/share/doc/packages/perl-Mojolicious/Changes + + 7.10 2016-11-01 + - Added getopt function to Mojo::Util. + +------------------------------------------------------------------- Old: ---- Mojolicious-7.09.tar.gz New: ---- Mojolicious-7.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Mojolicious.spec ++++++ --- /var/tmp/diff_new_pack.zZZTHb/_old 2016-11-11 14:31:47.000000000 +0100 +++ /var/tmp/diff_new_pack.zZZTHb/_new 2016-11-11 14:31:47.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Mojolicious -Version: 7.09 +Version: 7.10 Release: 0 %define cpan_name Mojolicious Summary: Real-time web framework ++++++ Mojolicious-7.09.tar.gz -> Mojolicious-7.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/Changes new/Mojolicious-7.10/Changes --- old/Mojolicious-7.09/Changes 2016-10-22 18:59:15.000000000 +0200 +++ new/Mojolicious-7.10/Changes 2016-11-01 13:07:05.000000000 +0100 @@ -1,4 +1,7 @@ +7.10 2016-11-01 + - Added getopt function to Mojo::Util. + 7.09 2016-10-22 - Added every_header method to Mojo::Headers. - Fixed redirect bug in Mojo::UserAgent::Transactor. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/META.json new/Mojolicious-7.10/META.json --- old/Mojolicious-7.09/META.json 2016-10-23 11:45:53.000000000 +0200 +++ new/Mojolicious-7.10/META.json 2016-11-01 20:01:02.000000000 +0100 @@ -58,6 +58,6 @@ }, "x_IRC" : "irc://irc.perl.org/#mojo" }, - "version" : "7.09", + "version" : "7.10", "x_serialization_backend" : "JSON::PP version 2.27400" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/META.yml new/Mojolicious-7.10/META.yml --- old/Mojolicious-7.09/META.yml 2016-10-23 11:45:52.000000000 +0200 +++ new/Mojolicious-7.10/META.yml 2016-11-01 20:01:01.000000000 +0100 @@ -31,5 +31,5 @@ homepage: http://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/kraih/mojo.git -version: '7.09' +version: '7.10' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojo/Util.pm new/Mojolicious-7.10/lib/Mojo/Util.pm --- old/Mojolicious-7.09/lib/Mojo/Util.pm 2016-09-09 02:05:40.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojo/Util.pm 2016-11-01 18:19:36.000000000 +0100 @@ -8,6 +8,7 @@ use Encode 'find_encoding'; use Exporter 'import'; use File::Find 'find'; +use Getopt::Long 'GetOptionsFromArray'; use IO::Poll qw(POLLIN POLLPRI); use List::Util 'min'; use MIME::Base64 qw(decode_base64 encode_base64); @@ -55,7 +56,7 @@ our @EXPORT_OK = ( qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize), - qw(decode deprecated dumper encode files hmac_sha1_sum html_unescape), + qw(decode deprecated dumper encode files getopt hmac_sha1_sum html_unescape), qw(md5_bytes md5_sum monkey_patch punycode_decode punycode_encode quote), qw(secure_compare sha1_bytes sha1_sum slurp split_cookie_header), qw(split_header spurt steady_time tablify term_escape trim unindent unquote), @@ -138,6 +139,14 @@ return sort keys %files; } +sub getopt { + my $opts = ref $_[1] eq 'ARRAY' ? splice @_, 1, 1 : []; + my $save = Getopt::Long::Configure(qw(default no_auto_abbrev no_ignore_case), + @$opts); + GetOptionsFromArray @_; + Getopt::Long::Configure($save); +} + sub html_unescape { my $str = shift; $str @@ -592,6 +601,25 @@ =back +=head2 getopt + + getopt $array, + 'H|headers=s' => \my @headers, + 't|timeout=i' => \my $timeout, + 'v|verbose' => \my $verbose; + getopt $array, ['pass_through'], + 'H|headers=s' => \my @headers, + 't|timeout=i' => \my $timeout, + 'v|verbose' => \my $verbose; + +Extract options from an array reference with L<Getopt::Long>, but without +changing its global configuration. The configuration options C<no_auto_abbrev> +and C<no_ignore_case> are enabled by default. + + # Extract "charset" option + getopt ['--charset', 'UTF-8'], 'charset=s' => \my $charset; + say $charset; + =head2 hmac_sha1_sum my $checksum = hmac_sha1_sum $bytes, 'passw0rd'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/cgi.pm new/Mojolicious-7.10/lib/Mojolicious/Command/cgi.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/cgi.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/cgi.pm 2016-11-01 12:42:30.000000000 +0100 @@ -1,15 +1,15 @@ package Mojolicious::Command::cgi; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); use Mojo::Server::CGI; +use Mojo::Util 'getopt'; has description => 'Start application with CGI'; has usage => sub { shift->extract_usage }; sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, nph => \(my $nph = 0); + getopt \@args, nph => \(my $nph = 0); Mojo::Server::CGI->new(app => $self->app, nph => $nph)->run; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/cpanify.pm new/Mojolicious-7.10/lib/Mojolicious/Command/cpanify.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/cpanify.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/cpanify.pm 2016-11-01 12:43:11.000000000 +0100 @@ -2,7 +2,7 @@ use Mojo::Base 'Mojolicious::Command'; use File::Basename 'basename'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); +use Mojo::Util 'getopt'; has description => 'Upload distribution to CPAN'; has usage => sub { shift->extract_usage }; @@ -10,7 +10,7 @@ sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, + getopt \@args, 'p|password=s' => \(my $password = ''), 'u|user=s' => \(my $user = ''); die $self->usage unless my $file = shift @args; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/daemon.pm new/Mojolicious-7.10/lib/Mojolicious/Command/daemon.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/daemon.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/daemon.pm 2016-11-01 12:43:40.000000000 +0100 @@ -1,8 +1,8 @@ package Mojolicious::Command::daemon; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); use Mojo::Server::Daemon; +use Mojo::Util 'getopt'; has description => 'Start application with HTTP and WebSocket server'; has usage => sub { shift->extract_usage }; @@ -11,7 +11,7 @@ my ($self, @args) = @_; my $daemon = Mojo::Server::Daemon->new(app => $self->app); - GetOptionsFromArray \@args, + getopt \@args, 'b|backlog=i' => sub { $daemon->backlog($_[1]) }, 'c|clients=i' => sub { $daemon->max_clients($_[1]) }, 'i|inactivity-timeout=i' => sub { $daemon->inactivity_timeout($_[1]) }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/eval.pm new/Mojolicious-7.10/lib/Mojolicious/Command/eval.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/eval.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/eval.pm 2016-11-01 12:44:46.000000000 +0100 @@ -1,7 +1,7 @@ package Mojolicious::Command::eval; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); +use Mojo::Util 'getopt'; has description => 'Run code against application'; has usage => sub { shift->extract_usage }; @@ -9,7 +9,7 @@ sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, 'v|verbose' => \my $v1, 'V' => \my $v2; + getopt \@args, 'v|verbose' => \my $v1, 'V' => \my $v2; my $code = shift @args || ''; # Run code against application diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/get.pm new/Mojolicious-7.10/lib/Mojolicious/Command/get.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/get.pm 2016-09-23 14:46:53.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/get.pm 2016-11-01 16:47:38.000000000 +0100 @@ -1,13 +1,12 @@ package Mojolicious::Command::get; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); use Mojo::DOM; use Mojo::IOLoop; use Mojo::JSON qw(encode_json j); use Mojo::JSON::Pointer; use Mojo::UserAgent; -use Mojo::Util qw(decode encode); +use Mojo::Util qw(decode encode getopt); use Scalar::Util 'weaken'; has description => 'Perform HTTP request'; @@ -16,7 +15,7 @@ sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, + getopt \@args, 'C|charset=s' => \my $charset, 'c|content=s' => \(my $content = ''), 'H|header=s' => \my @headers, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/prefork.pm new/Mojolicious-7.10/lib/Mojolicious/Command/prefork.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/prefork.pm 2016-08-01 02:03:01.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/prefork.pm 2016-11-01 12:45:35.000000000 +0100 @@ -1,8 +1,8 @@ package Mojolicious::Command::prefork; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); use Mojo::Server::Prefork; +use Mojo::Util 'getopt'; has description => 'Start application with pre-forking HTTP and WebSocket server'; @@ -12,7 +12,7 @@ my ($self, @args) = @_; my $prefork = Mojo::Server::Prefork->new(app => $self->app); - GetOptionsFromArray \@args, + getopt \@args, 'a|accepts=i' => sub { $prefork->accepts($_[1]) }, 'b|backlog=i' => sub { $prefork->backlog($_[1]) }, 'c|clients=i' => sub { $prefork->max_clients($_[1]) }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/routes.pm new/Mojolicious-7.10/lib/Mojolicious/Command/routes.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/routes.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/routes.pm 2016-11-01 12:45:53.000000000 +0100 @@ -2,8 +2,7 @@ use Mojo::Base 'Mojolicious::Command'; use re 'regexp_pattern'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); -use Mojo::Util qw(encode tablify); +use Mojo::Util qw(encode getopt tablify); has description => 'Show available routes'; has usage => sub { shift->extract_usage }; @@ -11,7 +10,7 @@ sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, 'v|verbose' => \my $verbose; + getopt \@args, 'v|verbose' => \my $verbose; my $rows = []; _walk($_, 0, $rows, $verbose) for @{$self->app->routes->children}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Command/test.pm new/Mojolicious-7.10/lib/Mojolicious/Command/test.pm --- old/Mojolicious-7.09/lib/Mojolicious/Command/test.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Command/test.pm 2016-11-01 12:46:37.000000000 +0100 @@ -1,7 +1,7 @@ package Mojolicious::Command::test; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case); +use Mojo::Util 'getopt'; has description => 'Run tests'; has usage => sub { shift->extract_usage }; @@ -9,7 +9,7 @@ sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, 'v|verbose' => \$ENV{HARNESS_VERBOSE}; + getopt \@args, 'v|verbose' => \$ENV{HARNESS_VERBOSE}; if (!@args && (my $home = $self->app->home)) { die "Can't find test directory.\n" unless -d $home->rel_dir('t'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious/Commands.pm new/Mojolicious-7.10/lib/Mojolicious/Commands.pm --- old/Mojolicious-7.09/lib/Mojolicious/Commands.pm 2016-08-01 02:03:26.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious/Commands.pm 2016-11-01 12:52:40.000000000 +0100 @@ -1,10 +1,9 @@ package Mojolicious::Commands; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long 'GetOptionsFromArray'; use Mojo::Loader qw(find_modules find_packages load_class); use Mojo::Server; -use Mojo::Util 'tablify'; +use Mojo::Util qw(getopt tablify); has hint => <<EOF; @@ -73,15 +72,11 @@ # Command line options for MOJO_HELP, MOJO_HOME and MOJO_MODE sub _args { - return if __PACKAGE__->detect; - - my $save - = Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case pass_through)); - GetOptionsFromArray shift, + getopt shift, ['pass_through'], 'h|help' => \$ENV{MOJO_HELP}, 'home=s' => \$ENV{MOJO_HOME}, - 'm|mode=s' => \$ENV{MOJO_MODE}; - Getopt::Long::Configure($save); + 'm|mode=s' => \$ENV{MOJO_MODE} + unless __PACKAGE__->detect; } # Do not remove options from @ARGV diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/lib/Mojolicious.pm new/Mojolicious-7.10/lib/Mojolicious.pm --- old/Mojolicious-7.09/lib/Mojolicious.pm 2016-10-11 22:06:39.000000000 +0200 +++ new/Mojolicious-7.10/lib/Mojolicious.pm 2016-10-23 11:46:45.000000000 +0200 @@ -43,7 +43,7 @@ has validator => sub { Mojolicious::Validator->new }; our $CODENAME = 'Doughnut'; -our $VERSION = '7.09'; +our $VERSION = '7.10'; sub AUTOLOAD { my $self = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/script/hypnotoad new/Mojolicious-7.10/script/hypnotoad --- old/Mojolicious-7.09/script/hypnotoad 2016-09-08 20:12:07.000000000 +0200 +++ new/Mojolicious-7.10/script/hypnotoad 2016-11-01 19:31:15.000000000 +0100 @@ -3,21 +3,18 @@ use strict; use warnings; -use Getopt::Long qw(GetOptions :config no_auto_abbrev no_ignore_case); +use Mojo::Server::Hypnotoad; +use Mojo::Util 'getopt'; +use Mojolicious::Command; -GetOptions +getopt \@ARGV, 'f|foreground' => \$ENV{HYPNOTOAD_FOREGROUND}, 'h|help' => \my $help, 's|stop' => \$ENV{HYPNOTOAD_STOP}, 't|test' => \$ENV{HYPNOTOAD_TEST}; my $app = shift || $ENV{HYPNOTOAD_APP}; -if ($help || !$app) { - require Mojolicious::Command; - die Mojolicious::Command->new->extract_usage; -} - -require Mojo::Server::Hypnotoad; +die Mojolicious::Command->new->extract_usage if $help || !$app; Mojo::Server::Hypnotoad->new->run($app); =encoding utf8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/script/morbo new/Mojolicious-7.10/script/morbo --- old/Mojolicious-7.09/script/morbo 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/script/morbo 2016-11-01 19:30:39.000000000 +0100 @@ -3,22 +3,18 @@ use strict; use warnings; -use Getopt::Long qw(GetOptions :config no_auto_abbrev no_ignore_case); +use Mojo::Server::Morbo; +use Mojo::Util 'getopt'; +use Mojolicious::Command; -GetOptions +getopt \@ARGV, 'h|help' => \my $help, 'l|listen=s' => \my @listen, 'm|mode=s' => \$ENV{MOJO_MODE}, 'v|verbose' => \$ENV{MORBO_VERBOSE}, 'w|watch=s' => \my @watch; -my $app = shift; -if ($help || !$app) { - require Mojolicious::Command; - die Mojolicious::Command->new->extract_usage; -} - -require Mojo::Server::Morbo; +die Mojolicious::Command->new->extract_usage if $help || !(my $app = shift); my $morbo = Mojo::Server::Morbo->new; $morbo->daemon->listen(\@listen) if @listen; $morbo->watch(\@watch) if @watch; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/t/mojo/util.t new/Mojolicious-7.10/t/mojo/util.t --- old/Mojolicious-7.09/t/mojo/util.t 2016-08-16 16:52:55.000000000 +0200 +++ new/Mojolicious-7.10/t/mojo/util.t 2016-11-01 18:18:05.000000000 +0100 @@ -12,8 +12,8 @@ use Mojo::Util qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize), - qw(decode dumper encode files hmac_sha1_sum html_unescape md5_bytes md5_sum), - qw(monkey_patch punycode_decode punycode_encode quote secure_compare), + qw(decode dumper encode files getopt hmac_sha1_sum html_unescape md5_bytes), + qw(md5_sum monkey_patch punycode_decode punycode_encode quote secure_compare), qw(secure_compare sha1_bytes sha1_sum slurp split_cookie_header), qw(split_header spurt steady_time tablify term_escape trim unindent unquote), qw(url_escape url_unescape xml_escape xor_encode); @@ -115,6 +115,18 @@ ]; is_deeply split_cookie_header($header), $tree, 'right result'; +# getopt +getopt ['--charset', 'UTF-8'], 'c|charset=s' => \my $charset; +is $charset, 'UTF-8', 'right string'; +my $array = ['-t', 'test', '-h', '--whatever', 'Whatever!', 'stuff']; +getopt $array, ['pass_through'], 't|test=s' => \my $test; +is $test, 'test', 'right string'; +is_deeply $array, ['-h', '--whatever', 'Whatever!', 'stuff'], 'right structure'; +getopt $array, 'h' => \my $flag, 'w|whatever=s' => \my $whatever; +ok $flag, 'flag has been set'; +is $whatever, 'Whatever!', 'right string'; +is_deeply $array, ['stuff'], 'right structure'; + # unindent is unindent(" test\n 123\n 456\n"), "test\n 123\n456\n", 'right unindented result'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Mojolicious-7.09/t/mojolicious/lib/MojoliciousTest/Command/test_command.pm new/Mojolicious-7.10/t/mojolicious/lib/MojoliciousTest/Command/test_command.pm --- old/Mojolicious-7.09/t/mojolicious/lib/MojoliciousTest/Command/test_command.pm 2016-07-19 02:38:18.000000000 +0200 +++ new/Mojolicious-7.10/t/mojolicious/lib/MojoliciousTest/Command/test_command.pm 2016-11-01 19:35:21.000000000 +0100 @@ -1,11 +1,11 @@ package MojoliciousTest::Command::test_command; use Mojo::Base 'Mojolicious::Command'; -use Getopt::Long 'GetOptionsFromArray'; +use Mojo::Util 'getopt'; sub run { my ($self, @args) = @_; - GetOptionsFromArray \@args, 'too' => \my $too; + getopt \@args, ['default'], 'too' => \my $too; return $too ? 'works too!' : 'works!'; }
