Hello community,

here is the log from the commit of package perl-Module-CPANfile for 
openSUSE:Factory checked in at 2018-04-26 13:37:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Module-CPANfile (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Module-CPANfile.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Module-CPANfile"

Thu Apr 26 13:37:45 2018 rev:6 rq:599885 version:1.1003

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Module-CPANfile/perl-Module-CPANfile.changes    
    2016-02-17 12:20:08.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Module-CPANfile.new/perl-Module-CPANfile.changes
   2018-04-26 13:37:52.672417719 +0200
@@ -1,0 +2,6 @@
+Mon Apr 23 05:40:57 UTC 2018 - [email protected]
+
+- updated to 1.1003
+   see /usr/share/doc/packages/perl-Module-CPANfile/Changes
+
+-------------------------------------------------------------------

Old:
----
  Module-CPANfile-1.1002.tar.gz

New:
----
  Module-CPANfile-1.1003.tar.gz

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

Other differences:
------------------
++++++ perl-Module-CPANfile.spec ++++++
--- /var/tmp/diff_new_pack.VScTmJ/_old  2018-04-26 13:37:53.416390451 +0200
+++ /var/tmp/diff_new_pack.VScTmJ/_new  2018-04-26 13:37:53.416390451 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Module-CPANfile
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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,14 +17,14 @@
 
 
 Name:           perl-Module-CPANfile
-Version:        1.1002
+Version:        1.1003
 Release:        0
 %define cpan_name Module-CPANfile
 Summary:        Parse cpanfile
-License:        Artistic-1.0 or GPL-1.0+
+License:        Artistic-1.0 OR GPL-1.0-or-later
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/Module-CPANfile/
-Source0:        
http://www.cpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz
+Source0:        
https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -32,12 +32,11 @@
 BuildRequires:  perl-macros
 BuildRequires:  perl(CPAN::Meta) >= 2.12091
 BuildRequires:  perl(CPAN::Meta::Prereqs) >= 2.12091
-BuildRequires:  perl(JSON::PP) >= 2.27300
+BuildRequires:  perl(File::pushd)
 BuildRequires:  perl(Test::More) >= 0.88
 BuildRequires:  perl(parent)
 Requires:       perl(CPAN::Meta) >= 2.12091
 Requires:       perl(CPAN::Meta::Prereqs) >= 2.12091
-Requires:       perl(JSON::PP) >= 2.27300
 Requires:       perl(parent)
 %{perl_requires}
 
@@ -63,6 +62,7 @@
 
 %files -f %{name}.files
 %defattr(-,root,root,755)
-%doc Changes LICENSE README
+%doc Changes README
+%license LICENSE
 
 %changelog

++++++ Module-CPANfile-1.1002.tar.gz -> Module-CPANfile-1.1003.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/Changes 
new/Module-CPANfile-1.1003/Changes
--- old/Module-CPANfile-1.1002/Changes  2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/Changes  2018-04-22 01:54:49.000000000 +0200
@@ -1,5 +1,10 @@
 Revision history for Module::Install::CPANfile
 
+1.1003  2018-04-22 01:54:46 CEST
+        - Make options written back with save()
+        - Documented options_for_module method
+        - Internal refactoring
+
 1.1002  2016-02-12 08:23:00 PST
         - Make it work under the taint mode (-T) #41
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/LICENSE 
new/Module-CPANfile-1.1003/LICENSE
--- old/Module-CPANfile-1.1002/LICENSE  2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/LICENSE  2018-04-22 01:54:49.000000000 +0200
@@ -1,4 +1,4 @@
-This software is copyright (c) 2016 by Tatsuhiko Miyagawa.
+This software is copyright (c) 2018 by Tatsuhiko Miyagawa.
 
 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) 2016 by Tatsuhiko Miyagawa.
+This software is Copyright (c) 2018 by Tatsuhiko Miyagawa.
 
 This is free software, licensed under:
 
@@ -272,7 +272,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2016 by Tatsuhiko Miyagawa.
+This software is Copyright (c) 2018 by Tatsuhiko Miyagawa.
 
 This is free software, licensed under:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/MANIFEST 
new/Module-CPANfile-1.1003/MANIFEST
--- old/Module-CPANfile-1.1002/MANIFEST 2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/MANIFEST 2018-04-22 01:54:49.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v5.043.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v6.009.
 Changes
 LICENSE
 MANIFEST
@@ -23,5 +23,6 @@
 t/from_prereqs.t
 t/merge.t
 t/mirror.t
+t/options.t
 t/parse.t
 t/requirement.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/META.json 
new/Module-CPANfile-1.1003/META.json
--- old/Module-CPANfile-1.1002/META.json        2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/META.json        2018-04-22 01:54:49.000000000 
+0200
@@ -4,7 +4,7 @@
       "Tatsuhiko Miyagawa"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 5.043, Dist::Milla version v1.0.15, 
CPAN::Meta::Converter version 2.150005",
+   "generated_by" : "Dist::Milla version v1.0.18, Dist::Zilla version 6.009, 
CPAN::Meta::Converter version 2.150010",
    "license" : [
       "perl_5"
    ],
@@ -27,11 +27,14 @@
       "configure" : {
          "requires" : {
             "ExtUtils::MakeMaker" : "0"
+         },
+         "suggests" : {
+            "JSON::PP" : "2.27300"
          }
       },
       "develop" : {
          "requires" : {
-            "Dist::Milla" : "v1.0.15",
+            "Dist::Milla" : "v1.0.18",
             "Test::Pod" : "1.41"
          }
       },
@@ -42,12 +45,12 @@
          "requires" : {
             "CPAN::Meta" : "2.12091",
             "CPAN::Meta::Prereqs" : "2.12091",
-            "JSON::PP" : "2.27300",
             "parent" : "0"
          }
       },
       "test" : {
          "requires" : {
+            "File::pushd" : "0",
             "Test::More" : "0.88"
          }
       }
@@ -64,7 +67,7 @@
          "web" : "https://github.com/miyagawa/cpanfile";
       }
    },
-   "version" : "1.1002",
+   "version" : "1.1003",
    "x_contributors" : [
       "Atsushi Kato <[email protected]>",
       "David Golden <[email protected]>",
@@ -76,8 +79,10 @@
       "Kenichi Ishigaki <[email protected]>",
       "Masahiro Honma <[email protected]>",
       "Michiel Beijen <[email protected]>",
-      "Olivier MenguĂ© <[email protected]>",
-      "Tatsuhiko Miyagawa <[email protected]>"
-   ]
+      "Olivier Mengu\u00e9 <[email protected]>",
+      "Tatsuhiko Miyagawa <[email protected]>",
+      "Tatsuhiko Miyagawa <[email protected]>"
+   ],
+   "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233"
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/META.yml 
new/Module-CPANfile-1.1003/META.yml
--- old/Module-CPANfile-1.1002/META.yml 2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/META.yml 2018-04-22 01:54:49.000000000 +0200
@@ -3,11 +3,12 @@
 author:
   - 'Tatsuhiko Miyagawa'
 build_requires:
+  File::pushd: '0'
   Test::More: '0.88'
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.043, Dist::Milla version v1.0.15, 
CPAN::Meta::Converter version 2.150005'
+generated_by: 'Dist::Milla version v1.0.18, Dist::Zilla version 6.009, 
CPAN::Meta::Converter version 2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,13 +27,12 @@
 requires:
   CPAN::Meta: '2.12091'
   CPAN::Meta::Prereqs: '2.12091'
-  JSON::PP: '2.27300'
   parent: '0'
 resources:
   bugtracker: https://github.com/miyagawa/cpanfile/issues
   homepage: https://github.com/miyagawa/cpanfile
   repository: https://github.com/miyagawa/cpanfile.git
-version: '1.1002'
+version: '1.1003'
 x_contributors:
   - 'Atsushi Kato <[email protected]>'
   - 'David Golden <[email protected]>'
@@ -46,3 +46,5 @@
   - 'Michiel Beijen <[email protected]>'
   - 'Olivier MenguĂ© <[email protected]>'
   - 'Tatsuhiko Miyagawa <[email protected]>'
+  - 'Tatsuhiko Miyagawa <[email protected]>'
+x_serialization_backend: 'YAML::Tiny version 1.70'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/Makefile.PL 
new/Module-CPANfile-1.1003/Makefile.PL
--- old/Module-CPANfile-1.1002/Makefile.PL      2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/Makefile.PL      2018-04-22 01:54:49.000000000 
+0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v5.043.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v6.009.
 use strict;
 use warnings;
 
@@ -22,13 +22,13 @@
   "PREREQ_PM" => {
     "CPAN::Meta" => "2.12091",
     "CPAN::Meta::Prereqs" => "2.12091",
-    "JSON::PP" => "2.27300",
     "parent" => 0
   },
   "TEST_REQUIRES" => {
+    "File::pushd" => 0,
     "Test::More" => "0.88"
   },
-  "VERSION" => "1.1002",
+  "VERSION" => "1.1003",
   "test" => {
     "TESTS" => "t/*.t"
   }
@@ -38,7 +38,7 @@
 my %FallbackPrereqs = (
   "CPAN::Meta" => "2.12091",
   "CPAN::Meta::Prereqs" => "2.12091",
-  "JSON::PP" => "2.27300",
+  "File::pushd" => 0,
   "Test::More" => "0.88",
   "parent" => 0
 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/README 
new/Module-CPANfile-1.1003/README
--- old/Module-CPANfile-1.1002/README   2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/README   2018-04-22 01:54:49.000000000 +0200
@@ -106,6 +106,25 @@
       version in the second argument, which defaults to 1.4 in case the
       given file is YAML, and 2 if it is JSON.
 
+    options_for_module
+
+        my $options = $file->options_for_module($module);
+
+      Returns the extra options specified for a given module as a hash
+      reference. Returns undef when the given module is not specified in
+      the cpanfile.
+
+      For example,
+
+        # cpanfile
+        requires 'Plack', '1.000',
+          dist => "MIYAGAWA/Plack-1.000.tar.gz";
+      
+        # ...
+        my $file = Module::CPANfile->load;
+        my $options = $file->options_for_module('Plack');
+        # => { dist => "MIYAGAWA/Plack-1.000.tar.gz" }
+
 AUTHOR
 
     Tatsuhiko Miyagawa
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/cpanfile 
new/Module-CPANfile-1.1003/cpanfile
--- old/Module-CPANfile-1.1002/cpanfile 2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/cpanfile 2018-04-22 01:54:49.000000000 +0200
@@ -6,4 +6,5 @@
 
 on test => sub {
     requires 'Test::More', 0.88;
+    requires 'File::pushd';
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Module-CPANfile-1.1002/lib/Module/CPANfile/Environment.pm 
new/Module-CPANfile-1.1003/lib/Module/CPANfile/Environment.pm
--- old/Module-CPANfile-1.1002/lib/Module/CPANfile/Environment.pm       
2016-02-12 17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/lib/Module/CPANfile/Environment.pm       
2018-04-22 01:54:49.000000000 +0200
@@ -138,7 +138,7 @@
 sub add_prereq {
     my($self, $type, $module, @args) = @_;
 
-    $self->prereqs->add_prereq(
+    $self->prereqs->add(
         feature => $self->{feature},
         phase   => $self->{phase},
         type    => $type,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/lib/Module/CPANfile/Prereq.pm 
new/Module-CPANfile-1.1003/lib/Module/CPANfile/Prereq.pm
--- old/Module-CPANfile-1.1002/lib/Module/CPANfile/Prereq.pm    2016-02-12 
17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/lib/Module/CPANfile/Prereq.pm    2018-04-22 
01:54:49.000000000 +0200
@@ -12,10 +12,4 @@
 sub module  { $_[0]->{module} }
 sub requirement { $_[0]->{requirement} }
 
-sub match_feature {
-    my($self, $identifier) = @_;
-    no warnings 'uninitialized';
-    $self->feature eq $identifier;
-}
-
 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Module-CPANfile-1.1002/lib/Module/CPANfile/Prereqs.pm 
new/Module-CPANfile-1.1003/lib/Module/CPANfile/Prereqs.pm
--- old/Module-CPANfile-1.1002/lib/Module/CPANfile/Prereqs.pm   2016-02-12 
17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/lib/Module/CPANfile/Prereqs.pm   2018-04-22 
01:54:49.000000000 +0200
@@ -12,7 +12,7 @@
     for my $phase (keys %$prereqs) {
         for my $type (keys %{ $prereqs->{$phase} }) {
             while (my($module, $requirement) = each %{ 
$prereqs->{$phase}{$type} }) {
-                $self->add_prereq(
+                $self->add(
                     phase => $phase,
                     type  => $type,
                     module => $module,
@@ -28,7 +28,7 @@
 sub new {
     my $class = shift;
     bless {
-        prereqs => [],
+        prereqs => {},
         features => {},
     }, $class;
 }
@@ -38,14 +38,12 @@
     $self->{features}{$identifier} = { description => $description };
 }
 
-sub add_prereq {
+sub add {
     my($self, %args) = @_;
-    $self->add( Module::CPANfile::Prereq->new(%args) );
-}
 
-sub add {
-    my($self, $prereq) = @_;
-    push @{$self->{prereqs}}, $prereq;
+    my $feature = $args{feature} || '';
+    push @{$self->{prereqs}{$feature}},
+      Module::CPANfile::Prereq->new(%args);
 }
 
 sub as_cpan_meta {
@@ -54,24 +52,25 @@
 }
 
 sub build_cpan_meta {
-    my($self, $identifier) = @_;
+    my($self, $feature) = @_;
+    CPAN::Meta::Prereqs->new($self->specs($feature));
+}
 
-    my $prereq_spec = {};
-    $self->prereq_each($identifier, sub {
-        my $prereq = shift;
-        $prereq_spec->{$prereq->phase}{$prereq->type}{$prereq->module} = 
$prereq->requirement->version;
-    });
+sub specs {
+    my($self, $feature) = @_;
 
-    CPAN::Meta::Prereqs->new($prereq_spec);
-}
+    $feature = ''
+      unless defined $feature;
 
-sub prereq_each {
-    my($self, $identifier, $code) = @_;
+    my $prereqs = $self->{prereqs}{$feature} || [];
+    my $specs = {};
 
-    for my $prereq (@{$self->{prereqs}}) {
-        next unless $prereq->match_feature($identifier);
-        $code->($prereq);
+    for my $prereq (@$prereqs) {
+         $specs->{$prereq->phase}{$prereq->type}{$prereq->module} =
+           $prereq->requirement->version;
     }
+
+    return $specs;
 }
 
 sub merged_requirements {
@@ -88,8 +87,10 @@
 sub find {
     my($self, $module) = @_;
 
-    for my $prereq (@{$self->{prereqs}}) {
-        return $prereq if $prereq->module eq $module;
+    for my $feature ('', keys %{$self->{features}}) {
+        for my $prereq (@{$self->{prereqs}{$feature}}) {
+            return $prereq if $prereq->module eq $module;
+        }
     }
 
     return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/lib/Module/CPANfile.pm 
new/Module-CPANfile-1.1003/lib/Module/CPANfile.pm
--- old/Module-CPANfile-1.1002/lib/Module/CPANfile.pm   2016-02-12 
17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/lib/Module/CPANfile.pm   2018-04-22 
01:54:49.000000000 +0200
@@ -6,7 +6,7 @@
 use Module::CPANfile::Environment;
 use Module::CPANfile::Requirement;
 
-our $VERSION = '1.1002';
+our $VERSION = '1.1003';
 
 BEGIN {
     if (${^TAINT}) {
@@ -101,10 +101,8 @@
 sub prereqs_with {
     my($self, @feature_identifiers) = @_;
 
-    my $prereqs = $self->prereqs;
     my @others = map { $self->feature($_)->prereqs } @feature_identifiers;
-
-    $prereqs->with_merged_prereqs(\@others);
+    $self->prereqs->with_merged_prereqs(\@others);
 }
 
 sub prereq_specs {
@@ -139,10 +137,9 @@
     CPAN::Meta->new($struct)->save($file, { version => $version });
 }
 
-sub _dump {
-    my $str = shift;
+sub _d($) {
     require Data::Dumper;
-    chomp(my $value = Data::Dumper->new([$str])->Terse(1)->Dump);
+    chomp(my $value = Data::Dumper->new([$_[0]])->Terse(1)->Dump);
     $value;
 }
 
@@ -162,9 +159,9 @@
     $code .= $self->_dump_prereqs($prereqs, $include_empty);
 
     for my $feature ($self->features) {
-        $code .= sprintf "feature %s, %s => sub {\n", 
_dump($feature->{identifier}), _dump($feature->{description});
+        $code .= "feature @{[ _d $feature->{identifier} ]}, @{[ _d 
$feature->{description} ]} => sub {\n";
         $code .= $self->_dump_prereqs($feature->{spec}, $include_empty, 4);
-        $code .= "}\n\n";
+        $code .= "};\n\n";
     }
 
     $code =~ s/\n+$/\n/s;
@@ -177,7 +174,7 @@
     my $code = "";
 
     for my $url (@$mirrors) {
-        $code .= "mirror '$url';\n";
+        $code .= "mirror @{[ _d $url ]};\n";
     }
 
     $code =~ s/\n+$/\n/s;
@@ -190,7 +187,7 @@
     my $code = '';
     for my $phase (qw(runtime configure build test develop)) {
         my $indent = $phase eq 'runtime' ? '' : '    ';
-        $indent = (' ' x ($base_indent || 0)) . $indent;
+        $indent .= (' ' x ($base_indent || 0));
 
         my($phase_code, $requirements);
         $phase_code .= "on $phase => sub {\n" unless $phase eq 'runtime';
@@ -199,8 +196,21 @@
             for my $mod (sort keys %{$prereqs->{$phase}{$type}}) {
                 my $ver = $prereqs->{$phase}{$type}{$mod};
                 $phase_code .= $ver eq '0'
-                             ? "${indent}$type '$mod';\n"
-                             : "${indent}$type '$mod', '$ver';\n";
+                             ? "${indent}$type @{[ _d $mod ]}"
+                             : "${indent}$type @{[ _d $mod ]}, @{[ _d $ver ]}";
+
+                my $options = $self->options_for_module($mod) || {};
+                if (%$options) {
+                    my @opts;
+                    for my $key (keys %$options) {
+                        my $k = $key =~ /^[a-zA-Z0-9_]+$/ ? $key : _d $key;
+                        push @opts, "$k => @{[ _d $options->{$k} ]}";
+                    }
+
+                    $phase_code .= ",\n" . join(",\n", map "  $indent$_", 
@opts);
+                }
+
+                $phase_code .= ";\n";
                 $requirements++;
             }
         }
@@ -329,6 +339,25 @@
 version in the second argument, which defaults to 1.4 in case the
 given file is YAML, and 2 if it is JSON.
 
+=item options_for_module
+
+  my $options = $file->options_for_module($module);
+
+Returns the extra options specified for a given module as a hash
+reference. Returns C<undef> when the given module is not specified in
+the C<cpanfile>.
+
+For example,
+
+  # cpanfile
+  requires 'Plack', '1.000',
+    dist => "MIYAGAWA/Plack-1.000.tar.gz";
+
+  # ...
+  my $file = Module::CPANfile->load;
+  my $options = $file->options_for_module('Plack');
+  # => { dist => "MIYAGAWA/Plack-1.000.tar.gz" }
+
 =back
 
 =head1 AUTHOR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/Utils.pm 
new/Module-CPANfile-1.1003/t/Utils.pm
--- old/Module-CPANfile-1.1002/t/Utils.pm       2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/Utils.pm       2018-04-22 01:54:49.000000000 
+0200
@@ -1,5 +1,6 @@
 package t::Utils;
 use base qw(Exporter);
+use File::pushd qw(tempd);
 
 our @EXPORT = qw(write_cpanfile write_files);
 
@@ -10,30 +11,15 @@
 sub write_files {
     my %files = @_;
 
-    my $dir = "t/sample-" . rand(100000);
-    mkdir $dir;
-    chdir $dir;
+    my $dir = tempd;
 
     for my $file (keys %files) {
-        open my $fh, ">", $file or die $!;
+        open my $fh, ">", $file or die "$file: $!";
         print $fh $files{$file};
     }
 
-    return Remover->new($dir, [ keys %files ]);
+    return $dir;
 }
 
-package
-  Remover;
-sub new {
-    bless { dir => $_[1], files => $_[2] }, $_[0];
-}
-
-sub DESTROY {
-    my $self = shift;
-    for my $file (@{$self->{files}}) {
-        unlink $file;
-    }
-    chdir "../..";
-    rmdir $self->{dir};
-}
+1;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/author-pod-syntax.t 
new/Module-CPANfile-1.1003/t/author-pod-syntax.t
--- old/Module-CPANfile-1.1002/t/author-pod-syntax.t    2016-02-12 
17:23:03.000000000 +0100
+++ new/Module-CPANfile-1.1003/t/author-pod-syntax.t    2018-04-22 
01:54:49.000000000 +0200
@@ -2,8 +2,8 @@
 
 BEGIN {
   unless ($ENV{AUTHOR_TESTING}) {
-    require Test::More;
-    Test::More::plan(skip_all => 'these tests are for testing by the author');
+    print qq{1..0 # SKIP these tests are for testing by the author\n};
+    exit
   }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/feature.t 
new/Module-CPANfile-1.1003/t/feature.t
--- old/Module-CPANfile-1.1002/t/feature.t      2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/feature.t      2018-04-22 01:54:49.000000000 
+0200
@@ -1,6 +1,7 @@
 use strict;
 use Module::CPANfile;
 use Test::More;
+use lib ".";
 use t::Utils;
 
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/from_prereqs.t 
new/Module-CPANfile-1.1003/t/from_prereqs.t
--- old/Module-CPANfile-1.1002/t/from_prereqs.t 2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/from_prereqs.t 2018-04-22 01:54:49.000000000 
+0200
@@ -2,6 +2,7 @@
 use Test::More;
 
 use Module::CPANfile;
+use lib ".";
 use t::Utils;
 
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/merge.t 
new/Module-CPANfile-1.1003/t/merge.t
--- old/Module-CPANfile-1.1002/t/merge.t        2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/merge.t        2018-04-22 01:54:49.000000000 
+0200
@@ -1,6 +1,7 @@
 use strict;
 use Module::CPANfile;
 use Test::More;
+use lib ".";
 use t::Utils;
 
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/mirror.t 
new/Module-CPANfile-1.1003/t/mirror.t
--- old/Module-CPANfile-1.1002/t/mirror.t       2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/mirror.t       2018-04-22 01:54:49.000000000 
+0200
@@ -1,6 +1,7 @@
 use strict;
 use Module::CPANfile;
 use Test::More;
+use lib ".";
 use t::Utils;
 
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/options.t 
new/Module-CPANfile-1.1003/t/options.t
--- old/Module-CPANfile-1.1002/t/options.t      1970-01-01 01:00:00.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/options.t      2018-04-22 01:54:49.000000000 
+0200
@@ -0,0 +1,37 @@
+use strict;
+use Test::More;
+
+use Module::CPANfile;
+use lib ".";
+use t::Utils;
+
+{
+    my $r = write_cpanfile(<<FILE);
+requires 'Path::Class', 0.26,
+  dist => "KWILLIAMS/Path-Class-0.26.tar.gz";
+
+# omit version specifier
+requires 'Hash::MultiValue',
+  dist => "MIYAGAWA/Hash-MultiValue-0.15.tar.gz";
+
+# use dist + mirror
+requires 'Cookie::Baker',
+  dist => "KAZEBURO/Cookie-Baker-0.08.tar.gz",
+  mirror => "http://cpan.cpantesters.org/";;
+
+# use the full URL
+requires 'Try::Tiny', 0.28,
+  url => "http://backpan.perl.org/authors/id/E/ET/ETHER/Try-Tiny-0.28.tar.gz";;
+FILE
+
+    my $file1 = Module::CPANfile->load;
+    my $blob = $file1->to_string;
+
+    my $file2 = Module::CPANfile->load(\$blob);
+
+    for my $mod ( qw(Path::Class Hash::MultiValue Cookie::Baker Try::Tiny) ) {
+        is_deeply $file1->options_for_module($mod), 
$file2->options_for_module($mod);
+    }
+}
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/parse.t 
new/Module-CPANfile-1.1003/t/parse.t
--- old/Module-CPANfile-1.1002/t/parse.t        2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/parse.t        2018-04-22 01:54:49.000000000 
+0200
@@ -2,6 +2,7 @@
 use Module::CPANfile;
 use Test::More;
 use POSIX qw(locale_h);
+use lib ".";
 use t::Utils;
 
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Module-CPANfile-1.1002/t/requirement.t 
new/Module-CPANfile-1.1003/t/requirement.t
--- old/Module-CPANfile-1.1002/t/requirement.t  2016-02-12 17:23:03.000000000 
+0100
+++ new/Module-CPANfile-1.1003/t/requirement.t  2018-04-22 01:54:49.000000000 
+0200
@@ -1,6 +1,7 @@
 use strict;
 use Module::CPANfile;
 use Test::More;
+use lib ".";
 use t::Utils;
 
 {


Reply via email to