Hello community,
here is the log from the commit of package perl-Cpanel-JSON-XS for
openSUSE:Factory checked in at 2018-12-12 17:26:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Cpanel-JSON-XS (Old)
and /work/SRC/openSUSE:Factory/.perl-Cpanel-JSON-XS.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Cpanel-JSON-XS"
Wed Dec 12 17:26:47 2018 rev:15 rq:655741 version:4.08
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Cpanel-JSON-XS/perl-Cpanel-JSON-XS.changes
2018-11-12 09:40:28.721270303 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Cpanel-JSON-XS.new.28833/perl-Cpanel-JSON-XS.changes
2018-12-12 17:26:49.551003182 +0100
@@ -1,0 +2,9 @@
+Thu Dec 6 15:28:47 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to 4.08
+ see /usr/share/doc/packages/perl-Cpanel-JSON-XS/Changes
+
+ 4.08 2018-11-28 (rurban)
+ - Add unblessed_bool property (PR #118 by Pali)
+
+-------------------------------------------------------------------
Old:
----
Cpanel-JSON-XS-4.07.tar.gz
New:
----
Cpanel-JSON-XS-4.08.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Cpanel-JSON-XS.spec ++++++
--- /var/tmp/diff_new_pack.ZHvhj4/_old 2018-12-12 17:26:50.259002282 +0100
+++ /var/tmp/diff_new_pack.ZHvhj4/_new 2018-12-12 17:26:50.263002277 +0100
@@ -17,7 +17,7 @@
Name: perl-Cpanel-JSON-XS
-Version: 4.07
+Version: 4.08
Release: 0
%define cpan_name Cpanel-JSON-XS
Summary: Cpanel Fork of Json::Xs, Fast and Correct Serializing
@@ -53,10 +53,10 @@
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
-%{__make} %{?_smp_mflags}
+make %{?_smp_mflags}
%check
-%{__make} test
+make test
%install
%perl_make_install
++++++ Cpanel-JSON-XS-4.07.tar.gz -> Cpanel-JSON-XS-4.08.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/Changes
new/Cpanel-JSON-XS-4.08/Changes
--- old/Cpanel-JSON-XS-4.07/Changes 2018-11-02 10:05:09.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/Changes 2018-11-28 12:07:28.000000000 +0100
@@ -2,6 +2,9 @@
TODO: http://stevehanov.ca/blog/index.php?id=104 compression
+4.08 2018-11-28 (rurban)
+ - Add unblessed_bool property (PR #118 by Pali)
+
4.07 2018-11-02 (rurban)
- Silence Gconvert -Wunused-result.
gcvt returns a string, sprintf int, so suppress the retval
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/META.json
new/Cpanel-JSON-XS-4.08/META.json
--- old/Cpanel-JSON-XS-4.07/META.json 2018-11-02 10:50:32.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/META.json 2018-11-28 15:25:44.000000000 +0100
@@ -4,7 +4,7 @@
"Reini Urban <[email protected]>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 8.3506, CPAN::Meta::Converter
version 2.150010",
+ "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter
version 2.150010",
"license" : [
"perl_5"
],
@@ -48,7 +48,7 @@
"url" : "https://github.com/rurban/Cpanel-JSON-XS"
}
},
- "version" : "4.07",
+ "version" : "4.08",
"x_contributors" : [
"Ashley Willis <[email protected]>",
"Daniel Dragan <[email protected]>",
@@ -73,5 +73,5 @@
"Sergey Aleynikov <[email protected]>",
"Syohei Yoshida <[email protected]>"
],
- "x_serialization_backend" : "JSON::PP version 2.97001_04"
+ "x_serialization_backend" : "JSON::PP version 2.97001"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/META.yml
new/Cpanel-JSON-XS-4.08/META.yml
--- old/Cpanel-JSON-XS-4.07/META.yml 2018-11-02 10:50:32.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/META.yml 2018-11-28 15:25:44.000000000 +0100
@@ -7,7 +7,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 8.3506, CPAN::Meta::Converter
version 2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version
2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,7 +23,7 @@
bugtracker: https://github.com/rurban/Cpanel-JSON-XS/issues
license: http://dev.perl.org/licenses/
repository: https://github.com/rurban/Cpanel-JSON-XS
-version: '4.07'
+version: '4.08'
x_contributors:
- 'Ashley Willis <[email protected]>'
- 'Daniel Dragan <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/README
new/Cpanel-JSON-XS-4.08/README
--- old/Cpanel-JSON-XS-4.07/README 2018-11-02 10:50:38.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/README 2018-11-28 15:25:46.000000000 +0100
@@ -600,6 +600,15 @@
This setting has no effect when decoding JSON texts.
+ $json = $json->unblessed_bool ([$enable])
+ $enabled = $json->get_unblessed_bool
+ $json = $json->unblessed_bool([$enable])
+
+ If $enable is true (or missing), then "decode" will return Perl
+ non-object boolean variables (1 and 0) for JSON booleans ("true" and
+ "false"). If $enable is false, then "decode" will return
+ "Cpanel::JSON::XS::Boolean" objects for JSON booleans.
+
$json = $json->allow_singlequote ([$enable])
$enabled = $json->get_allow_singlequote
$json = $json->allow_singlequote([$enable])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/SIGNATURE
new/Cpanel-JSON-XS-4.08/SIGNATURE
--- old/Cpanel-JSON-XS-4.07/SIGNATURE 2018-11-02 10:50:36.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/SIGNATURE 2018-11-28 15:25:45.000000000 +0100
@@ -12,19 +12,19 @@
not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA512
+Hash: SHA256
SHA256 0abb585f231403618cae65047cfb3910d018ec83951b2bc14dcef5cbc77d1151
.appveyor.yml
SHA256 797abf38891d61e631374ccba78b2a8a707901227012c59372f5a9b2bc867188
.travis.yml
SHA256 8de3540a3cd7ecc9a9dcb48975fe852c082fe17d4462f87bb72aa7cc47f083ad COPYING
-SHA256 46915b82c620a71db17703482705612c213a4a6962a019071c1f260110f3db94 Changes
+SHA256 272c063480cb84cbe62d0cfcb7f96e5ee89efd16216b89e27e76b6c6f12910fa Changes
SHA256 04d51042e2091c8c1f22252efa7e11322d2f6c4dc60c5145aec77e2969f506c8
MANIFEST
-SHA256 a23618eab0e667e9baf3a0a3df483b5b003f31094e74c5f070f7bc493872bed3
META.json
-SHA256 8dca88221dea2db85b0e18bebfc81b3a640551abba7ed6a4715d5cfd792e4e2d
META.yml
+SHA256 5702c884dfd5e88c693eca4e260a262b36e623517707ca4f74c2eb61fe579fbe
META.json
+SHA256 a38872f0e1dad9ed2081becd2ab31553eb7803b530e759b4aee85f0add1a9d57
META.yml
SHA256 d718ee16b2c401c39ce7e2aa2262d4950498879764e060506ed8d667d0a4b798
Makefile.PL
-SHA256 876887f01d67749fa335e6578ea818cf4ddf1576e551dbc74462581bc369ba3c README
-SHA256 f0d24fb73306ebc45306cbf6002ee5151f58854cbe984745887da1343c942a4f XS.pm
-SHA256 8cec00cfe08d63922d38155120f633036cfd4c1de4c0ebbbc4ee5baf57f0f327 XS.xs
+SHA256 d31515d9bc0b76a3990f312e0c33e1072ea66541231da9d7beb0a9e92b1a196f README
+SHA256 57c0b1143b936a907c09fe1711f59d0ca97ea856bc5395ca3f040a27b938e697 XS.pm
+SHA256 501b26001f9d7bb3d26386ed3e827c95272ee4c50f0fb19508cd0165395a7afb XS.xs
SHA256 c95e4b970183cbd6d1ec9c88c37a80f12bd2b66ed6be3c008ffd578d2f622c01
XS/Boolean.pm
SHA256 f9a40fece0783df5c1d1d3d6f2586e61689b0445dcf10bba2916553c29d5f490
XS/Type.pm
SHA256 2f34a530b7ce981b0df9aacd2b6944ccf74c4a7f8bb49fde57b342663e7feb26
bin/cpanel_json_xs
@@ -71,7 +71,7 @@
SHA256 3da823eab55abb6dca05e8bc6111d3b59ea18c4ee270baf6413d9a45042ff48c
t/22_comment_at_eof.t
SHA256 2a6506fb07b27b1fef52b251d3876d23bd572596ff487d37c2f6597be554836c
t/23_array_ctx.t
SHA256 a8dfccba0b60b0fc91812fcfd96656e993abb74970509926d738c67a58641f01
t/24_freeze_recursion.t
-SHA256 4c9f20a76b058e625c871a59c08114baedc12b8ad8af343807368b56da181adc
t/25_boolean.t
+SHA256 016500c1aa6878e4329f3b7ed110a4a6aa90a80fa4350161f9b8fe107d8b9346
t/25_boolean.t
SHA256 138c912f350075b8a9dcd6a8810cb3c40b3e8ac11ae804ef167cc0d7d0773798
t/26_duplicate.t
SHA256 03a2061b4742ea591961a4ce7403feac91998c0909dbde982c465ce3d2c39706
t/30_jsonspec.t
SHA256 f31d07044b924b28a1329f9eac213ad903ec4b8bb6eda095a609cb8c87870439
t/31_bom.t
@@ -437,12 +437,12 @@
SHA256 aca6f846869ab2e4881e807739086e1535b1438bd0e23d7a021360742736a6a9
xt/pod.t
-----BEGIN PGP SIGNATURE-----
-iQEzBAEBCgAdFiEEKJWogdNCcPq/6PdHtPYzOeZdZBQFAlvcHesACgkQtPYzOeZd
-ZBTsYAgApIRUdsiFHDmWT+ktp54m2lWle5Q6uEB5CVUtcTokS9xpVFCNyn+L4NUB
-9KPgJzf/PxKWuws0Kbhcleroy3oW4WU7onY5CV8vj0qV5AuTUuUtrOkwUrbGfLzi
-Uj/BAIzUQ+tMHvq3OhiH4xr4To39v5+U45pBclRzVygvuaU6t2Wj+GN6LEKzpE8+
-V9/0xMtUU3HrajgpZkXaD6U4PfNN8yfaXsc+/IZtgdOQyX1pTfHw4V3C7pwbmqGc
-Rc8cGj1BZQagmM6WbNsbPOp2ayg4wKR6VRkO51VstXBuVUUQIrFqjCL7e/Cc2q8R
-fDUQMuhuj09O8uvy3+NjwfH7L+CG7Q==
-=+MUT
+iQEzBAEBCAAdFiEEKJWogdNCcPq/6PdHtPYzOeZdZBQFAlv+pWkACgkQtPYzOeZd
+ZBRHfAf+P0oWTSct+ILbGE2/X17Y4fFwKWOG0PNDlDiaHoF+tEh9tsmwziSawJ8K
+65AdjnXWmMNEdFOQjJpgRght7fgAoW7D9yv2banqMiCnVNCDfVPWTqsKUaI1zgBq
++Bk58Hl7tcTer72P8OtA+VVY9AKk3kgMJxOb9wN2zDASiMlMEsPJiC6TugKLMnuc
+vlmSDTK3LCjAoQXhNR7a2nXZaPO04NxzRXy7k6UDnte7KJUB60Uu0TgqOApgPc1n
+o4UbTTddJ+J+qsLRG+FTs7A9oWY+Z15lEdv9lgrKCNnZv6VAPN/w9Gs/O8m3TJua
+7WD7YWc38c1+0qnvNmH05zwUUzoe1w==
+=oV3y
-----END PGP SIGNATURE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/XS.pm
new/Cpanel-JSON-XS-4.08/XS.pm
--- old/Cpanel-JSON-XS-4.07/XS.pm 2018-11-02 10:05:30.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/XS.pm 2018-11-28 12:07:28.000000000 +0100
@@ -1,5 +1,5 @@
package Cpanel::JSON::XS;
-our $VERSION = '4.07';
+our $VERSION = '4.08';
our $XS_VERSION = $VERSION;
# $VERSION = eval $VERSION;
@@ -701,6 +701,18 @@
This setting has no effect when decoding JSON texts.
+=item $json = $json->unblessed_bool ([$enable])
+
+=item $enabled = $json->get_unblessed_bool
+
+ $json = $json->unblessed_bool([$enable])
+
+If C<$enable> is true (or missing), then C<decode> will return
+Perl non-object boolean variables (1 and 0) for JSON booleans
+(C<true> and C<false>). If C<$enable> is false, then C<decode>
+will return C<Cpanel::JSON::XS::Boolean> objects for JSON booleans.
+
+
=item $json = $json->allow_singlequote ([$enable])
=item $enabled = $json->get_allow_singlequote
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/XS.xs
new/Cpanel-JSON-XS-4.08/XS.xs
--- old/Cpanel-JSON-XS-4.07/XS.xs 2018-11-02 10:05:30.000000000 +0100
+++ new/Cpanel-JSON-XS-4.08/XS.xs 2018-11-28 12:07:28.000000000 +0100
@@ -276,6 +276,7 @@
#define F_ESCAPE_SLASH 0x00080000UL
#define F_SORT_BY 0x00100000UL
#define F_ALLOW_STRINGIFY 0x00200000UL
+#define F_UNBLESSED_BOOL 0x00400000UL
#define F_HOOK 0x80000000UL /* some hooks exist, so slow-path
processing */
#define F_PRETTY F_INDENT | F_SPACE_BEFORE | F_SPACE_AFTER
@@ -3600,6 +3601,8 @@
dec->cur += 4;
if (typesv)
sv_setiv_mg (typesv, JSON_TYPE_BOOL);
+ if (dec->json.flags & F_UNBLESSED_BOOL)
+ return &PL_sv_yes;
return newSVsv(MY_CXT.json_true);
}
else
@@ -3614,6 +3617,8 @@
dec->cur += 5;
if (typesv)
sv_setiv_mg (typesv, JSON_TYPE_BOOL);
+ if (dec->json.flags & F_UNBLESSED_BOOL)
+ return &PL_sv_no;
return newSVsv(MY_CXT.json_false);
}
else
@@ -4103,6 +4108,7 @@
allow_bignum = F_ALLOW_BIGNUM
escape_slash = F_ESCAPE_SLASH
allow_stringify = F_ALLOW_STRINGIFY
+ unblessed_bool = F_UNBLESSED_BOOL
PPCODE:
if (enable)
self->flags |= ix;
@@ -4132,6 +4138,7 @@
get_allow_bignum = F_ALLOW_BIGNUM
get_escape_slash = F_ESCAPE_SLASH
get_allow_stringify = F_ALLOW_STRINGIFY
+ get_unblessed_bool = F_UNBLESSED_BOOL
PPCODE:
XPUSHs (boolSV (self->flags & ix));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.07/t/25_boolean.t
new/Cpanel-JSON-XS-4.08/t/25_boolean.t
--- old/Cpanel-JSON-XS-4.07/t/25_boolean.t 2018-01-30 14:18:43.000000000
+0100
+++ new/Cpanel-JSON-XS-4.08/t/25_boolean.t 2018-11-28 12:07:29.000000000
+0100
@@ -1,8 +1,16 @@
use strict;
-use Test::More tests => 32;
+use Test::More tests => 40;
use Cpanel::JSON::XS ();
use Config;
+my $have_blessed;
+BEGIN {
+ if (eval { require Scalar::Util }) {
+ Scalar::Util->import('blessed');
+ $have_blessed = 1;
+ }
+}
+
my $booltrue = q({"is_true":true});
my $boolfalse = q({"is_false":false});
my $truefalse = "[true,false]";
@@ -11,6 +19,7 @@
my $false = Cpanel::JSON::XS::false;
my $nonref_cjson = Cpanel::JSON::XS->new->allow_nonref;
+my $unblessed_bool_cjson = Cpanel::JSON::XS->new->unblessed_bool;
# from JSON::MaybeXS
my $data = $cjson->decode('{"foo": true, "bar": false, "baz": 1}');
@@ -86,3 +95,23 @@
# GH #53
ok( !Cpanel::JSON::XS::is_bool( [] ), "[] !is_bool");
+
+
+$js = $unblessed_bool_cjson->decode($booltrue);
+SKIP: {
+ skip "no Scalar::Util in $]", 1 unless $have_blessed;
+ ok(!blessed($js->{is_true}), "->unblessed_bool for JSON true does not return
blessed object");
+}
+cmp_ok($js->{is_true}, "==", 1, "->unblessed_bool for JSON true returns
correct Perl bool value");
+cmp_ok($js->{is_true}, "eq", "1", "->unblessed_bool for JSON true returns
correct Perl bool value");
+
+$js = $unblessed_bool_cjson->decode($boolfalse);
+SKIP: {
+ skip "no Scalar::Util in $]", 1 unless $have_blessed;
+ ok(!blessed($js->{is_false}), "->unblessed_bool for JSON false does not
return blessed object");
+}
+cmp_ok($js->{is_false}, "==", 0, "->unblessed_bool for JSON false returns
correct Perl bool value");
+cmp_ok($js->{is_false}, "eq", "", "->unblessed_bool for JSON false returns
correct Perl bool value");
+
+is($unblessed_bool_cjson->encode($unblessed_bool_cjson->decode($truefalse)),
$truefalse, "encode(decode(boolean)) is identity with ->unblessed_bool");
+is($cjson->encode($unblessed_bool_cjson->decode($truefalse)), $truefalse,
"booleans decoded by ->unblessed_bool(1) are encoded by ->unblessed_bool(0) in
the same way");