r33283 - in /trunk/libmodule-pluggable-perl: ./ debian/ lib/Module/ lib/Module/Pluggable/ t/ t/lib/Acme/ t/lib/Zot/
bricas-guest at users.alioth.debian.org
bricas-guest at users.alioth.debian.org
Wed Apr 15 18:02:18 UTC 2009
Author: bricas-guest
Date: Wed Apr 15 18:02:12 2009
New Revision: 33283
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33283
Log:
* New upstream release
* debian/control: Added myself to uploaders
Added:
trunk/libmodule-pluggable-perl/t/10innerpack_onefile.t
trunk/libmodule-pluggable-perl/t/12onlyrequire.t
trunk/libmodule-pluggable-perl/t/lib/Acme/Foo-Bar.pm
trunk/libmodule-pluggable-perl/t/lib/Zot/
trunk/libmodule-pluggable-perl/t/lib/Zot/.Zork.pm
Modified:
trunk/libmodule-pluggable-perl/Changes
trunk/libmodule-pluggable-perl/MANIFEST
trunk/libmodule-pluggable-perl/META.yml
trunk/libmodule-pluggable-perl/Makefile.PL
trunk/libmodule-pluggable-perl/debian/changelog
trunk/libmodule-pluggable-perl/debian/control
trunk/libmodule-pluggable-perl/lib/Module/Pluggable.pm
trunk/libmodule-pluggable-perl/lib/Module/Pluggable/Object.pm
Modified: trunk/libmodule-pluggable-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/Changes?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/Changes (original)
+++ trunk/libmodule-pluggable-perl/Changes Wed Apr 15 18:02:12 2009
@@ -1,3 +1,7 @@
+2009-03-02 - 3.9
+ Allow inner packages when in a one file situation (suggestion from Christopher Brown)
+ Fix bug with requiring skipped packages (from Jos Boumans)
+
2008-03-16 - 3.8
Set INSTALLDIRS correctly in Makefile.PL
A couple of other fixups to play nicely in Core
Modified: trunk/libmodule-pluggable-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/MANIFEST?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/MANIFEST (original)
+++ trunk/libmodule-pluggable-perl/MANIFEST Wed Apr 15 18:02:12 2009
@@ -25,12 +25,14 @@
t/10innerpack.t
t/10innerpack_inner.t
t/10innerpack_noinner.t
+t/10innerpack_onefile.t
t/10innerpack_override.t
t/10innerpack_super.t
t/11usetwice.t
t/12only.t
t/12onlyarray.t
t/12onlyregex.t
+t/12onlyrequire.t
t/13except.t
t/13exceptarray.t
t/13exceptregex.t
@@ -43,6 +45,7 @@
t/20dodgy_files.t
t/21editor_junk.t
t/acme/Acme/MyTest/Plugin/Foo.pm
+t/lib/Acme/Foo-Bar.pm
t/lib/Acme/MyTest/Plugin/Foo.pm
t/lib/EditorJunk/Plugin/Bar.pm
t/lib/EditorJunk/Plugin/Bar.pm.swo
@@ -64,3 +67,4 @@
t/lib/No/Middle.pm
t/lib/OddTest/Plugin/Foo.pm
t/lib/TA/C/A/I.pm
+t/lib/Zot/.Zork.pm
Modified: trunk/libmodule-pluggable-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/META.yml?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/META.yml (original)
+++ trunk/libmodule-pluggable-perl/META.yml Wed Apr 15 18:02:12 2009
@@ -1,15 +1,21 @@
--- #YAML:1.0
-name: Module-Pluggable
-version: 3.8
-abstract: ~
-license: ~
-author: ~
-generated_by: ExtUtils::MakeMaker version 6.38
-distribution_type: module
-requires:
- File::Basename: 0
- File::Spec: 3.00
- Test::More: 0.62
+name: Module-Pluggable
+version: 3.9
+abstract: ~
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ File::Basename: 0
+ File::Spec: 3.00
+ Test::More: 0.62
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.48
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/libmodule-pluggable-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/Makefile.PL?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/Makefile.PL (original)
+++ trunk/libmodule-pluggable-perl/Makefile.PL Wed Apr 15 18:02:12 2009
@@ -17,13 +17,13 @@
"t", "Module_Pluggable") : ($FindBin::Bin,"t");
my @files;
-if ($^O ne 'VMS' && $^O ne 'VOS') {
+unless (grep { lc($^O) eq $_ } qw(vms vos)) {
foreach my $test (keys %dodgy_files) {
- my ($file) = (catfile($FindBin::Bin,"t","lib", $test)=~/^(.*)$/);
- if (open(my $fh, ">", $file)) {
+ my ($file) = (catfile(@path, "lib", $test)=~/^(.*)$/);
+ if (open(FH, ">$file")) {
my $name = $dodgy_files{$test};
- print $fh "package $name;\nsub new {}\n1;";
- close($fh);
+ print FH "package $name;\nsub new {}\n1;";
+ close(FH);
push @files, $file;
}
}
@@ -41,6 +41,7 @@
},
'EXE_FILES' => [],
'INSTALLDIRS' => ($] >= 5.008009) ? "perl" : "site",
+ 'INST_LIB' => ($] >= 5.008009) ? 'blib/arch' : 'blib/lib',
'PL_FILES' => {},
'realclean' => {FILES=> join ' ', @files},
# In the core pods will be built by installman.
Modified: trunk/libmodule-pluggable-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/debian/changelog?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/debian/changelog (original)
+++ trunk/libmodule-pluggable-perl/debian/changelog Wed Apr 15 18:02:12 2009
@@ -1,9 +1,14 @@
-libmodule-pluggable-perl (3.8-2) UNRELEASED; urgency=low
+libmodule-pluggable-perl (3.9-1) UNRELEASED; urgency=low
+ [ Brian Cassidy ]
+ * New upstream release
+ * debian/control: Added myself to uploaders
+
+ [ gregor herrmann ]
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
(source stanza).
- -- gregor herrmann <gregoa at debian.org> Sun, 16 Nov 2008 20:44:58 +0100
+ -- Brian Cassidy <brian.cassidy at gmail.com> Wed, 15 Apr 2009 14:59:35 -0300
libmodule-pluggable-perl (3.8-1) unstable; urgency=low
Modified: trunk/libmodule-pluggable-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/debian/control?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/debian/control (original)
+++ trunk/libmodule-pluggable-perl/debian/control Wed Apr 15 18:02:12 2009
@@ -2,7 +2,9 @@
Section: perl
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Niko Tyni <ntyni at iki.fi>, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>, gregor herrmann <gregor+debian at comodo.priv.at>
+Uploaders: Niko Tyni <ntyni at iki.fi>, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>,
+ gregor herrmann <gregor+debian at comodo.priv.at>,
+ Brian Cassidy <brian.cassidy at gmail.com>
Build-Depends: debhelper (>= 5)
Build-Depends-Indep: perl (>= 5.6.0-16), perl-modules
Standards-Version: 3.7.3
Modified: trunk/libmodule-pluggable-perl/lib/Module/Pluggable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/lib/Module/Pluggable.pm?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/lib/Module/Pluggable.pm (original)
+++ trunk/libmodule-pluggable-perl/lib/Module/Pluggable.pm Wed Apr 15 18:02:12 2009
@@ -9,7 +9,7 @@
# Peter Gibbons: I wouldn't say I've been missing it, Bob!
-$VERSION = '3.8';
+$VERSION = '3.9';
sub import {
my $class = shift;
Modified: trunk/libmodule-pluggable-perl/lib/Module/Pluggable/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/lib/Module/Pluggable/Object.pm?rev=33283&op=diff
==============================================================================
--- trunk/libmodule-pluggable-perl/lib/Module/Pluggable/Object.pm (original)
+++ trunk/libmodule-pluggable-perl/lib/Module/Pluggable/Object.pm Wed Apr 15 18:02:12 2009
@@ -6,10 +6,9 @@
use File::Spec::Functions qw(splitdir catdir curdir catfile abs2rel);
use Carp qw(croak carp);
use Devel::InnerPackage;
-use Data::Dumper;
use vars qw($VERSION);
-$VERSION = '3.6';
+$VERSION = '3.9';
sub new {
@@ -34,14 +33,14 @@
my $filename = $self->{'filename'};
my $pkg = $self->{'package'};
+ # Get the exception params instantiated
+ $self->_setup_exceptions;
+
# automatically turn a scalar search path or namespace into a arrayref
for (qw(search_path search_dirs)) {
$self->{$_} = [ $self->{$_} ] if exists $self->{$_} && !ref($self->{$_});
}
-
-
-
# default search path is '<Module>::<Name>::Plugin'
$self->{'search_path'} = ["${pkg}::Plugin"] unless $self->{'search_path'};
@@ -57,6 +56,7 @@
my @plugins = $self->search_directories(@SEARCHDIR);
+ push(@plugins, $self->handle_innerpackages($_)) for @{$self->{'search_path'}};
# push @plugins, map { print STDERR "$_\n"; $_->require } list_packages($_) for (@{$self->{'search_path'}});
@@ -64,43 +64,12 @@
return () unless @plugins;
- # exceptions
- my %only;
- my %except;
- my $only;
- my $except;
-
- if (defined $self->{'only'}) {
- if (ref($self->{'only'}) eq 'ARRAY') {
- %only = map { $_ => 1 } @{$self->{'only'}};
- } elsif (ref($self->{'only'}) eq 'Regexp') {
- $only = $self->{'only'}
- } elsif (ref($self->{'only'}) eq '') {
- $only{$self->{'only'}} = 1;
- }
- }
-
-
- if (defined $self->{'except'}) {
- if (ref($self->{'except'}) eq 'ARRAY') {
- %except = map { $_ => 1 } @{$self->{'except'}};
- } elsif (ref($self->{'except'}) eq 'Regexp') {
- $except = $self->{'except'}
- } elsif (ref($self->{'except'}) eq '') {
- $except{$self->{'except'}} = 1;
- }
- }
-
# remove duplicates
# probably not necessary but hey ho
my %plugins;
for(@plugins) {
- next if (keys %only && !$only{$_} );
- next unless (!defined $only || m!$only! );
-
- next if (keys %except && $except{$_} );
- next if (defined $except && m!$except! );
+ next unless $self->_is_legit($_);
$plugins{$_} = 1;
}
@@ -116,6 +85,58 @@
}
+sub _setup_exceptions {
+ my $self = shift;
+
+ my %only;
+ my %except;
+ my $only;
+ my $except;
+
+ if (defined $self->{'only'}) {
+ if (ref($self->{'only'}) eq 'ARRAY') {
+ %only = map { $_ => 1 } @{$self->{'only'}};
+ } elsif (ref($self->{'only'}) eq 'Regexp') {
+ $only = $self->{'only'}
+ } elsif (ref($self->{'only'}) eq '') {
+ $only{$self->{'only'}} = 1;
+ }
+ }
+
+
+ if (defined $self->{'except'}) {
+ if (ref($self->{'except'}) eq 'ARRAY') {
+ %except = map { $_ => 1 } @{$self->{'except'}};
+ } elsif (ref($self->{'except'}) eq 'Regexp') {
+ $except = $self->{'except'}
+ } elsif (ref($self->{'except'}) eq '') {
+ $except{$self->{'except'}} = 1;
+ }
+ }
+ $self->{_exceptions}->{only_hash} = \%only;
+ $self->{_exceptions}->{only} = $only;
+ $self->{_exceptions}->{except_hash} = \%except;
+ $self->{_exceptions}->{except} = $except;
+
+}
+
+sub _is_legit {
+ my $self = shift;
+ my $plugin = shift;
+ my %only = %{$self->{_exceptions}->{only_hash}||{}};
+ my %except = %{$self->{_exceptions}->{except_hash}||{}};
+ my $only = $self->{_exceptions}->{only};
+ my $except = $self->{_exceptions}->{except};
+
+ return 0 if (keys %only && !$only{$plugin} );
+ return 0 unless (!defined $only || $plugin =~ m!$only! );
+
+ return 0 if (keys %except && $except{$plugin} );
+ return 0 if (defined $except && $plugin =~ m!$except! );
+
+ return 1;
+}
+
sub search_directories {
my $self = shift;
my @SEARCHDIR = @_;
@@ -125,7 +146,6 @@
foreach my $dir (@SEARCHDIR) {
push @plugins, $self->search_paths($dir);
}
-
return @plugins;
}
@@ -209,7 +229,7 @@
# now add stuff that may have been in package
# NOTE we should probably use all the stuff we've been given already
# but then we can't unload it :(
- push @plugins, $self->handle_innerpackages($searchpath) unless (exists $self->{inner} && !$self->{inner});
+ push @plugins, $self->handle_innerpackages($searchpath);
} # foreach $searchpath
return @plugins;
@@ -236,6 +256,7 @@
my $plugin = shift;
return unless (defined $self->{'instantiate'} || $self->{'require'});
+ return unless $self->_is_legit($plugin);
$self->_require($plugin);
}
@@ -267,9 +288,10 @@
sub handle_innerpackages {
my $self = shift;
+ return () if (exists $self->{inner} && !$self->{inner});
+
my $path = shift;
my @plugins;
-
foreach my $plugin (Devel::InnerPackage::list_packages($path)) {
my $err = $self->handle_finding_plugin($plugin);
Added: trunk/libmodule-pluggable-perl/t/10innerpack_onefile.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/t/10innerpack_onefile.t?rev=33283&op=file
==============================================================================
--- trunk/libmodule-pluggable-perl/t/10innerpack_onefile.t (added)
+++ trunk/libmodule-pluggable-perl/t/10innerpack_onefile.t Wed Apr 15 18:02:12 2009
@@ -1,0 +1,27 @@
+#!perl -wT
+
+use strict;
+use Test::More tests => 2;
+use Data::Dumper;
+
+my $mc = MyClass->new();
+my $mc2 = MyClass2->new();
+
+
+is_deeply([$mc->plugins], [qw(MyClass::Plugin::MyPlugin)], "Got inner plugin");
+is_deeply([$mc2->plugins], [], "Didn't get plugin");
+
+package MyClass::Plugin::MyPlugin;
+sub pretty { print "I am pretty" };
+
+package MyClass;
+use Module::Pluggable inner => 1;
+
+sub new { return bless {}, $_[0] }
+
+package MyClass2;
+use Module::Pluggable search_path => "MyClass::Plugin", inner => 0;
+
+sub new { return bless {}, $_[0] }
+1;
+
Added: trunk/libmodule-pluggable-perl/t/12onlyrequire.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/t/12onlyrequire.t?rev=33283&op=file
==============================================================================
--- trunk/libmodule-pluggable-perl/t/12onlyrequire.t (added)
+++ trunk/libmodule-pluggable-perl/t/12onlyrequire.t Wed Apr 15 18:02:12 2009
@@ -1,0 +1,21 @@
+#!perl -w
+use strict;
+use FindBin;
+use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
+use Test::More tests => 2;
+
+my @packages = eval { Zot->_dist_types };
+is($@, '', "No warnings");
+is(scalar(@packages), 0, "Correctly only got 1 package");
+
+
+package Zot;
+use strict;
+use Module::Pluggable (
+ sub_name => '_dist_types',
+ search_path => __PACKAGE__,
+ only => qr/Zot::\w+$/,
+ require => 1,
+ );
+
+1;
Added: trunk/libmodule-pluggable-perl/t/lib/Acme/Foo-Bar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/t/lib/Acme/Foo-Bar.pm?rev=33283&op=file
==============================================================================
--- trunk/libmodule-pluggable-perl/t/lib/Acme/Foo-Bar.pm (added)
+++ trunk/libmodule-pluggable-perl/t/lib/Acme/Foo-Bar.pm Wed Apr 15 18:02:12 2009
@@ -1,0 +1,6 @@
+package Acme::FooBar;
+
+our $quux = "hello";
+
+1;
+
Added: trunk/libmodule-pluggable-perl/t/lib/Zot/.Zork.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmodule-pluggable-perl/t/lib/Zot/.Zork.pm?rev=33283&op=file
==============================================================================
(empty)
More information about the Pkg-perl-cvs-commits
mailing list