Upgrade Module-Pluggable to v4.7
authorYves Orton <demerphq@gmail.com>
Tue, 26 Feb 2013 07:27:45 +0000 (08:27 +0100)
committerYves Orton <demerphq@gmail.com>
Tue, 26 Feb 2013 07:27:45 +0000 (08:27 +0100)
Preserved old makefile as some of its logic is in Build.PL now which we dont use.

cpan/Module-Pluggable/lib/Module/Pluggable.pm
cpan/Module-Pluggable/lib/Module/Pluggable/Object.pm
cpan/Module-Pluggable/t/19can_ok_clobber.t
cpan/Module-Pluggable/t/lib/EditorJunk/Plugin/.gitignore [deleted file]
cpan/Module-Pluggable/t/lib/OddTest/Plugin/.gitignore [deleted file]

index a723dbc..9e7962e 100644 (file)
@@ -11,7 +11,7 @@ use if $] > 5.017, 'deprecate';
 # Peter Gibbons: I wouldn't say I've been missing it, Bob! 
 
 
-$VERSION = '4.6'; # core release only!
+$VERSION = '4.7';
 $FORCE_SEARCH_ALL_PATHS = 0;
 
 sub import {
index 3c198a7..6b1d265 100644 (file)
@@ -83,16 +83,17 @@ sub plugins {
     if (defined $self->{'instantiate'}) {
         my $method = $self->{'instantiate'};
         my @objs   = ();
-        foreach my $package (keys %plugins) {
-                       next unless $package->can($method);
+        foreach my $package (sort keys %plugins) {
+            next unless $package->can($method);
             my $obj = eval { $package->$method(@_) };
-               $self->{'on_instantiate_error'}->($package, $@) if $@;
+            $self->{'on_instantiate_error'}->($package, $@) if $@;
             push @objs, $obj if $obj;           
         }
         return @objs;
     } else { 
         # no? just return the names
-        return keys %plugins;
+        my @objs= sort keys %plugins;
+        return @objs;
     }
 }
 
index 07c598b..60616f6 100644 (file)
@@ -10,7 +10,7 @@ use Test::More tests=>5;
 #use_ok( 'MyTest' );
 #diag "Module::Pluggable::VERSION $Module::Pluggable::VERSION";
 
-my @plugins = MyTest->plugins;
+my @plugins = sort MyTest->plugins;
 my @plugins_after;
 
 use_ok( 'MyTest::Plugin::Foo' );
@@ -21,16 +21,16 @@ is_deeply(
     \@plugins_after,
     \@plugins,
     "plugins haven't been clobbered",
-);
+) or diag Dumper(\@plugins_after,\@plugins);
 
 can_ok ($foo, 'frobnitz');
 
-@plugins_after = MyTest->plugins;
+@plugins_after = sort MyTest->plugins;
 is_deeply(
     \@plugins_after,
     \@plugins,
     "plugins haven't been clobbered",
-) or diag Dumper ;
+) or diag Dumper(\@plugins_after,\@plugins);
 
 
 
diff --git a/cpan/Module-Pluggable/t/lib/EditorJunk/Plugin/.gitignore b/cpan/Module-Pluggable/t/lib/EditorJunk/Plugin/.gitignore
deleted file mode 100644 (file)
index 34796cc..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-[#]*
-.#*
diff --git a/cpan/Module-Pluggable/t/lib/OddTest/Plugin/.gitignore b/cpan/Module-Pluggable/t/lib/OddTest/Plugin/.gitignore
deleted file mode 100644 (file)
index 8c9254e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/-Dodgy.pm