Skip to content

Commit

Permalink
Simon, did you forget to remove a dependency you used only for testin…
Browse files Browse the repository at this point in the history
…g? Yes, yes you did.
  • Loading branch information
simonwistow committed Oct 25, 2024
1 parent 2f49a9e commit 8c17958
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-10-23 - 6.2
Simon, did you forget to remove a dependency you used only for testing? Yes, yes you did.

2024-10-22 - 6.1
Don't use vars, use our (thanks to Graham Knop @haarg)
Ignore the .AppleDouble (thanks to Dave Cantrell @DrHyde)
Expand Down
16 changes: 13 additions & 3 deletions lib/Module/Pluggable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use if $] > 5.017, 'deprecate';
# Peter Gibbons: I wouldn't say I've been missing it, Bob!


our $VERSION = '6.1';
our $VERSION = '6.2';
our $FORCE_SEARCH_ALL_PATHS = 0;

sub import {
Expand All @@ -30,7 +30,7 @@ sub import {
my $finder = Module::Pluggable::Object->new(%opts);
my $subroutine = sub { my $self = shift; return $finder->plugins(@_) };

my $searchsub = sub {
my $search_path_sub = sub {
my $self = shift;
my ($action,@paths) = @_;

Expand All @@ -40,6 +40,15 @@ sub import {
return $finder->{'search_path'};
};

my $search_dirs_sub = sub {
my $self = shift;
my ($action,@paths) = @_;

$finder->{'search_dirs'} = ["${package}::Plugin"] if ($action eq 'add' and not $finder->{'search_dirs'} );
push @{$finder->{'search_dirs'}}, @paths if ($action eq 'add');
$finder->{'search_dirs'} = \@paths if ($action eq 'new');
return $finder->{'search_dirs'};
};

my $onlysub = sub {
my ($self, $only) = @_;
Expand All @@ -66,7 +75,8 @@ sub import {
no warnings qw(redefine prototype);

*{"$package\::$sub"} = $subroutine;
*{"$package\::search_path"} = $searchsub;
*{"$package\::search_path"} = $search_path_sub;
*{"$package\::search_dirs"} = $search_dirs_sub;
*{"$package\::only"} = $onlysub;
*{"$package\::except"} = $exceptsub;

Expand Down
1 change: 0 additions & 1 deletion t/29unreadable.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use FindBin;
use Test::More tests => 6;
use File::Temp qw/tempdir/;
use File::Path qw(make_path);
use File::Slurp;

# The problem with checking for files that are unreadable
# is that we can't check unreadable files into git
Expand Down

0 comments on commit 8c17958

Please sign in to comment.