[Bps-public-commit] r19618 - in Net-Google-Code/trunk: . inc/Module inc/Module/Install xt

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon May 11 04:56:22 EDT 2009


Author: sunnavy
Date: Mon May 11 04:56:21 2009
New Revision: 19618

Added:
   Net-Google-Code/trunk/inc/Module/Install/AuthorTests.pm
   Net-Google-Code/trunk/xt/
   Net-Google-Code/trunk/xt/kwalitee.t
      - copied unchanged from r17691, /Net-Google-Code/trunk/t/kwalitee.t
   Net-Google-Code/trunk/xt/perlcritic.t
      - copied unchanged from r17362, /Net-Google-Code/trunk/t/perlcritic.t
   Net-Google-Code/trunk/xt/pod-coverage.t
      - copied unchanged from r17362, /Net-Google-Code/trunk/t/pod-coverage.t
   Net-Google-Code/trunk/xt/pod.t
      - copied unchanged from r17362, /Net-Google-Code/trunk/t/pod.t
Removed:
   Net-Google-Code/trunk/t/kwalitee.t
   Net-Google-Code/trunk/t/perlcritic.t
   Net-Google-Code/trunk/t/pod-coverage.t
   Net-Google-Code/trunk/t/pod.t
Modified:
   Net-Google-Code/trunk/MANIFEST
   Net-Google-Code/trunk/META.yml
   Net-Google-Code/trunk/Makefile.PL
   Net-Google-Code/trunk/inc/Module/Install.pm
   Net-Google-Code/trunk/inc/Module/Install/AutoInstall.pm
   Net-Google-Code/trunk/inc/Module/Install/Base.pm
   Net-Google-Code/trunk/inc/Module/Install/Can.pm
   Net-Google-Code/trunk/inc/Module/Install/Fetch.pm
   Net-Google-Code/trunk/inc/Module/Install/Include.pm
   Net-Google-Code/trunk/inc/Module/Install/Makefile.pm
   Net-Google-Code/trunk/inc/Module/Install/Metadata.pm
   Net-Google-Code/trunk/inc/Module/Install/Win32.pm
   Net-Google-Code/trunk/inc/Module/Install/WriteAll.pm

Log:
move author tests to xt/, also update M::I and package files

Modified: Net-Google-Code/trunk/MANIFEST
==============================================================================
--- Net-Google-Code/trunk/MANIFEST	(original)
+++ Net-Google-Code/trunk/MANIFEST	Mon May 11 04:56:21 2009
@@ -2,6 +2,7 @@
 Changes
 inc/Module/AutoInstall.pm
 inc/Module/Install.pm
+inc/Module/Install/AuthorTests.pm
 inc/Module/Install/AutoInstall.pm
 inc/Module/Install/Base.pm
 inc/Module/Install/Can.pm
@@ -15,19 +16,17 @@
 lib/Net/Google/Code/Downloads.pm
 lib/Net/Google/Code/Home.pm
 lib/Net/Google/Code/Issue.pm
-lib/Net/Google/Code/IssueAttachment.pm
-lib/Net/Google/Code/IssueComment.pm
-lib/Net/Google/Code/IssuePropChange.pm
-lib/Net/Google/Code/IssueSearch.pm
-lib/Net/Google/Code/Mechanize.pm
+lib/Net/Google/Code/Issue/Attachment.pm
+lib/Net/Google/Code/Issue/Comment.pm
+lib/Net/Google/Code/Issue/PropChange.pm
+lib/Net/Google/Code/Issue/Search.pm
 lib/Net/Google/Code/Role.pm
-lib/Net/Google/Code/Role/Connectable.pm
-lib/Net/Google/Code/Role/RemoteFile.pm
+lib/Net/Google/Code/Role/Fetchable.pm
 lib/Net/Google/Code/Role/URL.pm
 lib/Net/Google/Code/Wiki.pm
 lib/Net/Google/Code/WikiEntry.pm
 Makefile.PL
-MANIFEST
+MANIFEST			This list of files
 META.yml
 README
 t/00.load.t
@@ -37,10 +36,6 @@
 t/10.downloads.t
 t/11.wiki.t
 t/20.code.t
-t/kwalitee.t
-t/perlcritic.t
-t/pod-coverage.t
-t/pod.t
 t/sample/02.issue.html
 t/sample/10.download.html
 t/sample/10.download.xml
@@ -49,3 +44,7 @@
 t/sample/11.wiki.html
 t/sample/11.wiki.TestPage.html
 t/sample/20.code.html
+xt/kwalitee.t
+xt/perlcritic.t
+xt/pod-coverage.t
+xt/pod.t

Modified: Net-Google-Code/trunk/META.yml
==============================================================================
--- Net-Google-Code/trunk/META.yml	(original)
+++ Net-Google-Code/trunk/META.yml	Mon May 11 04:56:21 2009
@@ -7,7 +7,7 @@
   Test::MockModule: 0
   Test::More: 0
 distribution_type: module
-generated_by: 'Module::Install version 0.77'
+generated_by: 'Module::Install version 0.79'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html

Modified: Net-Google-Code/trunk/Makefile.PL
==============================================================================
--- Net-Google-Code/trunk/Makefile.PL	(original)
+++ Net-Google-Code/trunk/Makefile.PL	Mon May 11 04:56:21 2009
@@ -14,6 +14,8 @@
 requires 'Params::Validate';
 requires 'XML::Atom';
 
+recursive_author_tests('xt/');
+
 auto_install;
 
 WriteAll;

Modified: Net-Google-Code/trunk/inc/Module/Install.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install.pm	Mon May 11 04:56:21 2009
@@ -30,7 +30,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.77';
+	$VERSION = '0.79';
 
 	*inc::Module::Install::VERSION = *VERSION;
 	@inc::Module::Install::ISA     = __PACKAGE__;
@@ -250,7 +250,7 @@
 sub load_extensions {
 	my ($self, $path, $top) = @_;
 
-	unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+	unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
 		unshift @INC, $self->{prefix};
 	}
 
@@ -366,4 +366,4 @@
 
 1;
 
-# Copyright 2008 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.

Added: Net-Google-Code/trunk/inc/Module/Install/AuthorTests.pm
==============================================================================
--- (empty file)
+++ Net-Google-Code/trunk/inc/Module/Install/AuthorTests.pm	Mon May 11 04:56:21 2009
@@ -0,0 +1,59 @@
+#line 1
+package Module::Install::AuthorTests;
+
+use 5.005;
+use strict;
+use Module::Install::Base;
+use Carp ();
+
+#line 16
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+  $VERSION = '0.002';
+  $ISCORE  = 1;
+  @ISA     = qw{Module::Install::Base};
+}
+
+#line 42
+
+sub author_tests {
+  my ($self, @dirs) = @_;
+  _add_author_tests($self, \@dirs, 0);
+}
+
+#line 56
+
+sub recursive_author_tests {
+  my ($self, @dirs) = @_;
+  _add_author_tests($self, \@dirs, 1);
+}
+
+sub _wanted {
+  my $href = shift;
+  sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _add_author_tests {
+  my ($self, $dirs, $recurse) = @_;
+  return unless $Module::Install::AUTHOR;
+
+  my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
+
+  # XXX: pick a default, later -- rjbs, 2008-02-24
+  my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
+     @dirs = grep { -d } @dirs;
+
+  if ($recurse) {
+    require File::Find;
+    my %test_dir;
+    File::Find::find(_wanted(\%test_dir), @dirs);
+    $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
+  } else {
+    $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
+  }
+}
+
+#line 107
+
+1;

Modified: Net-Google-Code/trunk/inc/Module/Install/AutoInstall.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/AutoInstall.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/AutoInstall.pm	Mon May 11 04:56:21 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: Net-Google-Code/trunk/inc/Module/Install/Base.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Base.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Base.pm	Mon May 11 04:56:21 2009
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.77';
+$VERSION = '0.79';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: Net-Google-Code/trunk/inc/Module/Install/Can.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Can.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Can.pm	Mon May 11 04:56:21 2009
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: Net-Google-Code/trunk/inc/Module/Install/Fetch.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Fetch.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Fetch.pm	Mon May 11 04:56:21 2009
@@ -6,20 +6,20 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
 
 sub get_file {
     my ($self, %args) = @_;
-    my ($scheme, $host, $path, $file) = 
+    my ($scheme, $host, $path, $file) =
         $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
 
     if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
         $args{url} = $args{ftp_url}
             or (warn("LWP support unavailable!\n"), return);
-        ($scheme, $host, $path, $file) = 
+        ($scheme, $host, $path, $file) =
             $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
     }
 

Modified: Net-Google-Code/trunk/inc/Module/Install/Include.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Include.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Include.pm	Mon May 11 04:56:21 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: Net-Google-Code/trunk/inc/Module/Install/Makefile.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Makefile.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Makefile.pm	Mon May 11 04:56:21 2009
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -64,7 +64,7 @@
 	my $self  = shift;
 	my $clean = $self->makemaker_args->{clean} ||= {};
 	  %$clean = (
-		%$clean, 
+		%$clean,
 		FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
 	);
 }
@@ -73,7 +73,7 @@
 	my $self      = shift;
 	my $realclean = $self->makemaker_args->{realclean} ||= {};
 	  %$realclean = (
-		%$realclean, 
+		%$realclean,
 		FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
 	);
 }
@@ -124,7 +124,7 @@
 
 	$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
 
-	# Generate the 
+	# Generate the
 	my $args = $self->makemaker_args;
 	$args->{DISTNAME} = $self->name;
 	$args->{NAME}     = $self->module_name || $self->name;
@@ -196,7 +196,7 @@
 	my $top_class     = ref($self->_top) || '';
 	my $top_version   = $self->_top->VERSION || '';
 
-	my $preamble = $self->preamble 
+	my $preamble = $self->preamble
 		? "# Preamble by $top_class $top_version\n"
 			. $self->preamble
 		: '';

Modified: Net-Google-Code/trunk/inc/Module/Install/Metadata.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Metadata.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Metadata.pm	Mon May 11 04:56:21 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -176,18 +176,15 @@
 		"Did not provide a value to perl_version()"
 	);
 
-	# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
-	# numbers (eg, 5.006001 or 5.008009).
+	# Normalize the version
+	$version = $self->_perl_version($version);
 
-	$version =~ s/^(\d+)\.(\d+)\.(\d+)$/sprintf("%d.%03d%03d",$1,$2,$3)/e;
-
-	$version =~ s/_.+$//;
-	$version = $version + 0; # Numify
+	# We don't support the reall old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
+
 	$self->{values}{perl_version} = $version;
-	return 1;
 }
 
 sub license {
@@ -451,9 +448,6 @@
 		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 ) {
-					print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
-				}
 				$self->license($license);
 				return 1;
 			}
@@ -482,19 +476,70 @@
 	return 1;
 }
 
-sub install_script {
+# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+# numbers (eg, 5.006001 or 5.008009).
+# Also, convert double-part versions (eg, 5.8)
+sub _perl_version {
+	my $v = $_[-1];
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
+	$v =~ s/(\.\d\d\d)000$/$1/;
+	$v =~ s/_.+$//;
+	if ( ref($v) ) {
+		$v = $v + 0; # Numify
+	}
+	return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+	$_[0]->write_mymeta;
+}
+
+sub write_mymeta {
 	my $self = shift;
-	my $args = $self->makemaker_args;
-	my $exe  = $args->{EXE_FILES} ||= [];
-        foreach ( @_ ) {
-		if ( -f $_ ) {
-			push @$exe, $_;
-		} elsif ( -d 'script' and -f "script/$_" ) {
-			push @$exe, "script/$_";
-		} else {
-			die("Cannot find script '$_'");
+	
+	# If there's no existing META.yml there is nothing we can do
+	return unless -f 'META.yml';
+
+	# Merge the perl version into the dependencies
+	my $val  = $self->Meta->{values};
+	my $perl = delete $val->{perl_version};
+	if ( $perl ) {
+		$val->{requires} ||= [];
+		my $requires = $val->{requires};
+
+		# Canonize to three-dot version after Perl 5.6
+		if ( $perl >= 5.006 ) {
+			$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
 		}
+		unshift @$requires, [ perl => $perl ];
 	}
+
+	# Load the advisory META.yml file
+	require YAML::Tiny;
+	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my $meta = $yaml[0];
+
+	# Overwrite the non-configure dependency hashs
+	delete $meta->{requires};
+	delete $meta->{build_requires};
+	delete $meta->{recommends};
+	if ( exists $val->{requires} ) {
+		$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+	}
+	if ( exists $val->{build_requires} ) {
+		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+	}
+
+	# Save as the MYMETA.yml file
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
 }
 
 1;

Modified: Net-Google-Code/trunk/inc/Module/Install/Win32.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/Win32.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/Win32.pm	Mon May 11 04:56:21 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: Net-Google-Code/trunk/inc/Module/Install/WriteAll.pm
==============================================================================
--- Net-Google-Code/trunk/inc/Module/Install/WriteAll.pm	(original)
+++ Net-Google-Code/trunk/inc/Module/Install/WriteAll.pm	Mon May 11 04:56:21 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.77';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }



More information about the Bps-public-commit mailing list