Hello community, here is the log from the commit of package perl-YAML-PP for openSUSE:Factory checked in at 2020-09-12 00:11:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-YAML-PP (Old) and /work/SRC/openSUSE:Factory/.perl-YAML-PP.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-YAML-PP" Sat Sep 12 00:11:25 2020 rev:9 rq:833737 version:0.026 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-YAML-PP/perl-YAML-PP.changes 2020-09-07 21:36:06.789401805 +0200 +++ /work/SRC/openSUSE:Factory/.perl-YAML-PP.new.4249/perl-YAML-PP.changes 2020-09-12 00:11:59.761184483 +0200 @@ -1,0 +2,11 @@ +Fri Sep 11 03:11:05 UTC 2020 - Tina Müller <[email protected]> + +- updated to 0.026 + see /usr/share/doc/packages/perl-YAML-PP/Changes + + 0.026 2020-09-11 00:39:09+02:00 + + - Add option 'duplicate_keys'. The default allows it for now and will + change to forbid in the next release. + +------------------------------------------------------------------- Old: ---- YAML-PP-0.025.tar.gz New: ---- YAML-PP-0.026.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-YAML-PP.spec ++++++ --- /var/tmp/diff_new_pack.hfvRvm/_old 2020-09-12 00:12:01.501186148 +0200 +++ /var/tmp/diff_new_pack.hfvRvm/_new 2020-09-12 00:12:01.505186152 +0200 @@ -17,7 +17,7 @@ Name: perl-YAML-PP -Version: 0.025 +Version: 0.026 Release: 0 %define cpan_name YAML-PP Summary: YAML 1.2 processor ++++++ YAML-PP-0.025.tar.gz -> YAML-PP-0.026.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/Changes new/YAML-PP-0.026/Changes --- old/YAML-PP-0.025/Changes 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/Changes 2020-09-11 00:43:06.000000000 +0200 @@ -1,5 +1,10 @@ Revision history for Perl module YAML::PP +0.026 2020-09-11 00:39:09+02:00 + + - Add option 'duplicate_keys'. The default allows it for now and will + change to forbid in the next release. + 0.025 2020-09-06 22:14:07+02:00 - Emitter: Fix indentation issues for non-default indents diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/MANIFEST new/YAML-PP-0.026/MANIFEST --- old/YAML-PP-0.025/MANIFEST 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/MANIFEST 2020-09-11 00:43:06.000000000 +0200 @@ -104,6 +104,7 @@ t/54.glob.t t/55.flow.t t/56.force-flow.t +t/57.dup-keys.t t/data/include/circular1.yaml t/data/include/circular2.yaml t/data/include/include.yaml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/META.json new/YAML-PP-0.026/META.json --- old/YAML-PP-0.025/META.json 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/META.json 2020-09-11 00:43:06.000000000 +0200 @@ -65,131 +65,131 @@ "provides" : { "YAML::PP" : { "file" : "lib/YAML/PP.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Common" : { "file" : "lib/YAML/PP/Common.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Constructor" : { "file" : "lib/YAML/PP/Constructor.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Dumper" : { "file" : "lib/YAML/PP/Dumper.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Emitter" : { "file" : "lib/YAML/PP/Emitter.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Exception" : { "file" : "lib/YAML/PP/Exception.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Grammar" : { "file" : "lib/YAML/PP/Grammar.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Highlight" : { "file" : "lib/YAML/PP/Highlight.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Lexer" : { "file" : "lib/YAML/PP/Lexer.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Loader" : { "file" : "lib/YAML/PP/Loader.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Parser" : { "file" : "lib/YAML/PP/Parser.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Perl" : { "file" : "lib/YAML/PP/Perl.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Preserve::Array" : { "file" : "lib/YAML/PP.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Preserve::Hash" : { "file" : "lib/YAML/PP.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Preserve::Scalar" : { "file" : "lib/YAML/PP.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Reader" : { "file" : "lib/YAML/PP/Reader.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Reader::File" : { "file" : "lib/YAML/PP/Reader.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Render" : { "file" : "lib/YAML/PP/Render.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Representer" : { "file" : "lib/YAML/PP/Representer.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema" : { "file" : "lib/YAML/PP/Schema.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Binary" : { "file" : "lib/YAML/PP/Schema/Binary.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Core" : { "file" : "lib/YAML/PP/Schema/Core.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Failsafe" : { "file" : "lib/YAML/PP/Schema/Failsafe.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Include" : { "file" : "lib/YAML/PP/Schema/Include.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::JSON" : { "file" : "lib/YAML/PP/Schema/JSON.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Merge" : { "file" : "lib/YAML/PP/Schema/Merge.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Perl" : { "file" : "lib/YAML/PP/Schema/Perl.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::Tie::IxHash" : { "file" : "lib/YAML/PP/Schema/Tie/IxHash.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Schema::YAML1_1" : { "file" : "lib/YAML/PP/Schema/YAML1_1.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Type::MergeKey" : { "file" : "lib/YAML/PP/Type/MergeKey.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Writer" : { "file" : "lib/YAML/PP/Writer.pm", - "version" : "0.025" + "version" : "0.026" }, "YAML::PP::Writer::File" : { "file" : "lib/YAML/PP/Writer/File.pm", - "version" : "0.025" + "version" : "0.026" } }, "release_status" : "stable", @@ -203,7 +203,7 @@ "web" : "https://github.com/perlpunk/YAML-PP-p5" } }, - "version" : "0.025", + "version" : "0.026", "x_generated_by_perl" : "v5.30.3", "x_serialization_backend" : "Cpanel::JSON::XS version 4.21", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/META.yml new/YAML-PP-0.026/META.yml --- old/YAML-PP-0.025/META.yml 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/META.yml 2020-09-11 00:43:06.000000000 +0200 @@ -25,100 +25,100 @@ provides: YAML::PP: file: lib/YAML/PP.pm - version: '0.025' + version: '0.026' YAML::PP::Common: file: lib/YAML/PP/Common.pm - version: '0.025' + version: '0.026' YAML::PP::Constructor: file: lib/YAML/PP/Constructor.pm - version: '0.025' + version: '0.026' YAML::PP::Dumper: file: lib/YAML/PP/Dumper.pm - version: '0.025' + version: '0.026' YAML::PP::Emitter: file: lib/YAML/PP/Emitter.pm - version: '0.025' + version: '0.026' YAML::PP::Exception: file: lib/YAML/PP/Exception.pm - version: '0.025' + version: '0.026' YAML::PP::Grammar: file: lib/YAML/PP/Grammar.pm - version: '0.025' + version: '0.026' YAML::PP::Highlight: file: lib/YAML/PP/Highlight.pm - version: '0.025' + version: '0.026' YAML::PP::Lexer: file: lib/YAML/PP/Lexer.pm - version: '0.025' + version: '0.026' YAML::PP::Loader: file: lib/YAML/PP/Loader.pm - version: '0.025' + version: '0.026' YAML::PP::Parser: file: lib/YAML/PP/Parser.pm - version: '0.025' + version: '0.026' YAML::PP::Perl: file: lib/YAML/PP/Perl.pm - version: '0.025' + version: '0.026' YAML::PP::Preserve::Array: file: lib/YAML/PP.pm - version: '0.025' + version: '0.026' YAML::PP::Preserve::Hash: file: lib/YAML/PP.pm - version: '0.025' + version: '0.026' YAML::PP::Preserve::Scalar: file: lib/YAML/PP.pm - version: '0.025' + version: '0.026' YAML::PP::Reader: file: lib/YAML/PP/Reader.pm - version: '0.025' + version: '0.026' YAML::PP::Reader::File: file: lib/YAML/PP/Reader.pm - version: '0.025' + version: '0.026' YAML::PP::Render: file: lib/YAML/PP/Render.pm - version: '0.025' + version: '0.026' YAML::PP::Representer: file: lib/YAML/PP/Representer.pm - version: '0.025' + version: '0.026' YAML::PP::Schema: file: lib/YAML/PP/Schema.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Binary: file: lib/YAML/PP/Schema/Binary.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Core: file: lib/YAML/PP/Schema/Core.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Failsafe: file: lib/YAML/PP/Schema/Failsafe.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Include: file: lib/YAML/PP/Schema/Include.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::JSON: file: lib/YAML/PP/Schema/JSON.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Merge: file: lib/YAML/PP/Schema/Merge.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Perl: file: lib/YAML/PP/Schema/Perl.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::Tie::IxHash: file: lib/YAML/PP/Schema/Tie/IxHash.pm - version: '0.025' + version: '0.026' YAML::PP::Schema::YAML1_1: file: lib/YAML/PP/Schema/YAML1_1.pm - version: '0.025' + version: '0.026' YAML::PP::Type::MergeKey: file: lib/YAML/PP/Type/MergeKey.pm - version: '0.025' + version: '0.026' YAML::PP::Writer: file: lib/YAML/PP/Writer.pm - version: '0.025' + version: '0.026' YAML::PP::Writer::File: file: lib/YAML/PP/Writer/File.pm - version: '0.025' + version: '0.026' requires: B: '0' B::Deparse: '0' @@ -142,7 +142,7 @@ resources: bugtracker: https://github.com/perlpunk/YAML-PP-p5/issues repository: https://github.com/perlpunk/YAML-PP-p5 -version: '0.025' +version: '0.026' x_generated_by_perl: v5.30.3 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/Makefile.PL new/YAML-PP-0.026/Makefile.PL --- old/YAML-PP-0.025/Makefile.PL 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/Makefile.PL 2020-09-11 00:43:06.000000000 +0200 @@ -54,7 +54,7 @@ "Test::Warn" => 0, "lib" => 0 }, - "VERSION" => "0.025", + "VERSION" => "0.026", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/dist.ini new/YAML-PP-0.026/dist.ini --- old/YAML-PP-0.025/dist.ini 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/dist.ini 2020-09-11 00:43:06.000000000 +0200 @@ -4,7 +4,7 @@ copyright_holder = Tina Müller copyright_year = 2020 -version = 0.025 +version = 0.026 [@Filter] -bundle = @Basic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Common.pm new/YAML-PP-0.026/lib/YAML/PP/Common.pm --- old/YAML-PP-0.025/lib/YAML/PP/Common.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Common.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Common; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use base 'Exporter'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Constructor.pm new/YAML-PP-0.026/lib/YAML/PP/Constructor.pm --- old/YAML-PP-0.025/lib/YAML/PP/Constructor.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Constructor.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,11 +3,12 @@ use warnings; package YAML::PP::Constructor; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP; use YAML::PP::Common qw/ PRESERVE_ALL PRESERVE_ORDER PRESERVE_SCALAR_STYLE PRESERVE_FLOW_STYLE /; use Scalar::Util qw/ reftype /; +use Carp qw/ croak /; use constant DEBUG => ($ENV{YAML_PP_LOAD_DEBUG} or $ENV{YAML_PP_LOAD_TRACE}) ? 1 : 0; use constant TRACE => $ENV{YAML_PP_LOAD_TRACE} ? 1 : 0; @@ -18,6 +19,11 @@ my ($class, %args) = @_; my $default_yaml_version = delete $args{default_yaml_version}; + # TODO: switch to default 0 + my $duplicate_keys = delete $args{duplicate_keys}; + unless (defined $duplicate_keys) { + $duplicate_keys = 1; + } my $preserve = delete $args{preserve} || 0; if ($preserve == PRESERVE_ALL) { $preserve = PRESERVE_ORDER | PRESERVE_SCALAR_STYLE | PRESERVE_FLOW_STYLE; @@ -36,6 +42,7 @@ schemas => $schemas, cyclic_refs => $cyclic_refs, preserve => $preserve, + duplicate_keys => $duplicate_keys, }, $class; $self->init; return $self; @@ -79,6 +86,7 @@ sub preserve_order { return $_[0]->{preserve} & PRESERVE_ORDER } sub preserve_scalar_style { return $_[0]->{preserve} & PRESERVE_SCALAR_STYLE } sub preserve_flow_style { return $_[0]->{preserve} & PRESERVE_FLOW_STYLE } +sub duplicate_keys { return $_[0]->{duplicate_keys} } sub document_start_event { my ($self, $event) = @_; @@ -185,12 +193,16 @@ } my $on_data = $last->{on_data} || sub { my ($self, $hash, $items) = @_; + my %seen; for (my $i = 0; $i < @$items; $i += 2) { my ($key, $value) = @$items[ $i, $i + 1 ]; $key = '' unless defined $key; if (ref $key) { $key = $self->stringify_complex($key); } + if ($seen{ $key }++ and not $self->duplicate_keys) { + croak "Duplicate key '$key'"; + } $$hash->{ $key } = $value; } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Dumper.pm new/YAML-PP-0.026/lib/YAML/PP/Dumper.pm --- old/YAML-PP-0.025/lib/YAML/PP/Dumper.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Dumper.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Dumper; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Scalar::Util qw/ blessed refaddr reftype /; use YAML::PP; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Emitter.pm new/YAML-PP-0.026/lib/YAML/PP/Emitter.pm --- old/YAML-PP-0.025/lib/YAML/PP/Emitter.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Emitter.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Emitter; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Data::Dumper; use YAML::PP::Common qw/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Exception.pm new/YAML-PP-0.026/lib/YAML/PP/Exception.pm --- old/YAML-PP-0.025/lib/YAML/PP/Exception.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Exception.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Exception; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use overload '""' => \&to_string; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Grammar.pm new/YAML-PP-0.026/lib/YAML/PP/Grammar.pm --- old/YAML-PP-0.025/lib/YAML/PP/Grammar.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Grammar.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Grammar; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use base 'Exporter'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Highlight.pm new/YAML-PP-0.026/lib/YAML/PP/Highlight.pm --- old/YAML-PP-0.025/lib/YAML/PP/Highlight.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Highlight.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Highlight; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION our @EXPORT_OK = qw/ Dump /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Lexer.pm new/YAML-PP-0.026/lib/YAML/PP/Lexer.pm --- old/YAML-PP-0.025/lib/YAML/PP/Lexer.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Lexer.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Lexer; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use constant TRACE => $ENV{YAML_PP_TRACE} ? 1 : 0; use constant DEBUG => ($ENV{YAML_PP_DEBUG} || $ENV{YAML_PP_TRACE}) ? 1 : 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Loader.pm new/YAML-PP-0.026/lib/YAML/PP/Loader.pm --- old/YAML-PP-0.025/lib/YAML/PP/Loader.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Loader.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP::Loader; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Parser; use YAML::PP::Constructor; @@ -15,6 +15,7 @@ my $cyclic_refs = delete $args{cyclic_refs} || 'allow'; my $default_yaml_version = delete $args{default_yaml_version} || '1.2'; my $preserve = delete $args{preserve}; + my $duplicate_keys = delete $args{duplicate_keys}; my $schemas = delete $args{schemas}; $schemas ||= { '1.2' => YAML::PP->default_schema( @@ -27,6 +28,7 @@ cyclic_refs => $cyclic_refs, default_yaml_version => $default_yaml_version, preserve => $preserve, + duplicate_keys => $duplicate_keys, ); my $parser = delete $args{parser}; unless ($parser) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Parser.pm new/YAML-PP-0.026/lib/YAML/PP/Parser.pm --- old/YAML-PP-0.025/lib/YAML/PP/Parser.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Parser.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP::Parser; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use constant TRACE => $ENV{YAML_PP_TRACE} ? 1 : 0; use constant DEBUG => ($ENV{YAML_PP_DEBUG} || $ENV{YAML_PP_TRACE}) ? 1 : 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Perl.pm new/YAML-PP-0.026/lib/YAML/PP/Perl.pm --- old/YAML-PP-0.025/lib/YAML/PP/Perl.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Perl.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Perl; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use base 'Exporter'; use base 'YAML::PP'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Reader.pm new/YAML-PP-0.026/lib/YAML/PP/Reader.pm --- old/YAML-PP-0.025/lib/YAML/PP/Reader.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Reader.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP::Reader; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION sub input { return $_[0]->{input} } sub set_input { $_[0]->{input} = $_[1] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Render.pm new/YAML-PP-0.026/lib/YAML/PP/Render.pm --- old/YAML-PP-0.025/lib/YAML/PP/Render.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Render.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP::Render; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use constant TRACE => $ENV{YAML_PP_TRACE} ? 1 : 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Representer.pm new/YAML-PP-0.026/lib/YAML/PP/Representer.pm --- old/YAML-PP-0.025/lib/YAML/PP/Representer.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Representer.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Representer; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Scalar::Util qw/ reftype blessed refaddr /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Binary.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Binary.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Binary.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Binary.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Binary; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use MIME::Base64 qw/ decode_base64 encode_base64 /; use YAML::PP::Common qw/ YAML_ANY_SCALAR_STYLE /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Core.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Core.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Core.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Core.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Core; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Schema::JSON qw/ represent_int represent_float represent_literal represent_bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Failsafe.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Failsafe.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Failsafe.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Failsafe.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Failsafe; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION sub register { my ($self, %args) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Include.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Include.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Include.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Include.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Include; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Carp qw/ croak /; use Scalar::Util qw/ weaken /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/JSON.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/JSON.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/JSON.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/JSON.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::JSON; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use base 'Exporter'; our @EXPORT_OK = qw/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Merge.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Merge.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Merge.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Merge.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Merge; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Type::MergeKey; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Perl.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Perl.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Perl.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Perl.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Perl; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Scalar::Util qw/ blessed reftype /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/Tie/IxHash.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/Tie/IxHash.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/Tie/IxHash.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/Tie/IxHash.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::Tie::IxHash; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use base 'YAML::PP::Schema'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema/YAML1_1.pm new/YAML-PP-0.026/lib/YAML/PP/Schema/YAML1_1.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema/YAML1_1.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema/YAML1_1.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Schema::YAML1_1; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Schema::JSON qw/ represent_int represent_float represent_literal represent_bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Schema.pm new/YAML-PP-0.026/lib/YAML/PP/Schema.pm --- old/YAML-PP-0.025/lib/YAML/PP/Schema.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Schema.pm 2020-09-11 00:43:06.000000000 +0200 @@ -4,7 +4,7 @@ use B; use Module::Load qw//; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Common qw/ YAML_PLAIN_SCALAR_STYLE /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Type/MergeKey.pm new/YAML-PP-0.026/lib/YAML/PP/Type/MergeKey.pm --- old/YAML-PP-0.025/lib/YAML/PP/Type/MergeKey.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Type/MergeKey.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Type::MergeKey; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION sub new { my ($class) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Writer/File.pm new/YAML-PP-0.026/lib/YAML/PP/Writer/File.pm --- old/YAML-PP-0.025/lib/YAML/PP/Writer/File.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Writer/File.pm 2020-09-11 00:43:06.000000000 +0200 @@ -2,7 +2,7 @@ use warnings; package YAML::PP::Writer::File; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use Scalar::Util qw/ openhandle /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP/Writer.pm new/YAML-PP-0.026/lib/YAML/PP/Writer.pm --- old/YAML-PP-0.025/lib/YAML/PP/Writer.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP/Writer.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP::Writer; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION sub output { return $_[0]->{output} } sub set_output { $_[0]->{output} = $_[1] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/lib/YAML/PP.pm new/YAML-PP-0.026/lib/YAML/PP.pm --- old/YAML-PP-0.025/lib/YAML/PP.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/lib/YAML/PP.pm 2020-09-11 00:43:06.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; package YAML::PP; -our $VERSION = '0.025'; # VERSION +our $VERSION = '0.026'; # VERSION use YAML::PP::Schema; use YAML::PP::Schema::JSON; @@ -30,6 +30,7 @@ my $writer = delete $args{writer}; my $header = delete $args{header}; my $footer = delete $args{footer}; + my $duplicate_keys = delete $args{duplicate_keys}; my $yaml_version = $class->_arg_yaml_version(delete $args{yaml_version}); my $default_yaml_version = $yaml_version->[0]; my $version_directive = delete $args{version_directive}; @@ -67,6 +68,7 @@ parser => $parser, default_yaml_version => $default_yaml_version, preserve => $preserve, + duplicate_keys => $duplicate_keys, ); my $dumper = YAML::PP::Dumper->new( schema => $default_schema, @@ -512,6 +514,8 @@ Values: C<perl> (currently default), C<JSON::PP>, C<boolean> +This option is for loading and dumping. + Note that when dumping, only the chosen boolean style will be recognized. So if you choose C<JSON::PP>, C<boolean> objects will not be recognized as booleans and will be dumped as ordinary objects (if you enable the @@ -521,6 +525,8 @@ Default: C<['Core']> +This option is for loading and dumping. + Array reference. Here you can define what schema to use. Supported standard Schemas are: C<Failsafe>, C<JSON>, C<Core>, C<YAML1_1>. @@ -533,6 +539,8 @@ Default: 'allow' but will be switched to fatal in the future for safety! +This option is for loading only. + Defines what to do when a cyclic reference is detected when loading. # fatal - die @@ -540,10 +548,38 @@ # ignore - replace with undef # allow - Default +=item duplicate_keys + +Default: 1 + +Since version 0.026 + +This option is for loading. + +NOTE: THIS OPTION WILL BE SET TO 0 IN THE NEXT RELEASE. + +The YAML Spec says duplicate mapping keys should be forbidden. + +When set to true, duplicate keys in mappings are allowed (and will overwrite +the previous key). + +When set to false, duplicate keys will result in an error when loading. + +This is especially useful when you have a longer mapping and don't see +the duplicate key in your editor: + + --- + a: 1 + b: 2 + # ............. + a: 23 # error + =item indent Default: 2 +This option is for dumping. + Use that many spaces for indenting =item width @@ -552,6 +588,8 @@ Default: 80 +This option is for dumping. + Maximum columns when dumping. This is only respected when dumping flow collections right now. @@ -562,18 +600,24 @@ Default: 1 +This option is for dumping. + Print document heaader C<---> =item footer Default: 0 +This option is for dumping. + Print document footer C<...> =item yaml_version Since version 0.020 +This option is for loading and dumping. + Default: C<1.2> Note that in this case, a directive C<%YAML 1.1> will basically be ignored @@ -620,6 +664,8 @@ Since version 0.020 +This option is for dumping. + Default: 0 Print Version Directive C<%YAML 1.2> (or C<%YAML 1.1>) on top of each YAML @@ -631,6 +677,8 @@ Default: false +This option is for loading and dumping. + Preserving scalar styles is still experimental. use YAML::PP::Common qw/ PRESERVE_ORDER PRESERVE_SCALAR_STYLE /; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/t/31.schema.t new/YAML-PP-0.026/t/31.schema.t --- old/YAML-PP-0.025/t/31.schema.t 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/t/31.schema.t 2020-09-11 00:43:06.000000000 +0200 @@ -13,7 +13,7 @@ my $schema_file = "$Bin/../ext/yaml-test-schema/yaml-schema.yaml"; my $strings_file = "$Bin/../examples/strings.yaml"; -my $schema_data = do { YAML::PP->new->load_file($schema_file) }; +my $schema_data = do { YAML::PP->new( duplicate_keys => 1 )->load_file($schema_file) }; my $strings_data = do { YAML::PP->new->load_file($strings_file) }; $schema_data->{'#empty'}->{json_empty_null} = ['null', 'null()', "null"]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/t/57.dup-keys.t new/YAML-PP-0.026/t/57.dup-keys.t --- old/YAML-PP-0.025/t/57.dup-keys.t 1970-01-01 01:00:00.000000000 +0100 +++ new/YAML-PP-0.026/t/57.dup-keys.t 2020-09-11 00:43:06.000000000 +0200 @@ -0,0 +1,36 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Data::Dumper; +use YAML::PP; +use Test::Deep; + +my $allow = YAML::PP->new( + duplicate_keys => 1, +); +my $forbid = YAML::PP->new( + duplicate_keys => 0, +); + + +my $yaml = <<'EOM'; +a: 1 +b: 2 +a: 3 +EOM + +my $data = $allow->load_string($yaml); +my $expected = { + a => 3, + b => 2, +}; +is_deeply($data, $expected, "Allowed duplicate keys"); + + +$data = eval { $forbid->load_string($yaml) }; +my $err = $@; +like $err, qr{Duplicate key 'a'}, "Forbidden duplicate keys"; + + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-PP-0.025/t/lib/YAML/PP/Test.pm new/YAML-PP-0.026/t/lib/YAML/PP/Test.pm --- old/YAML-PP-0.025/t/lib/YAML/PP/Test.pm 2020-09-06 22:18:00.000000000 +0200 +++ new/YAML-PP-0.026/t/lib/YAML/PP/Test.pm 2020-09-11 00:43:06.000000000 +0200 @@ -532,7 +532,7 @@ my ($self, $testcase) = @_; my $id = $testcase->{id}; - my $ypp = YAML::PP->new( boolean => 'JSON::PP' ); + my $ypp = YAML::PP->new( boolean => 'JSON::PP', duplicate_keys => 1 ); my @docs = eval { $ypp->load_string($testcase->{in_yaml}) }; my $err = $@; my $result = {};
