Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-MooX-Attribute-ENV for 
openSUSE:Factory checked in at 2021-10-12 21:49:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-MooX-Attribute-ENV (Old)
 and      /work/SRC/openSUSE:Factory/.perl-MooX-Attribute-ENV.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-MooX-Attribute-ENV"

Tue Oct 12 21:49:45 2021 rev:2 rq:924831 version:0.04

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-MooX-Attribute-ENV/perl-MooX-Attribute-ENV.changes
  2020-10-02 17:34:18.458631435 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-MooX-Attribute-ENV.new.2443/perl-MooX-Attribute-ENV.changes
        2021-10-12 21:51:08.136024806 +0200
@@ -1,0 +2,12 @@
+Mon Oct  4 03:09:34 UTC 2021 - Tina M??ller <timueller+p...@suse.de>
+
+- updated to 0.04
+   see /usr/share/doc/packages/perl-MooX-Attribute-ENV/Changes
+
+  0.04 2021-10-03
+  - build fixes
+
+  0.03 2021-10-03
+  - add ability to search multiple keys - thanks @vanHoesel
+
+-------------------------------------------------------------------

Old:
----
  MooX-Attribute-ENV-0.02.tar.gz

New:
----
  MooX-Attribute-ENV-0.04.tar.gz
  cpanspec.yml

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

Other differences:
------------------
++++++ perl-MooX-Attribute-ENV.spec ++++++
--- /var/tmp/diff_new_pack.cSrYAN/_old  2021-10-12 21:51:08.720025642 +0200
+++ /var/tmp/diff_new_pack.cSrYAN/_new  2021-10-12 21:51:08.724025648 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-MooX-Attribute-ENV
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,30 +16,28 @@
 #
 
 
+%define cpan_name MooX-Attribute-ENV
 Name:           perl-MooX-Attribute-ENV
-Version:        0.02
+Version:        0.04
 Release:        0
-%define cpan_name MooX-Attribute-ENV
 Summary:        Allow Moo attributes to get their values from %ENV
 License:        Artistic-2.0
-Group:          Development/Libraries/Perl
-Url:            https://metacpan.org/release/%{cpan_name}
+URL:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/E/ET/ETJ/%{cpan_name}-%{version}.tar.gz
+Source1:        cpanspec.yml
 BuildArch:      noarch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
 BuildRequires:  perl(Moo)
-BuildRequires:  perl(Test::Exception) >= 0.420000
 BuildRequires:  perl(Test::More) >= 0.88
 Requires:       perl(Moo)
 %{perl_requires}
 
 %description
 This is a Moo extension. It allows other attributes for Moo/has. If any of
-these are given, then instead of the normal value-setting "chain" for
-attributes of given, default; the chain will be given, environment,
-default.
+these are given, then Moo/BUILDARGS is wrapped so that values for object
+attributes can, if not supplied in the normal construction process, come
+from the environment.
 
 The environment will be searched for either the given case, or upper case,
 version of the names discussed below.
@@ -48,11 +46,11 @@
 with a '_' in between.
 
 %prep
-%setup -q -n %{cpan_name}-%{version}
+%autosetup  -n %{cpan_name}-%{version}
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor
-make %{?_smp_mflags}
+%make_build
 
 %check
 make test
@@ -63,7 +61,6 @@
 %perl_gen_filelist
 
 %files -f %{name}.files
-%defattr(-,root,root,755)
 %doc Changes README.md
 
 %changelog

++++++ MooX-Attribute-ENV-0.02.tar.gz -> MooX-Attribute-ENV-0.04.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/Changes 
new/MooX-Attribute-ENV-0.04/Changes
--- old/MooX-Attribute-ENV-0.02/Changes 2019-03-15 05:25:27.000000000 +0100
+++ new/MooX-Attribute-ENV-0.04/Changes 2021-10-03 18:20:33.000000000 +0200
@@ -1,3 +1,9 @@
+0.04 2021-10-03
+- build fixes
+
+0.03 2021-10-03
+- add ability to search multiple keys - thanks @vanHoesel
+
 0.02 2019-03-15
  - partition out ENV-related attribute keys so Moose not blow up
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/MANIFEST 
new/MooX-Attribute-ENV-0.04/MANIFEST
--- old/MooX-Attribute-ENV-0.02/MANIFEST        2019-03-15 05:26:05.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/MANIFEST        2021-10-03 18:21:09.000000000 
+0200
@@ -5,6 +5,7 @@
 MANIFEST.SKIP
 README.md
 t/basic.t
+t/multi_key.t
 xt/manifest.t
 xt/pod-coverage.t
 xt/pod.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/META.json 
new/MooX-Attribute-ENV-0.04/META.json
--- old/MooX-Attribute-ENV-0.02/META.json       2019-03-15 05:26:05.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/META.json       2021-10-03 18:21:09.000000000 
+0200
@@ -4,7 +4,7 @@
       "Ed J <e...@cpan.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "artistic_2"
    ],
@@ -45,13 +45,15 @@
       },
       "test" : {
          "requires" : {
-            "Test::Exception" : "0.42",
             "Test::More" : "0.88"
          }
       }
    },
    "release_status" : "stable",
    "resources" : {
+      "bugtracker" : {
+         "web" : "https://github.com/mohawk2/moox-attribute-env/issues";
+      },
       "license" : [
          "http://dev.perl.org/licenses/";
       ],
@@ -61,6 +63,6 @@
       },
       "x_IRC" : "irc://irc.perl.org/#moose"
    },
-   "version" : "0.02",
-   "x_serialization_backend" : "JSON::PP version 4.00"
+   "version" : "0.04",
+   "x_serialization_backend" : "JSON::PP version 4.04"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/META.yml 
new/MooX-Attribute-ENV-0.04/META.yml
--- old/MooX-Attribute-ENV-0.02/META.yml        2019-03-15 05:26:05.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/META.yml        2021-10-03 18:21:09.000000000 
+0200
@@ -4,12 +4,11 @@
   - 'Ed J <e...@cpan.org>'
 build_requires:
   ExtUtils::MakeMaker: '0'
-  Test::Exception: '0.42'
   Test::More: '0.88'
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 
2.150010'
 license: artistic_2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,7 +23,8 @@
   perl: '5.008'
 resources:
   IRC: irc://irc.perl.org/#moose
+  bugtracker: https://github.com/mohawk2/moox-attribute-env/issues
   license: http://dev.perl.org/licenses/
   repository: https://github.com/mohawk2/moox-attribute-env
-version: '0.02'
+version: '0.04'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/Makefile.PL 
new/MooX-Attribute-ENV-0.04/Makefile.PL
--- old/MooX-Attribute-ENV-0.02/Makefile.PL     2019-03-15 03:29:46.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/Makefile.PL     2021-10-03 18:19:30.000000000 
+0200
@@ -14,7 +14,6 @@
   },
   TEST_REQUIRES => {
     'Test::More' => '0.88', # done_testing
-    'Test::Exception' => '0.42',
   },
   PREREQ_PM => {
     'Moo' => '0',
@@ -30,6 +29,9 @@
         url => 'g...@github.com:mohawk2/moox-attribute-env.git',
         web => 'https://github.com/mohawk2/moox-attribute-env',
       },
+      bugtracker  => {
+        web => 'https://github.com/mohawk2/moox-attribute-env/issues',
+      },
       license => [ 'http://dev.perl.org/licenses/' ],
     },
     prereqs => {
@@ -45,7 +47,7 @@
 );
 
 sub MY::postamble {
-  <<EOF;
+  -d '.git' ? <<EOF : '';
 pure_all :: README.md
 
 README.md : \$(VERSION_FROM)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/README.md 
new/MooX-Attribute-ENV-0.04/README.md
--- old/MooX-Attribute-ENV-0.02/README.md       2019-03-15 05:25:59.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/README.md       2021-10-03 18:17:52.000000000 
+0200
@@ -20,6 +20,11 @@
       is => 'ro',
       env_key => 'attr_val',
     );
+    # look for $ENV{attr_val} and $ENV{next_val}, in that order
+    has some => (
+      is => 'ro',
+      env_key => [ 'attr_val', 'next_val' ],
+    );
     # looks for $ENV{otherattr} and $ENV{OTHERATTR}, then any default
     has otherattr => (
       is => 'ro',
@@ -47,9 +52,9 @@
 # DESCRIPTION
 
 This is a [Moo](https://metacpan.org/pod/Moo) extension. It allows other 
attributes for ["has" in Moo](https://metacpan.org/pod/Moo#has). If
-any of these are given, then instead of the normal value-setting "chain"
-for attributes of given, default; the chain will be given, environment,
-default.
+any of these are given, then ["BUILDARGS" in 
Moo](https://metacpan.org/pod/Moo#BUILDARGS) is wrapped so that values
+for object attributes can, if not supplied in the normal construction
+process, come from the environment.
 
 The environment will be searched for either the given case, or upper case,
 version of the names discussed below.
@@ -67,6 +72,10 @@
 
 String. If true, the name is the given value, no prefix.
 
+or
+
+ArrayRef. A list of names that will be checked in given order.
+
 ## env\_prefix
 
 String. The prefix is the given value.
@@ -78,7 +87,7 @@
 
 # AUTHOR
 
-Ed J, porting John Napiorkowski's excellent 
[MooseX::Attribute::ENV](https://metacpan.org/pod/MooseX::Attribute::ENV).
+Ed J, porting John Napiorkowski's excellent 
[MooseX::Attribute::ENV](https://metacpan.org/pod/MooseX%3A%3AAttribute%3A%3AENV).
 
 # LICENCE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/lib/MooX/Attribute/ENV.pm 
new/MooX-Attribute-ENV-0.04/lib/MooX/Attribute/ENV.pm
--- old/MooX-Attribute-ENV-0.02/lib/MooX/Attribute/ENV.pm       2019-03-15 
05:25:13.000000000 +0100
+++ new/MooX-Attribute-ENV-0.04/lib/MooX/Attribute/ENV.pm       2021-10-03 
18:20:27.000000000 +0200
@@ -1,6 +1,6 @@
 package MooX::Attribute::ENV;
 
-our $VERSION = '0.02';
+our $VERSION = '0.04';
 
 # this bit would be MooX::Utils but without initial _ on func name
 use strict;
@@ -44,9 +44,11 @@
 }
 
 sub _lookup_env {
-  my ($envkey) = @_;
-  return $ENV{$envkey} if exists $ENV{$envkey};
-  return $ENV{uc $envkey} if exists $ENV{uc $envkey};
+  my @env_keys = ref $_[0] eq 'ARRAY' ? @{ $_[0] } : $_[0];
+  foreach my $envkey ( @env_keys ) {
+      return $ENV{$envkey} if exists $ENV{$envkey};
+      return $ENV{uc $envkey} if exists $ENV{uc $envkey};
+  }
   undef;
 }
 
@@ -67,7 +69,7 @@
     $target =~ s/:+/_/g;
     return "${target}_$attr";
   }
-  undef;
+  undef; # uncoverable statement
 }
 
 =head1 NAME
@@ -96,6 +98,11 @@
     is => 'ro',
     env_key => 'attr_val',
   );
+  # look for $ENV{attr_val} and $ENV{next_val}, in that order
+  has some => (
+    is => 'ro',
+    env_key => [ 'attr_val', 'next_val' ],
+  );
   # looks for $ENV{otherattr} and $ENV{OTHERATTR}, then any default
   has otherattr => (
     is => 'ro',
@@ -123,9 +130,9 @@
 =head1 DESCRIPTION
 
 This is a L<Moo> extension. It allows other attributes for L<Moo/has>. If
-any of these are given, then instead of the normal value-setting "chain"
-for attributes of given, default; the chain will be given, environment,
-default.
+any of these are given, then L<Moo/BUILDARGS> is wrapped so that values
+for object attributes can, if not supplied in the normal construction
+process, come from the environment.
 
 The environment will be searched for either the given case, or upper case,
 version of the names discussed below.
@@ -143,6 +150,10 @@
 
 String. If true, the name is the given value, no prefix.
 
+or
+
+ArrayRef. A list of names that will be checked in given order.
+
 =head2 env_prefix
 
 String. The prefix is the given value.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/t/basic.t 
new/MooX-Attribute-ENV-0.04/t/basic.t
--- old/MooX-Attribute-ENV-0.02/t/basic.t       2019-03-15 04:54:16.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/t/basic.t       2019-03-21 19:56:14.000000000 
+0100
@@ -30,6 +30,10 @@
   is => 'ro',
   env_package_prefix => 1,
 );
+# non-env to exercise handling of that
+has nonenvattr => (
+  is => 'ro',
+);
 
 package main;
 
@@ -58,7 +62,7 @@
 test_with_env(packageattr => { MYMOD_PACKAGEATTR => 6 }, 6);
 test_with_env(packageattr => { MyMod_packageattr => 6 }, 6);
 
-my $obj = MyMod->new;
+my $obj = MyMod->new({});
 is $obj->has_attr, !1, 'if no env set or value given, predicate false';
 
 done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MooX-Attribute-ENV-0.02/t/multi_key.t 
new/MooX-Attribute-ENV-0.04/t/multi_key.t
--- old/MooX-Attribute-ENV-0.02/t/multi_key.t   1970-01-01 01:00:00.000000000 
+0100
+++ new/MooX-Attribute-ENV-0.04/t/multi_key.t   2021-10-03 18:14:15.000000000 
+0200
@@ -0,0 +1,32 @@
+use Test::More;
+
+package MyMod;
+use Moo;
+use MooX::Attribute::ENV;
+# look for $ENV{attr_val} and $ENV{ATTR_VAL}
+has attr => (
+  is => 'ro',
+  env_key => [ 'attr_val', 'next_val' ],
+);
+# looks for $ENV{otherattr} and $ENV{OTHERATTR}, then any default
+
+package main;
+
+sub test_with_env {
+  my ($attr, $env, $expected) = @_;
+  local %ENV = (%ENV, %$env);
+  my $obj = MyMod->new;
+  local $Test::Builder::Level = $Test::Builder::Level + 1;
+  is $obj->$attr, $expected, "$attr from ENV(@{[ keys %$env ]})";
+}
+
+test_with_env(attr => { ATTR_VAL => 1 }, 1);
+test_with_env(attr => { attr_val => 2 }, 2);
+
+test_with_env(attr => { ATTR_VAL => 1, NEXT_VAL => 3 }, 1);
+test_with_env(attr => { attr_val => 2, next_val => 4 }, 2);
+
+test_with_env(attr => { NEXT_VAL => 3 }, 3);
+test_with_env(attr => { next_val => 4 }, 4);
+
+done_testing;

++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#description: |-
#  override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
#  - source1
#  - source2
#patches:
#  foo.patch: -p1
#  bar.patch:
#  baz.patch: PATCH-FIX-OPENSUSE
#preamble: |-
# BuildRequires:  gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s,  *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL 
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module
#skip_doc: regexp_to_skip_for_doc.*
#add_doc: files to add to docs
#misc: |-
#anything else to be added to spec file
#follows directly after %files section, so it can contain new blocks or also
#changes to %files section

Reply via email to