Hello community,

here is the log from the commit of package perl-Struct-Dumb for 
openSUSE:Factory checked in at 2016-03-17 16:34:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Struct-Dumb (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Struct-Dumb.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Struct-Dumb"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Struct-Dumb/perl-Struct-Dumb.changes        
2015-12-17 15:55:01.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Struct-Dumb.new/perl-Struct-Dumb.changes   
2016-03-17 16:47:40.000000000 +0100
@@ -1,0 +2,10 @@
+Fri Mar 11 10:50:16 UTC 2016 - co...@suse.com
+
+- updated to 0.09
+   see /usr/share/doc/packages/perl-Struct-Dumb/Changes
+
+  0.09    2016/03/09 17:49:17
+          [CHANGES]
+           * Allow callers to allow ARRAY dereference for special circumstances
+
+-------------------------------------------------------------------

Old:
----
  Struct-Dumb-0.08.tar.gz

New:
----
  Struct-Dumb-0.09.tar.gz

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

Other differences:
------------------
++++++ perl-Struct-Dumb.spec ++++++
--- /var/tmp/diff_new_pack.Vjmww9/_old  2016-03-17 16:47:41.000000000 +0100
+++ /var/tmp/diff_new_pack.Vjmww9/_new  2016-03-17 16:47:41.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Struct-Dumb
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Struct-Dumb
-Version:        0.08
+Version:        0.09
 Release:        0
 %define cpan_name Struct-Dumb
 Summary:        Make Simple Lightweight Record-Like Structures
@@ -30,7 +30,7 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(Module::Build)
+BuildRequires:  perl(Module::Build) >= 0.400400
 BuildRequires:  perl(Test::Fatal)
 BuildRequires:  perl(Test::More) >= 0.88
 %{perl_requires}

++++++ Struct-Dumb-0.08.tar.gz -> Struct-Dumb-0.09.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/Build.PL 
new/Struct-Dumb-0.09/Build.PL
--- old/Struct-Dumb-0.08/Build.PL       2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/Build.PL       2016-03-09 18:51:22.000000000 +0100
@@ -5,11 +5,13 @@
 
 my $build = Module::Build->new(
    module_name => 'Struct::Dumb',
-   build_requires => {
+   test_requires => {
       'Test::Fatal' => 0,
       'Test::More' => '0.88', # done_testing
    },
-   auto_configure_requires => 0, # Don't add M::B to configure_requires
+   configure_requires => {
+      'Module::Build' => '0.4004', # test_requires
+   },
    license => 'perl',
    create_makefile_pl => 'traditional',
    create_license => 1,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/Changes new/Struct-Dumb-0.09/Changes
--- old/Struct-Dumb-0.08/Changes        2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/Changes        2016-03-09 18:51:22.000000000 +0100
@@ -1,5 +1,9 @@
 Revision history for Struct-Dumb
 
+0.09    2016/03/09 17:49:17
+        [CHANGES]
+         * Allow callers to allow ARRAY dereference for special circumstances
+
 0.08    2015/12/15 17:45:46
         [CHANGES]
          * Support perl 5.8.x (which lacks overloading.pm)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/LICENSE new/Struct-Dumb-0.09/LICENSE
--- old/Struct-Dumb-0.08/LICENSE        2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/LICENSE        2016-03-09 18:51:22.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2015 by Paul Evans <leon...@leonerd.org.uk>.
+This software is copyright (c) 2016 by Paul Evans <leon...@leonerd.org.uk>.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2015 by Paul Evans <leon...@leonerd.org.uk>.
+This software is Copyright (c) 2016 by Paul Evans <leon...@leonerd.org.uk>.
 
 This is free software, licensed under:
 
@@ -272,7 +272,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2015 by Paul Evans <leon...@leonerd.org.uk>.
+This software is Copyright (c) 2016 by Paul Evans <leon...@leonerd.org.uk>.
 
 This is free software, licensed under:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/META.json 
new/Struct-Dumb-0.09/META.json
--- old/Struct-Dumb-0.08/META.json      2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/META.json      2016-03-09 18:51:22.000000000 +0100
@@ -4,7 +4,7 @@
       "Paul Evans <leon...@leonerd.org.uk>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "Module::Build version 0.4211",
+   "generated_by" : "Module::Build version 0.4214",
    "license" : [
       "perl_5"
    ],
@@ -14,7 +14,12 @@
    },
    "name" : "Struct-Dumb",
    "prereqs" : {
-      "build" : {
+      "configure" : {
+         "requires" : {
+            "Module::Build" : "0.4004"
+         }
+      },
+      "test" : {
          "requires" : {
             "Test::Fatal" : "0",
             "Test::More" : "0.88"
@@ -24,7 +29,7 @@
    "provides" : {
       "Struct::Dumb" : {
          "file" : "lib/Struct/Dumb.pm",
-         "version" : "0.08"
+         "version" : "0.09"
       }
    },
    "release_status" : "stable",
@@ -33,5 +38,6 @@
          "http://dev.perl.org/licenses/";
       ]
    },
-   "version" : "0.08"
+   "version" : "0.09",
+   "x_serialization_backend" : "JSON::PP version 2.27300"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/META.yml 
new/Struct-Dumb-0.09/META.yml
--- old/Struct-Dumb-0.08/META.yml       2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/META.yml       2016-03-09 18:51:22.000000000 +0100
@@ -5,8 +5,10 @@
 build_requires:
   Test::Fatal: '0'
   Test::More: '0.88'
+configure_requires:
+  Module::Build: '0.4004'
 dynamic_config: 1
-generated_by: 'Module::Build version 0.4211, CPAN::Meta::Converter version 
2.150001'
+generated_by: 'Module::Build version 0.4214, CPAN::Meta::Converter version 
2.150005'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -15,7 +17,8 @@
 provides:
   Struct::Dumb:
     file: lib/Struct/Dumb.pm
-    version: '0.08'
+    version: '0.09'
 resources:
   license: http://dev.perl.org/licenses/
-version: '0.08'
+version: '0.09'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/Makefile.PL 
new/Struct-Dumb-0.09/Makefile.PL
--- old/Struct-Dumb-0.08/Makefile.PL    2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/Makefile.PL    2016-03-09 18:51:22.000000000 +0100
@@ -1,13 +1,10 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.4211
+# Note: this file was auto-generated by Module::Build::Compat version 0.4214
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
   'NAME' => 'Struct::Dumb',
   'VERSION_FROM' => 'lib/Struct/Dumb.pm',
-  'PREREQ_PM' => {
-                   'Test::Fatal' => 0,
-                   'Test::More' => '0.88'
-                 },
+  'PREREQ_PM' => {},
   'INSTALLDIRS' => 'site',
   'EXE_FILES' => [],
   'PL_FILES' => {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/README new/Struct-Dumb-0.09/README
--- old/Struct-Dumb-0.08/README 2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/README 2016-03-09 18:51:22.000000000 +0100
@@ -1,71 +1,71 @@
 NAME
-    `Struct::Dumb' - make simple lightweight record-like structures
+
+    Struct::Dumb - make simple lightweight record-like structures
 
 SYNOPSIS
+
      use Struct::Dumb;
- 
+     
      struct Point => [qw( x y )];
-
+    
      my $point = Point(10, 20);
-
+    
      printf "Point is at (%d, %d)\n", $point->x, $point->y;
-
+    
      $point->y = 30;
      printf "Point is now at (%d, %d)\n", $point->x, $point->y;
 
 
-
      struct Point3D => [qw( x y z )], named_constructor => 1;
-
+    
      my $point3d = Point3D( z => 12, x => 100, y => 50 );
-
+    
      printf "Point3d's height is %d\n", $point3d->z;
 
 
-
      struct Point3D => [qw( x y z )], predicate => "is_Point3D";
-
+    
      my $point3d = Point3D( 1, 2, 3 );
-
+    
      printf "This is a Point3D\n" if is_Point3D( $point3d );
 
 
-
      use Struct::Dumb qw( -named_constructors )
-
+    
      struct Point3D => [qw( x y z ];
-
+    
      my $point3d = Point3D( x => 100, z => 12, y => 50 );
 
 DESCRIPTION
-    `Struct::Dumb' creates record-like structure types, similar to the
-    `struct' keyword in C, C++ or C#, or `Record' in Pascal. An invocation
-    of this module will create a construction function which returns new
-    object references with the given field values. These references all
-    respond to lvalue methods that access or modify the values stored.
-
-    It's specifically and intentionally not meant to be an object class. You
-    cannot subclass it. You cannot provide additional methods. You cannot
-    apply roles or mixins or metaclasses or traits or antlers or whatever
-    else is in fashion this week.
+
+    Struct::Dumb creates record-like structure types, similar to the struct
+    keyword in C, C++ or C#, or Record in Pascal. An invocation of this
+    module will create a construction function which returns new object
+    references with the given field values. These references all respond to
+    lvalue methods that access or modify the values stored.
+
+    It's specifically and intentionally not meant to be an object class.
+    You cannot subclass it. You cannot provide additional methods. You
+    cannot apply roles or mixins or metaclasses or traits or antlers or
+    whatever else is in fashion this week.
 
     On the other hand, it is tiny, creates cheap lightweight array-backed
     structures, uses nothing outside of core. It's intended simply to be a
     slightly nicer way to store data structures, where otherwise you might
-    be tempted to abuse a hash, complete with the risk of typoing key names.
-    The constructor will `croak' if passed the wrong number of arguments, as
-    will attempts to refer to fields that don't exist. Accessor-mutators
-    will `croak' if invoked with arguments. (This helps detect likely bugs
-    such as accidentally passing in the new value as an argument, or
-    attempting to invoke a stored `CODE' reference by passing argument
-    values directly to the accessor.)
+    be tempted to abuse a hash, complete with the risk of typoing key
+    names. The constructor will croak if passed the wrong number of
+    arguments, as will attempts to refer to fields that don't exist.
+    Accessor-mutators will croak if invoked with arguments. (This helps
+    detect likely bugs such as accidentally passing in the new value as an
+    argument, or attempting to invoke a stored CODE reference by passing
+    argument values directly to the accessor.)
 
      $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(30)'
      usage: main::Point($x, $y) at -e line 1
-
+    
      $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(10,20)->z'
      main::Point does not have a 'z' field at -e line 1
-
+    
      $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; 
Point(1,2)->x(3)'
      main::Point->x invoked with arguments at -e line 1.
 
@@ -74,21 +74,24 @@
     be relied on by using code. Attempting to dereference the object as an
     ARRAY will throw an exception.
 
-  CONSTRUCTOR FORMS
-    The `struct' and `readonly_struct' declarations create two different
-    kinds of constructor function, depending on the setting of the
-    `named_constructor' option. When false, the constructor takes positional
+ CONSTRUCTOR FORMS
+
+    The struct and readonly_struct declarations create two different kinds
+    of constructor function, depending on the setting of the
+    named_constructor option. When false, the constructor takes positional
     values in the same order as the fields were declared. When true, the
     constructor takes a key/value pair list in no particular order, giving
     the value of each named field.
 
-    This option can be specified to the `struct' and `readonly_struct'
+    This option can be specified to the struct and readonly_struct
     functions. It defaults to false, but it can be set on a per-package
-    basis to default true by supplying the `-named_constructors' option on
-    the `use' statement.
+    basis to default true by supplying the -named_constructors option on
+    the use statement.
 
 FUNCTIONS
-  struct
+
+ struct
+
        struct $name => [ @fieldnames ],
           named_constructor => (1|0),
           predicate         => "is_$name";
@@ -101,29 +104,59 @@
     Takes the following options:
 
     named_constructor => BOOL
-        Determines whether the structure will take positional or named
-        arguments.
+
+      Determines whether the structure will take positional or named
+      arguments.
 
     predicate => STR
-        If defined, gives the name of a second function to export to the
-        caller's namespace. This function will be a type test predicate;
-        that is, a function that takes a single argmuent, and returns true
-        if-and-only-if that argument is an instance of this structure type.
 
-  readonly_struct
+      If defined, gives the name of a second function to export to the
+      caller's namespace. This function will be a type test predicate; that
+      is, a function that takes a single argmuent, and returns true
+      if-and-only-if that argument is an instance of this structure type.
+
+ readonly_struct
+
        readonly_struct $name => [ @fieldnames ],
           ...
 
-    Similar to struct, but instances of this type are immutable once
+    Similar to "struct", but instances of this type are immutable once
     constructed. The field accessor methods will not be marked with the
-    `:lvalue' attribute.
+    :lvalue attribute.
+
+    Takes the same options as "struct".
+
+NOTES
 
-    Takes the same options as struct.
+ Allowing ARRAY dereference
+
+    The way that forbidding access to instances as if they were ARRAY
+    references is currently implemented uses an internal method on the
+    generated structure class called _forbid_arrayification. If special
+    circumstances require that this exception mechanism be bypassed, the
+    method can be overloaded with an empty sub {} body, allowing the struct
+    instances in that class to be accessed like normal ARRAY references.
+    For good practice this should be limited by a local override.
+
+    For example, Devel::Cycle needs to access the instances as plain ARRAY
+    references so it can walk the data structure looking for reference
+    cycles.
+
+     use Devel::Cycle;
+    
+     {
+        no warnings 'redefine';
+        local *Point::_forbid_arrayification = sub {};
+    
+        memory_cycle_ok( $point );
+     }
 
 TODO
-    *   Consider adding an `coerce_hash' option, giving name of another
-        function to convert structs to key/value pairs, or a HASH ref.
+
+      * Consider adding an coerce_hash option, giving name of another
+      function to convert structs to key/value pairs, or a HASH ref.
 
 AUTHOR
+
     Paul Evans <leon...@leonerd.org.uk>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/lib/Struct/Dumb.pm 
new/Struct-Dumb-0.09/lib/Struct/Dumb.pm
--- old/Struct-Dumb-0.08/lib/Struct/Dumb.pm     2015-12-15 18:51:16.000000000 
+0100
+++ new/Struct-Dumb-0.09/lib/Struct/Dumb.pm     2016-03-09 18:51:22.000000000 
+0100
@@ -1,14 +1,14 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2012-2015 -- leon...@leonerd.org.uk
+#  (C) Paul Evans, 2012-2016 -- leon...@leonerd.org.uk
 
 package Struct::Dumb;
 
 use strict;
 use warnings;
 
-our $VERSION = '0.08';
+our $VERSION = '0.09';
 
 use Carp;
 
@@ -220,10 +220,14 @@
       *{"${caller}::$predicate"} = sub { ( ref($_[0]) || "" ) eq $pkg };
    }
 
+   *{"${pkg}::_forbid_arrayification"} = sub {
+      return if !HAVE_OVERLOADING and caller eq __PACKAGE__;
+      croak "Cannot use $pkg as an ARRAY reference"
+   };
+
    require overload;
    $pkg->overload::OVERLOAD(
-      '@{}'  => sub { return $_[0] if !HAVE_OVERLOADING and caller eq 
__PACKAGE__;
-                      croak "Cannot use $pkg as an ARRAY reference" },
+      '@{}'  => sub { $_[0]->_forbid_arrayification; return $_[0] },
       '0+'   => sub { refaddr $_[0] },
       '""'   => sub { sprintf "%s=Struct::Dumb(%#x)", $pkg, refaddr $_[0] },
       'bool' => sub { 1 },
@@ -274,6 +278,30 @@
 
 =cut
 
+=head1 NOTES
+
+=head2 Allowing ARRAY dereference
+
+The way that forbidding access to instances as if they were ARRAY references
+is currently implemented uses an internal method on the generated structure
+class called C<_forbid_arrayification>. If special circumstances require that
+this exception mechanism be bypassed, the method can be overloaded with an
+empty C<sub {}> body, allowing the struct instances in that class to be
+accessed like normal ARRAY references. For good practice this should be
+limited by a C<local> override.
+
+For example, L<Devel::Cycle> needs to access the instances as plain ARRAY
+references so it can walk the data structure looking for reference cycles.
+
+ use Devel::Cycle;
+
+ {
+    no warnings 'redefine';
+    local *Point::_forbid_arrayification = sub {};
+
+    memory_cycle_ok( $point );
+ }
+
 =head1 TODO
 
 =over 4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.08/t/01point.t 
new/Struct-Dumb-0.09/t/01point.t
--- old/Struct-Dumb-0.08/t/01point.t    2015-12-15 18:51:16.000000000 +0100
+++ new/Struct-Dumb-0.09/t/01point.t    2016-03-09 18:51:22.000000000 +0100
@@ -38,6 +38,14 @@
       qr/^Cannot use main::Point as an ARRAY reference at \S+ line \d+\.?\n/,
       'Array deref throws exception' );
 
+ok( !( local $@ = exception {
+      no warnings 'redefine';
+      local *Point::_forbid_arrayification = sub {};
+      @{ Point(2, 2) };
+   } ),
+   'Array deref succeeds with locally-overridden forbid function' ) or
+   diag( "Exception was $@" );
+
 like( exception { $point->x(50) },
       qr/^main::Point->x invoked with arguments at \S+ line \d+\.?\n/,
       'Accessor with arguments throws exception' );


Reply via email to