Hello community,

here is the log from the commit of package perl-Mojolicious for 
openSUSE:Factory checked in at 2020-02-13 10:11:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Mojolicious"

Thu Feb 13 10:11:56 2020 rev:123 rq:773677 version:8.33

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes        
2020-01-21 21:03:47.868944955 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.26092/perl-Mojolicious.changes 
    2020-02-13 10:11:57.432355341 +0100
@@ -1,0 +2,11 @@
+Wed Feb 12 03:11:47 UTC 2020 -  <timueller+p...@suse.de>
+
+- updated to 8.33
+   see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+  8.33  2020-02-11
+    - Added EXPERIMENTAL humanize_bytes function to Mojo::Util. (kraih, coolo)
+    - Added EXPERIMENTAL humanize_bytes method to Mojo::ByteStream.
+    - Updated Future::AsyncAwait requirement to 0.36 for better tests. (ilmari)
+
+-------------------------------------------------------------------

Old:
----
  Mojolicious-8.32.tar.gz

New:
----
  Mojolicious-8.33.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.UlceqM/_old  2020-02-13 10:11:58.168355768 +0100
+++ /var/tmp/diff_new_pack.UlceqM/_new  2020-02-13 10:11:58.168355768 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Mojolicious
-Version:        8.32
+Version:        8.33
 Release:        0
 %define cpan_name Mojolicious
 Summary:        Real-time web framework

++++++ Mojolicious-8.32.tar.gz -> Mojolicious-8.33.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/Changes new/Mojolicious-8.33/Changes
--- old/Mojolicious-8.32/Changes        2020-01-18 17:18:35.000000000 +0100
+++ new/Mojolicious-8.33/Changes        2020-02-11 13:00:49.000000000 +0100
@@ -1,4 +1,9 @@
 
+8.33  2020-02-11
+  - Added EXPERIMENTAL humanize_bytes function to Mojo::Util. (kraih, coolo)
+  - Added EXPERIMENTAL humanize_bytes method to Mojo::ByteStream.
+  - Updated Future::AsyncAwait requirement to 0.36 for better tests. (ilmari)
+
 8.32  2020-01-18
   - Changed experimental -async flag to -async_await in Mojo::Base, because of 
a
     Perl quirk that Future::AsyncAwait can't handle itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/META.json 
new/Mojolicious-8.33/META.json
--- old/Mojolicious-8.32/META.json      2020-01-19 15:34:03.000000000 +0100
+++ new/Mojolicious-8.33/META.json      2020-02-11 21:24:26.000000000 +0100
@@ -62,6 +62,6 @@
       },
       "x_IRC" : "irc://irc.freenode.net/#mojo"
    },
-   "version" : "8.32",
+   "version" : "8.33",
    "x_serialization_backend" : "JSON::PP version 4.04"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/META.yml 
new/Mojolicious-8.33/META.yml
--- old/Mojolicious-8.32/META.yml       2020-01-19 15:34:03.000000000 +0100
+++ new/Mojolicious-8.33/META.yml       2020-02-11 21:24:26.000000000 +0100
@@ -34,5 +34,5 @@
   homepage: https://mojolicious.org
   license: http://www.opensource.org/licenses/artistic-license-2.0
   repository: https://github.com/mojolicious/mojo.git
-version: '8.32'
+version: '8.33'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojo/Base.pm 
new/Mojolicious-8.33/lib/Mojo/Base.pm
--- old/Mojolicious-8.32/lib/Mojo/Base.pm       2020-01-18 17:16:12.000000000 
+0100
+++ new/Mojolicious-8.33/lib/Mojo/Base.pm       2020-01-21 20:30:18.000000000 
+0100
@@ -20,10 +20,10 @@
 use constant ROLES =>
   !!(eval { require Role::Tiny; Role::Tiny->VERSION('2.000001'); 1 });
 
-# async/await support requires Future::AsyncAwait 0.35+
+# async/await support requires Future::AsyncAwait 0.36+
 use constant ASYNC => $ENV{MOJO_NO_ASYNC} ? 0 : !!(eval {
   require Future::AsyncAwait;
-  Future::AsyncAwait->VERSION('0.35');
+  Future::AsyncAwait->VERSION('0.36');
   1;
 });
 
@@ -129,7 +129,7 @@
 
     # async/await
     elsif ($flag eq '-async_await') {
-      Carp::croak 'Future::AsyncAwait 0.35+ is required for async/await'
+      Carp::croak 'Future::AsyncAwait 0.36+ is required for async/await'
         unless ASYNC;
       require Mojo::Promise;
       Future::AsyncAwait->import_into($caller, future_class => 
'Mojo::Promise');
@@ -272,7 +272,7 @@
   use Mojo::Base 'SomeBaseClass', -signatures;
   use Mojo::Base -role, -signatures;
 
-If you have L<Future::AsyncAwait> 0.35+ installed you can also use the
+If you have L<Future::AsyncAwait> 0.36+ installed you can also use the
 C<-async_await> flag to activate the C<async> and C<await> keywords to deal 
much
 more efficiently with promises. Note that this feature is B<EXPERIMENTAL> and
 might change without warning!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojo/ByteStream.pm 
new/Mojolicious-8.33/lib/Mojo/ByteStream.pm
--- old/Mojolicious-8.32/lib/Mojo/ByteStream.pm 2020-01-14 20:58:28.000000000 
+0100
+++ new/Mojolicious-8.33/lib/Mojo/ByteStream.pm 2020-02-11 12:57:11.000000000 
+0100
@@ -11,9 +11,9 @@
 # Turn most functions from Mojo::Util into methods
 my @UTILS = (
   qw(b64_decode b64_encode camelize decamelize gunzip gzip hmac_sha1_sum),
-  qw(html_unescape md5_bytes md5_sum punycode_decode punycode_encode quote),
-  qw(sha1_bytes sha1_sum slugify term_escape trim unindent unquote url_escape),
-  qw(url_unescape xml_escape xor_encode)
+  qw(html_unescape humanize_bytes md5_bytes md5_sum punycode_decode),
+  qw(punycode_encode quote sha1_bytes sha1_sum slugify term_escape trim),
+  qw(unindent unquote url_escape url_unescape xml_escape xor_encode)
 );
 for my $name (@UTILS) {
   my $sub = Mojo::Util->can($name);
@@ -197,6 +197,14 @@
   # "%3Chtml%3E"
   b('&lt;html&gt;')->html_unescape->url_escape;
 
+=head2 humanize_bytes
+
+  $stream = $stream->humanize_bytes;
+
+Turn number of bytes into a simplified human readable format for bytestream 
with
+L<Mojo::Util/"humanize_bytes">. Note that this method is B<EXPERIMENTAL> and
+might change without warning!
+
 =head2 md5_bytes
 
   $stream = $stream->md5_bytes;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojo/Util.pm 
new/Mojolicious-8.33/lib/Mojo/Util.pm
--- old/Mojolicious-8.32/lib/Mojo/Util.pm       2020-01-14 20:58:28.000000000 
+0100
+++ new/Mojolicious-8.33/lib/Mojo/Util.pm       2020-02-11 19:51:52.000000000 
+0100
@@ -74,8 +74,8 @@
 our @EXPORT_OK = (
   qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize),
   qw(decode deprecated dumper encode extract_usage getopt gunzip gzip),
-  qw(hmac_sha1_sum html_attr_unescape html_unescape md5_bytes md5_sum),
-  qw(monkey_patch punycode_decode punycode_encode quote scope_guard),
+  qw(hmac_sha1_sum html_attr_unescape html_unescape humanize_bytes md5_bytes),
+  qw(md5_sum monkey_patch punycode_decode punycode_encode quote scope_guard),
   qw(secure_compare sha1_bytes sha1_sum slugify split_cookie_header),
   qw(split_header steady_time tablify term_escape trim unindent unquote),
   qw(url_escape url_unescape xml_escape xor_encode)
@@ -182,6 +182,18 @@
 sub html_attr_unescape { _html(shift, 1) }
 sub html_unescape      { _html(shift, 0) }
 
+sub humanize_bytes {
+  my $size = shift;
+
+  my $prefix = $size < 0 ? '-' : '';
+
+  return "$prefix${size}B" if ($size = abs $size) < 1024;
+  return $prefix . _round($size) . 'KiB' if ($size /= 1024) < 1024;
+  return $prefix . _round($size) . 'MiB' if ($size /= 1024) < 1024;
+  return $prefix . _round($size) . 'GiB' if ($size /= 1024) < 1024;
+  return $prefix . _round($size /= 1024) . 'TiB';
+}
+
 sub monkey_patch {
   my ($class, %patch) = @_;
   no strict 'refs';
@@ -481,6 +493,8 @@
 # This may break in the future, but is worth it for performance
 sub _readable { !!(IO::Poll::_poll(@_[0, 1], my $m = POLLIN | POLLPRI) > 0) }
 
+sub _round { $_[0] < 10 ? int($_[0] * 10 + 0.5) / 10 : int($_[0] + 0.5) }
+
 sub _stash {
   my ($name, $object) = (shift, shift);
 
@@ -720,6 +734,25 @@
   # "<div>"
   html_unescape '&lt;div&gt;';
 
+=head2 humanize_bytes
+
+  my $str = humanize_bytes 1234;
+
+Turn number of bytes into a simplified human readable format. Note that this
+function is B<EXPERIMENTAL> and might change without warning!
+
+  # "1B"
+  humanize_bytes 1;
+
+  # "7.5GiB"
+  humanize_bytes 8007188480;
+
+  # "13GiB"
+  humanize_bytes 13443399680;
+
+  # "-685MiB"
+  humanize_bytes -717946880;
+
 =head2 md5_bytes
 
   my $checksum = md5_bytes $bytes;
@@ -779,7 +812,7 @@
 
 Create anonymous scope guard object that will execute the passed callback when
 the object is destroyed. Note that this function is B<EXPERIMENTAL> and might
-change without warning
+change without warning!
 
   # Execute closure at end of scope
   {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojolicious/Command/version.pm 
new/Mojolicious-8.33/lib/Mojolicious/Command/version.pm
--- old/Mojolicious-8.32/lib/Mojolicious/Command/version.pm     2020-01-14 
20:58:43.000000000 +0100
+++ new/Mojolicious-8.33/lib/Mojolicious/Command/version.pm     2020-01-21 
20:30:24.000000000 +0100
@@ -33,7 +33,7 @@
   IO::Socket::SSL 2.009+   ($tls)
   Net::DNS::Native 0.15+   ($nnr)
   Role::Tiny 2.000001+     ($roles)
-  Future::AsyncAwait 0.35+ ($async)
+  Future::AsyncAwait 0.36+ ($async)
 
 EOF
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojolicious/Controller.pm 
new/Mojolicious-8.33/lib/Mojolicious/Controller.pm
--- old/Mojolicious-8.32/lib/Mojolicious/Controller.pm  2020-01-14 
20:58:40.000000000 +0100
+++ new/Mojolicious-8.33/lib/Mojolicious/Controller.pm  2020-02-11 
19:50:05.000000000 +0100
@@ -40,7 +40,7 @@
 
     # Cookie too big
     my $cookie = {name => $name, value => shift, %{shift || {}}};
-    $self->helpers->log->error(qq{Cookie "$name" is bigger than 4096 bytes})
+    $self->helpers->log->error(qq{Cookie "$name" is bigger than 4KiB})
       if length $cookie->{value} > 4096;
 
     $self->res->cookies($cookie);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/lib/Mojolicious.pm 
new/Mojolicious-8.33/lib/Mojolicious.pm
--- old/Mojolicious-8.32/lib/Mojolicious.pm     2020-01-14 21:18:29.000000000 
+0100
+++ new/Mojolicious-8.33/lib/Mojolicious.pm     2020-02-08 20:00:06.000000000 
+0100
@@ -59,7 +59,7 @@
 has validator => sub { Mojolicious::Validator->new };
 
 our $CODENAME = 'Supervillain';
-our $VERSION  = '8.32';
+our $VERSION  = '8.33';
 
 sub BUILD_DYNAMIC {
   my ($class, $method, $dyn_methods) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/t/mojo/bytestream.t 
new/Mojolicious-8.33/t/mojo/bytestream.t
--- old/Mojolicious-8.32/t/mojo/bytestream.t    2020-01-14 20:57:53.000000000 
+0100
+++ new/Mojolicious-8.33/t/mojo/bytestream.t    2020-02-11 13:09:41.000000000 
+0100
@@ -151,4 +151,8 @@
 ok $compressed->size < $uncompressed->size, 'bytestream is shorter';
 is $compressed->gunzip->to_string, $uncompressed->to_string, 'same bytestream';
 
+# humanize_bytes
+is b(8007188480)->humanize_bytes,  '7.5GiB',  'humanized';
+is b(-8007188480)->humanize_bytes, '-7.5GiB', 'humanized';
+
 done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/t/mojo/promise_async_await.t 
new/Mojolicious-8.33/t/mojo/promise_async_await.t
--- old/Mojolicious-8.32/t/mojo/promise_async_await.t   2020-01-16 
21:33:01.000000000 +0100
+++ new/Mojolicious-8.33/t/mojo/promise_async_await.t   2020-01-21 
20:29:57.000000000 +0100
@@ -7,16 +7,24 @@
 BEGIN {
   plan skip_all => 'set TEST_ASYNC_AWAIT to enable this test (developer only!)'
     unless $ENV{TEST_ASYNC_AWAIT} || $ENV{TEST_ALL};
-  plan skip_all => 'Future::AsyncAwait 0.35+ required for this test!'
+  plan skip_all => 'Future::AsyncAwait 0.36+ required for this test!'
     unless Mojo::Base->ASYNC;
 }
 use Mojo::Base -async_await;
 
+use Test::Future::AsyncAwait::Awaitable 'test_awaitable';
 use Test::Mojo;
 use Mojo::Promise;
 use Mojo::UserAgent;
 use Mojolicious::Lite;
 
+# async/await spec
+test_awaitable(
+  'Mojo::Promise conforms to Awaitable API',
+  class => "Mojo::Promise",
+  force => sub { shift->wait },
+);
+
 # Silence
 app->log->level('fatal');
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/t/mojo/util.t 
new/Mojolicious-8.33/t/mojo/util.t
--- old/Mojolicious-8.32/t/mojo/util.t  2020-01-14 20:58:00.000000000 +0100
+++ new/Mojolicious-8.33/t/mojo/util.t  2020-02-11 19:51:00.000000000 +0100
@@ -11,11 +11,11 @@
 use Mojo::Util
   qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize),
   qw(decode dumper encode extract_usage getopt gunzip gzip hmac_sha1_sum),
-  qw(html_unescape html_attr_unescape md5_bytes md5_sum monkey_patch),
-  qw(punycode_decode punycode_encode quote scope_guard secure_compare),
-  qw(sha1_bytes sha1_sum slugify split_cookie_header split_header steady_time),
-  qw(tablify term_escape trim unindent unquote url_escape url_unescape),
-  qw(xml_escape xor_encode);
+  qw(html_unescape html_attr_unescape humanize_bytes md5_bytes md5_sum),
+  qw(monkey_patch punycode_decode punycode_encode quote scope_guard),
+  qw(secure_compare sha1_bytes sha1_sum slugify split_cookie_header),
+  qw(split_header steady_time tablify term_escape trim unindent unquote),
+  qw(url_escape url_unescape xml_escape xor_encode);
 
 # camelize
 is camelize('foo_bar_baz'), 'FooBarBaz', 'right camelized result';
@@ -563,6 +563,25 @@
 $test .= 'd';
 is $test, 'abcd', 'right order';
 
+# humanize_bytes
+is humanize_bytes(0),     '0B',     'zero Bytes';
+is humanize_bytes(1),     '1B',     'one Byte';
+is humanize_bytes(-1023), '-1023B', 'negative Bytes';
+is humanize_bytes(1024),  '1KiB',   'one KiB';
+is humanize_bytes(1025),  '1KiB',   'one KiB';
+is humanize_bytes(1024 * 1024), '1MiB', 'one MiB';
+is humanize_bytes(1024 * 1024 * 1024), '1GiB', 'one GiB';
+is humanize_bytes(1024 * 1024 * 1024 * 1024), '1TiB', 'one TiB';
+is humanize_bytes(3000),           '2.9KiB',  'almost 3KiB';
+is humanize_bytes(-3000),          '-2.9KiB', 'almost -3KiB';
+is humanize_bytes(13443399680),    '13GiB',   'two digits GiB';
+is humanize_bytes(8007188480),     '7.5GiB',  'smaller GiB';
+is humanize_bytes(-8007188480),    '-7.5GiB', 'negative smaller GiB';
+is humanize_bytes(-1099511627776), '-1TiB',   'negative smaller TiB';
+is humanize_bytes(717946880),      '685MiB',  'large MiB';
+is humanize_bytes(-717946880),     '-685MiB', 'large negative MiB';
+is humanize_bytes(245760),         '240KiB',  'less than a MiB';
+
 # Hide DATA usage from error messages
 eval { die 'whatever' };
 unlike $@, qr/DATA/, 'DATA has been hidden';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Mojolicious-8.32/t/mojolicious/renderer.t 
new/Mojolicious-8.33/t/mojolicious/renderer.t
--- old/Mojolicious-8.32/t/mojolicious/renderer.t       2020-01-14 
20:58:07.000000000 +0100
+++ new/Mojolicious-8.33/t/mojolicious/renderer.t       2020-02-11 
19:49:49.000000000 +0100
@@ -60,7 +60,7 @@
 $log = '';
 $cb  = $c->app->log->on(message => sub { $log .= pop });
 $c->cookie(foo => 'x' x 4097);
-like $log, qr/Cookie "foo" is bigger than 4096 bytes/, 'right message';
+like $log, qr/Cookie "foo" is bigger than 4KiB/, 'right message';
 $c->app->log->unsubscribe(message => $cb);
 
 # Nested helpers


Reply via email to