r12613 - in /branches/upstream/libmoosex-object-pluggable-perl/current: ./ inc/Module/ inc/Module/Install/ lib/MooseX/Object/ t/lib/

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sun Jan 13 03:53:24 UTC 2008


Author: gregoa-guest
Date: Sun Jan 13 03:53:24 2008
New Revision: 12613

URL: http://svn.debian.org/wsvn/?sc=1&rev=12613
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-object-pluggable-perl (0.0006)

Modified:
    branches/upstream/libmoosex-object-pluggable-perl/current/Changes
    branches/upstream/libmoosex-object-pluggable-perl/current/META.yml
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/AutoInstall.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Include.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/lib/MooseX/Object/Pluggable.pm
    branches/upstream/libmoosex-object-pluggable-perl/current/t/lib/TestApp.pm

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/Changes?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/Changes (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/Changes Sun Jan 13 03:53:24 2008
@@ -1,4 +1,9 @@
 Revision history for MooseX-Object-Pluggable
+0.0006    Jan 11, 2008
+          Deprecate the Extension mechanism
+          Added load_plugins
+          Test while classes are immutable for good measure.
+          Remove use strict and use warnings. Moose does it for us.
 0.0005    Apr 13, 2007
           Goodbye Class::Inspector, hello Module::Object::Pluggable
           More Tests

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/META.yml?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/META.yml Sun Jan 13 03:53:24 2008
@@ -1,10 +1,14 @@
+--- 
 abstract: Add plugin support to your Moose classes via roles.
 author: Guillermo Roditi, <groditi at cpan.org>
 build_requires: 
   Test::More: 0
 distribution_type: module
-generated_by: Module::Install version 0.64
+generated_by: Module::Install version 0.67
 license: perl
+meta-spec: 
+  url: http://module-build.sourceforge.net/META-spec-v1.3.html
+  version: 1.3
 name: MooseX-Object-Pluggable
 no_index: 
   directory: 
@@ -13,4 +17,4 @@
 requires: 
   Module::Pluggable::Object: 0
   Moose: 0.17
-version: 0.0005
+version: 0.0006

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install.pm Sun Jan 13 03:53:24 2008
@@ -28,7 +28,7 @@
     # This is not enforced yet, but will be some time in the next few
     # releases once we can make sure it won't clash with custom
     # Module::Install extensions.
-    $VERSION = '0.64';
+    $VERSION = '0.67';
 }
 
 # Whether or not inc::Module::Install is actually loaded, the

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/AutoInstall.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/AutoInstall.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/AutoInstall.pm Sun Jan 13 03:53:24 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Base.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Base.pm Sun Jan 13 03:53:24 2008
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.64';
+$VERSION = '0.67';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Can.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Can.pm Sun Jan 13 03:53:24 2008
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Fetch.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Fetch.pm Sun Jan 13 03:53:24 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Include.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Include.pm Sun Jan 13 03:53:24 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Makefile.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Makefile.pm Sun Jan 13 03:53:24 2008
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -17,192 +17,221 @@
 my %seen = ();
 
 sub prompt {
-    shift;
-
-    # Infinite loop protection
-    my @c = caller();
-    if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
-        die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
-    }
-
-    # In automated testing, always use defaults
-    if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
-        local $ENV{PERL_MM_USE_DEFAULT} = 1;
-        goto &ExtUtils::MakeMaker::prompt;
-    } else {
-        goto &ExtUtils::MakeMaker::prompt;
-    }
+	shift;
+
+	# Infinite loop protection
+	my @c = caller();
+	if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+		die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+	}
+
+	# In automated testing, always use defaults
+	if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+		local $ENV{PERL_MM_USE_DEFAULT} = 1;
+		goto &ExtUtils::MakeMaker::prompt;
+	} else {
+		goto &ExtUtils::MakeMaker::prompt;
+	}
 }
 
 sub makemaker_args {
-    my $self = shift;
-    my $args = ($self->{makemaker_args} ||= {});
-    %$args = ( %$args, @_ ) if @_;
-    $args;
+	my $self = shift;
+	my $args = ($self->{makemaker_args} ||= {});
+	%$args = ( %$args, @_ ) if @_;
+	$args;
 }
 
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-    my $self = shift;
-    my $name = shift;
-    my $args = $self->makemaker_args;
-    $args->{name} = defined $args->{$name}
-    	? join( ' ', $args->{name}, @_ )
-    	: join( ' ', @_ );
+	my $self = sShift;
+	my $name = shift;
+	my $args = $self->makemaker_args;
+	$args->{name} = defined $args->{$name}
+		? join( ' ', $args->{name}, @_ )
+		: join( ' ', @_ );
 }
 
 sub build_subdirs {
-    my $self    = shift;
-    my $subdirs = $self->makemaker_args->{DIR} ||= [];
-    for my $subdir (@_) {
-        push @$subdirs, $subdir;
-    }
+	my $self    = shift;
+	my $subdirs = $self->makemaker_args->{DIR} ||= [];
+	for my $subdir (@_) {
+		push @$subdirs, $subdir;
+	}
 }
 
 sub clean_files {
-    my $self  = shift;
-    my $clean = $self->makemaker_args->{clean} ||= {};
-    %$clean = (
-        %$clean, 
-        FILES => join(' ', grep length, $clean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $clean = $self->makemaker_args->{clean} ||= {};
+	%$clean = (
+		%$clean, 
+		FILES => join(' ', grep length, $clean->{FILES}, @_),
+	);
 }
 
 sub realclean_files {
-    my $self  = shift;
-    my $realclean = $self->makemaker_args->{realclean} ||= {};
-    %$realclean = (
-        %$realclean, 
-        FILES => join(' ', grep length, $realclean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $realclean = $self->makemaker_args->{realclean} ||= {};
+	%$realclean = (
+		%$realclean, 
+		FILES => join(' ', grep length, $realclean->{FILES}, @_),
+	);
 }
 
 sub libs {
-    my $self = shift;
-    my $libs = ref $_[0] ? shift : [ shift ];
-    $self->makemaker_args( LIBS => $libs );
+	my $self = shift;
+	my $libs = ref $_[0] ? shift : [ shift ];
+	$self->makemaker_args( LIBS => $libs );
 }
 
 sub inc {
-    my $self = shift;
-    $self->makemaker_args( INC => shift );
+	my $self = shift;
+	$self->makemaker_args( INC => shift );
+}
+
+my %test_dir = ();
+
+sub _wanted_t {
+	/\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
+}
+
+sub tests_recursive {
+	my $self = shift;
+	if ( $self->tests ) {
+		die "tests_recursive will not work if tests are already defined";
+	}
+	my $dir = shift || 't';
+	unless ( -d $dir ) {
+		die "tests_recursive dir '$dir' does not exist";
+	}
+	require File::Find;
+	%test_dir = ();
+	File::Find::find( \&_wanted_t, $dir );
+	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
 sub write {
-    my $self = shift;
-    die "&Makefile->write() takes no arguments\n" if @_;
-
-    my $args = $self->makemaker_args;
-    $args->{DISTNAME} = $self->name;
-    $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
-    $args->{VERSION}  = $self->version || $self->determine_VERSION($args);
-    $args->{NAME}     =~ s/-/::/g;
-    if ( $self->tests ) {
-        $args->{test} = { TESTS => $self->tests };
-    }
-    if ($] >= 5.005) {
-        $args->{ABSTRACT} = $self->abstract;
-        $args->{AUTHOR}   = $self->author;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
-        $args->{NO_META} = 1;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
-        $args->{SIGN} = 1;
-    }
-    unless ( $self->is_admin ) {
-        delete $args->{SIGN};
-    }
-
-    # merge both kinds of requires into prereq_pm
-    my $prereq = ($args->{PREREQ_PM} ||= {});
-    %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
-                 ($self->build_requires, $self->requires) );
-
-    # merge both kinds of requires into prereq_pm
-    my $subdirs = ($args->{DIR} ||= []);
-    if ($self->bundles) {
-        foreach my $bundle (@{ $self->bundles }) {
-            my ($file, $dir) = @$bundle;
-            push @$subdirs, $dir if -d $dir;
-            delete $prereq->{$file};
-        }
-    }
-
-    if ( my $perl_version = $self->perl_version ) {
-        eval "use $perl_version; 1"
-            or die "ERROR: perl: Version $] is installed, "
-                . "but we need version >= $perl_version";
-    }
-
-    my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-    if ($self->admin->preop) {
-        $args{dist} = $self->admin->preop;
-    }
-
-    my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
-    $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
+	my $self = shift;
+	die "&Makefile->write() takes no arguments\n" if @_;
+
+	my $args = $self->makemaker_args;
+	$args->{DISTNAME} = $self->name;
+	$args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
+	$args->{VERSION}  = $self->version || $self->determine_VERSION($args);
+	$args->{NAME}     =~ s/-/::/g;
+	if ( $self->tests ) {
+		$args->{test} = { TESTS => $self->tests };
+	}
+	if ($] >= 5.005) {
+		$args->{ABSTRACT} = $self->abstract;
+		$args->{AUTHOR}   = $self->author;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+		$args->{NO_META} = 1;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+		$args->{SIGN} = 1;
+	}
+	unless ( $self->is_admin ) {
+		delete $args->{SIGN};
+	}
+
+	# merge both kinds of requires into prereq_pm
+	my $prereq = ($args->{PREREQ_PM} ||= {});
+	%$prereq = ( %$prereq,
+		map { @$_ }
+		map { @$_ }
+		grep $_,
+		($self->build_requires, $self->requires)
+	);
+
+	# merge both kinds of requires into prereq_pm
+	my $subdirs = ($args->{DIR} ||= []);
+	if ($self->bundles) {
+		foreach my $bundle (@{ $self->bundles }) {
+			my ($file, $dir) = @$bundle;
+			push @$subdirs, $dir if -d $dir;
+			delete $prereq->{$file};
+		}
+	}
+
+	if ( my $perl_version = $self->perl_version ) {
+		eval "use $perl_version; 1"
+			or die "ERROR: perl: Version $] is installed, "
+			. "but we need version >= $perl_version";
+	}
+
+	$args->{INSTALLDIRS} = $self->installdirs;
+
+	my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+
+	my $user_preop = delete $args{dist}->{PREOP};
+	if (my $preop = $self->admin->preop($user_preop)) {
+		$args{dist} = $preop;
+	}
+
+	my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+	$self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
 }
 
 sub fix_up_makefile {
-    my $self          = shift;
-    my $makefile_name = shift;
-    my $top_class     = ref($self->_top) || '';
-    my $top_version   = $self->_top->VERSION || '';
-
-    my $preamble = $self->preamble 
-        ? "# Preamble by $top_class $top_version\n"
-            . $self->preamble
-        : '';
-    my $postamble = "# Postamble by $top_class $top_version\n"
-        . ($self->postamble || '');
-
-    local *MAKEFILE;
-    open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    my $makefile = do { local $/; <MAKEFILE> };
-    close MAKEFILE or die $!;
-
-    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
-    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
-    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
-    $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
-    $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
-    # Module::Install will never be used to build the Core Perl
-    # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
-    # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
-    $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
-    #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
-    # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
-    $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
-
-    # XXX - This is currently unused; not sure if it breaks other MM-users
-    # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
-    open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    print MAKEFILE  "$preamble$makefile$postamble" or die $!;
-    close MAKEFILE  or die $!;
-
-    1;
+	my $self          = shift;
+	my $makefile_name = shift;
+	my $top_class     = ref($self->_top) || '';
+	my $top_version   = $self->_top->VERSION || '';
+
+	my $preamble = $self->preamble 
+		? "# Preamble by $top_class $top_version\n"
+			. $self->preamble
+		: '';
+	my $postamble = "# Postamble by $top_class $top_version\n"
+		. ($self->postamble || '');
+
+	local *MAKEFILE;
+	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	my $makefile = do { local $/; <MAKEFILE> };
+	close MAKEFILE or die $!;
+
+	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+	$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+	$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+	$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
+
+	# Module::Install will never be used to build the Core Perl
+	# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
+	# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
+	$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
+	#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
+
+	# Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
+	$makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
+
+	# XXX - This is currently unused; not sure if it breaks other MM-users
+	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
+
+	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
+	close MAKEFILE  or die $!;
+
+	1;
 }
 
 sub preamble {
-    my ($self, $text) = @_;
-    $self->{preamble} = $text . $self->{preamble} if defined $text;
-    $self->{preamble};
+	my ($self, $text) = @_;
+	$self->{preamble} = $text . $self->{preamble} if defined $text;
+	$self->{preamble};
 }
 
 sub postamble {
-    my ($self, $text) = @_;
-    $self->{postamble} ||= $self->admin->postamble;
-    $self->{postamble} .= $text if defined $text;
-    $self->{postamble}
+	my ($self, $text) = @_;
+	$self->{postamble} ||= $self->admin->postamble;
+	$self->{postamble} .= $text if defined $text;
+	$self->{postamble}
 }
 
 1;
 
 __END__
 
-#line 334
+#line 363

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Metadata.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Metadata.pm Sun Jan 13 03:53:24 2008
@@ -6,14 +6,14 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
 
 my @scalar_keys = qw{
     name module_name abstract author version license
-    distribution_type perl_version tests
+    distribution_type perl_version tests installdirs
 };
 
 my @tuple_keys = qw{
@@ -56,9 +56,23 @@
     };
 }
 
+# configure_requires is currently a null-op
+sub configure_requires { 1 }
+
+# Aliases for build_requires that will have alternative
+# meanings in some future version of META.yml.
+sub test_requires      { shift->build_requires(@_)  }
+sub install_requires   { shift->build_requires(@_)  }
+
+# Aliases for installdirs options
+sub install_as_core    { $_[0]->installdirs('perl')   }
+sub install_as_cpan    { $_[0]->installdirs('site')   }
+sub install_as_site    { $_[0]->installdirs('site')   }
+sub install_as_vendor  { $_[0]->installdirs('vendor') }
+
 sub sign {
     my $self = shift;
-    return $self->{'values'}{'sign'} if defined wantarray and !@_;
+    return $self->{'values'}{'sign'} if defined wantarray and ! @_;
     $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
     return $self;
 }
@@ -279,9 +293,11 @@
 
     if (
         $self->_slurp($file) =~ m/
-        =head \d \s+
-        (?:licen[cs]e|licensing|copyright|legal)\b
-        (.*?)
+        (
+            =head \d \s+
+            (?:licen[cs]e|licensing|copyright|legal)\b
+            .*?
+        )
         (=head\\d.*|=cut.*|)
         \z
     /ixms
@@ -289,19 +305,24 @@
     {
         my $license_text = $1;
         my @phrases      = (
-            'under the same (?:terms|license) as perl itself' => 'perl',
-            'GNU public license'                              => 'gpl',
-            'GNU lesser public license'                       => 'gpl',
-            'BSD license'                                     => 'bsd',
-            'Artistic license'                                => 'artistic',
-            'GPL'                                             => 'gpl',
-            'LGPL'                                            => 'lgpl',
-            'BSD'                                             => 'bsd',
-            'Artistic'                                        => 'artistic',
+            'under the same (?:terms|license) as perl itself' => 'perl',        1,
+            'GNU public license'                              => 'gpl',         1,
+            'GNU lesser public license'                       => 'gpl',         1,
+            'BSD license'                                     => 'bsd',         1,
+            'Artistic license'                                => 'artistic',    1,
+            'GPL'                                             => 'gpl',         1,
+            'LGPL'                                            => 'lgpl',        1,
+            'BSD'                                             => 'bsd',         1,
+            'Artistic'                                        => 'artistic',    1,
+            'MIT'                                             => 'mit',         1,
+            'proprietary'                                     => 'proprietary', 0,
         );
-        while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+        while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
             $pattern =~ s{\s+}{\\s+}g;
             if ( $license_text =~ /\b$pattern\b/i ) {
+                if ( $osi and $license_text =~ /All rights reserved/i ) {
+                        warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
+		}
                 $self->license($license);
                 return 1;
             }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Win32.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/Win32.pm Sun Jan 13 03:53:24 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/WriteAll.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/inc/Module/Install/WriteAll.pm Sun Jan 13 03:53:24 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.64';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/lib/MooseX/Object/Pluggable.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/lib/MooseX/Object/Pluggable.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/lib/MooseX/Object/Pluggable.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/lib/MooseX/Object/Pluggable.pm Sun Jan 13 03:53:24 2008
@@ -1,13 +1,11 @@
 package MooseX::Object::Pluggable;
 
 use Carp;
-use strict;
-use warnings;
 use Moose::Role;
 use Class::MOP;
 use Module::Pluggable::Object;
 
-our $VERSION = '0.0005';
+our $VERSION = '0.0006';
 
 =head1 NAME
 
@@ -17,7 +15,7 @@
 
     package MyApp;
     use Moose;
-    
+
     with 'MooseX::Object::Pluggable';
 
     ...
@@ -57,7 +55,7 @@
 and roles using C<has> will not go through comile time checks like C<required>
 and <default>.
 
-Even though C<override> will work , I STRONGLY discourage it's use 
+Even though C<override> will work , I STRONGLY discourage it's use
 and a warning will be thrown if you try to use it.
 This is closely linked to the way multiple roles being applies is handles and is not
 likely to change. C<override> bevavior is closely linked to inheritance and thus will
@@ -71,6 +69,11 @@
 they will instead return the name of the anonymous class created at runtime.
 See C<_original_class_name>.
 
+=head1 Notice regarding extensions.
+
+Because I have been able to identify a real-world use case for the extension mechanism
+I have decided to deprecate it and remove it in the next major release.
+
 =head1 Usage
 
 For a simple example see the tests included in this distribution.
@@ -88,11 +91,15 @@
 
 =head2 _plugin_ext_ns
 
+B<THIS FUNCTIONALITY HAS BEEN DEPRECATED AND WILL GO AWAY.> If you use
+this, please email me, but I am fairly sure that nobody uses this at
+all and it's just adding bloat and making things kind of ugly.
+
 String. The namespace plugin extensions have. Defaults to 'ExtensionFor'.
 
 This means that is _plugin_ns is "MyApp::Plugin" and _plugin_ext_ns is
 "ExtensionFor" loading plugin "Bar" would search for extensions in
-"MyApp::Plugin::Bar::ExtensionFor::*". 
+"MyApp::Plugin::Bar::ExtensionFor::*".
 
 =head2 _plugin_app_ns
 
@@ -113,23 +120,23 @@
 
 #--------#---------#---------#---------#---------#---------#---------#---------#
 
-has _plugin_ns      => (is => 'rw', required => 1, isa => 'Str', 
+has _plugin_ns      => (is => 'rw', required => 1, isa => 'Str',
                         default => 'Plugin');
 has _plugin_ext     => (is => 'rw', required => 1, isa => 'Bool',
-	                default => 1);
-has _plugin_ext_ns  => (is => 'rw', required => 1, isa => 'Str', 
-		        default => 'ExtensionFor');
-has _plugin_loaded  => (is => 'rw', required => 1, isa => 'HashRef', 
-		        default => sub{ {} });
-has _plugin_app_ns  => (is => 'rw', required => 1, isa => 'ArrayRef', lazy => 1, 
-                        auto_deref => 1, 
+                        default => 1);
+has _plugin_ext_ns  => (is => 'rw', required => 1, isa => 'Str',
+                        default => 'ExtensionFor');
+has _plugin_loaded  => (is => 'rw', required => 1, isa => 'HashRef',
+                        default => sub{ {} });
+has _plugin_app_ns  => (is => 'rw', required => 1, isa => 'ArrayRef', lazy => 1,
+                        auto_deref => 1,
                         default => sub{ shift->_build_plugin_app_ns },
-                        trigger => sub{ $_[0]->_clear_plugin_locator 
+                        trigger => sub{ $_[0]->_clear_plugin_locator
                                          if $_[0]->_has_plugin_locator; },
                        );
-has _plugin_locator => (is => 'rw', required => 1, lazy => 1, 
-                        isa       => 'Module::Pluggable::Object', 
-		        clearer   => '_clear_plugin_locator',
+has _plugin_locator => (is => 'rw', required => 1, lazy => 1,
+                        isa       => 'Module::Pluggable::Object',
+                        clearer   => '_clear_plugin_locator',
                         predicate => '_has_plugin_locator',
                         default   => sub{ shift->_build_plugin_locator });
 
@@ -139,8 +146,8 @@
 
 =head2 load_plugin $plugin
 
-This is the only method you should be using. Load the apropriate role for 
-C<$plugin> as well as any extensions it provides if extensions are enabled.
+Load the apropriate role for C<$plugin> as well as any extensions it provides
+if extensions are enabled.
 
 =cut
 
@@ -150,7 +157,7 @@
 
     my $loaded = $self->_plugin_loaded;
     return 1 if exists $loaded->{$plugin};
-    
+
     my $role = $self->_role_from_plugin($plugin);
 
     $loaded->{$plugin} = $role      if $self->_load_and_apply_role($role);
@@ -159,12 +166,28 @@
     return exists $loaded->{$plugin};
 }
 
+=head2 load_plugins @plugins
+
+Load all C<@plugins>.
+
+=cut
+
+
+sub load_plugins {
+  my $self = shift;
+  $self->load_plugin($_) for @_;
+}
+
 
 =head2 load_plugin_ext
 
-Will load any extensions for a particular plugin. This should be called 
+B<THIS FUNCTIONALITY HAS BEEN DEPRECATED AND WILL GO AWAY.> If you use
+this, please email me, but I am fairly sure that nobody uses this at
+all and it's just adding bloat and making things kind of ugly.
+
+Will load any extensions for a particular plugin. This should be called
 automatically by C<load_plugin> so you don't need to worry about it.
-It basically attempts to load any extension that exists for a plugin 
+It basically attempts to load any extension that exists for a plugin
 that is already loaded. The only reason for using this is if you want to
 keep _plugin_ext as false and only load extensions manually, which I don't
 recommend.
@@ -179,18 +202,18 @@
     # $p for plugin, $r for role
     while( my($p,$r) = each %{ $self->_plugin_loaded }){
 
-	my $ext = join "::", $role, $self->_plugin_ext_ns, $p;	
-	if( $plugin =~ /^\+(.*)/ ){
-	    eval{ $self->_load_and_apply_role( $ext ) };
-	} else{
-	    $self->_load_and_apply_role( $ext ) if
-		grep{ /^${ext}$/ } $self->_plugin_locator->plugins;	
+        my $ext = join "::", $role, $self->_plugin_ext_ns, $p;
+        if( $plugin =~ /^\+(.*)/ ){
+            eval{ $self->_load_and_apply_role( $ext ) };
+        } else{
+            $self->_load_and_apply_role( $ext ) if
+                grep{ /^${ext}$/ } $self->_plugin_locator->plugins;
         }
-	
-	#go back to prev loaded modules and load extensions for current module?
-	#my $ext2 = join "::", $r, $self->_plugin_ext_ns, $plugin;
-	#$self->_load_and_apply_role( $ext2 ) 
-	#    if Class::Inspector->installed($ext2);
+
+        #go back to prev loaded modules and load extensions for current module?
+        #my $ext2 = join "::", $r, $self->_plugin_ext_ns, $plugin;
+        #$self->_load_and_apply_role( $ext2 )
+        #    if Class::Inspector->installed($ext2);
     }
 }
 
@@ -210,19 +233,19 @@
 
 =head1 Private Methods
 
-There's nothing stopping you from using these, but if you are using them 
-for anything thats not really complicated you are probably doing 
+There's nothing stopping you from using these, but if you are using them
+for anything thats not really complicated you are probably doing
 something wrong. Some of these may be inlined in the future if performance
 becomes an issue (which I doubt).
 
 =head2 _role_from_plugin $plugin
 
-Creates a role name from a plugin name. If the plugin name is prepended 
+Creates a role name from a plugin name. If the plugin name is prepended
 with a C<+> it will be treated as a full name returned as is. Otherwise
-a string consisting of C<$plugin>  prepended with the C<_plugin_ns> 
+a string consisting of C<$plugin>  prepended with the C<_plugin_ns>
 and the first valid value from C<_plugin_app_ns> will be returned. Example
-   
-   #assuming appname MyApp and C<_plugin_ns> 'Plugin'   
+
+   #assuming appname MyApp and C<_plugin_ns> 'Plugin'
    $self->_role_from_plugin("MyPlugin"); # MyApp::Plugin::MyPlugin
 
 =cut
@@ -233,18 +256,18 @@
     return $1 if( $plugin =~ /^\+(.*)/ );
 
     my $o = join '::', $self->_plugin_ns, $plugin;
-    #Father, please forgive me for I have sinned. 
+    #Father, please forgive me for I have sinned.
     my @roles = grep{ /${o}$/ } $self->_plugin_locator->plugins;
-    
+
     die("Unable to locate plugin") unless @roles;
     return $roles[0] if @roles == 1;
-    
+
     my $i = 0;
     my %presedence_list = map{ $i++; "${_}::${o}", $i } $self->_plugin_app_ns;
-    
+
     @roles = sort{ $presedence_list{$a} <=> $presedence_list{$b}} @roles;
 
-    return shift @roles;    
+    return shift @roles;
 }
 
 =head2 _load_and_apply_role $role
@@ -260,16 +283,13 @@
 
     #don't re-require...
     unless( Class::MOP::is_class_loaded($role) ){
-	eval Class::MOP::load_class($role) || die("Failed to load role: $role");
+        eval Class::MOP::load_class($role) || die("Failed to load role: $role");
     }
 
     carp("Using 'override' is strongly discouraged and may not behave ".
-	 "as you expect it to. Please use 'around'")
-	if scalar keys %{ $role->meta->get_override_method_modifiers_map };   
-
-    #apply the plugin to the anon subclass
-    die("Failed to apply plugin: $role") 
-	unless $role->meta->apply( $self );
+         "as you expect it to. Please use 'around'")
+        if scalar keys %{ $role->meta->get_override_method_modifiers_map };
+    die("Failed to apply plugin: $role") unless $role->meta->apply( $self );
 
     return 1;
 }
@@ -298,10 +318,10 @@
     my $self = shift;
 
     my $locator = Module::Pluggable::Object->new
-	( search_path => 
-	  [ map { join '::', ($_, $self->_plugin_ns) } $self->_plugin_app_ns ] 
-	);
-    return $locator;    
+        ( search_path =>
+          [ map { join '::', ($_, $self->_plugin_ns) } $self->_plugin_app_ns ]
+        );
+    return $locator;
 }
 
 =head2 meta

Modified: branches/upstream/libmoosex-object-pluggable-perl/current/t/lib/TestApp.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmoosex-object-pluggable-perl/current/t/lib/TestApp.pm?rev=12613&op=diff
==============================================================================
--- branches/upstream/libmoosex-object-pluggable-perl/current/t/lib/TestApp.pm (original)
+++ branches/upstream/libmoosex-object-pluggable-perl/current/t/lib/TestApp.pm Sun Jan 13 03:53:24 2008
@@ -14,4 +14,6 @@
 
 sub bor{ 'original bor' }
 
+__PACKAGE__->meta->make_immutable;
+
 1;




More information about the Pkg-perl-cvs-commits mailing list