r14914 - in /branches/upstream/libclass-inspector-perl/current: 97_meta.t 98_pod.t 99_pmv.t Changes MANIFEST META.yml lib/Class/Inspector.pm t/01_compile.t t/02_main.t t/03_inc_to_local.t t/98_pod.t t/99_pmv.t
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Thu Feb 14 11:56:58 UTC 2008
Author: eloy
Date: Thu Feb 14 11:56:57 2008
New Revision: 14914
URL: http://svn.debian.org/wsvn/?sc=1&rev=14914
Log:
[svn-upgrade] Integrating new upstream version, libclass-inspector-perl (1.20)
Added:
branches/upstream/libclass-inspector-perl/current/97_meta.t
branches/upstream/libclass-inspector-perl/current/98_pod.t
branches/upstream/libclass-inspector-perl/current/99_pmv.t
branches/upstream/libclass-inspector-perl/current/t/03_inc_to_local.t
Removed:
branches/upstream/libclass-inspector-perl/current/t/98_pod.t
branches/upstream/libclass-inspector-perl/current/t/99_pmv.t
Modified:
branches/upstream/libclass-inspector-perl/current/Changes
branches/upstream/libclass-inspector-perl/current/MANIFEST
branches/upstream/libclass-inspector-perl/current/META.yml
branches/upstream/libclass-inspector-perl/current/lib/Class/Inspector.pm
branches/upstream/libclass-inspector-perl/current/t/01_compile.t
branches/upstream/libclass-inspector-perl/current/t/02_main.t
Added: branches/upstream/libclass-inspector-perl/current/97_meta.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/97_meta.t?rev=14914&op=file
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/97_meta.t (added)
+++ branches/upstream/libclass-inspector-perl/current/97_meta.t Thu Feb 14 11:56:57 2008
@@ -1,0 +1,27 @@
+#!/usr/bin/perl
+
+# Test that our META.yml file matches the current specification.
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my $MODULE = 'Test::CPAN::Meta 0.08';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" );
+ : plan( skip_all => "$MODULE not available for testing" );
+}
+
+meta_yaml_ok();
Added: branches/upstream/libclass-inspector-perl/current/98_pod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/98_pod.t?rev=14914&op=file
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/98_pod.t (added)
+++ branches/upstream/libclass-inspector-perl/current/98_pod.t Thu Feb 14 11:56:57 2008
@@ -1,0 +1,72 @@
+#!/usr/bin/perl
+
+# Test that the syntax of our POD documentation is valid
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my $MODULE = 'Test::Pod 1.00';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" );
+ : plan( skip_all => "$MODULE not available for testing" );
+}
+
+all_pod_files_ok();
+
+
+
+
+
+
+#####################################################################
+# WARNING: INSANE BLACK MAGIC
+#####################################################################
+
+# Hack Pod::Simple::BlackBox to ignore the Test::Inline
+# "Extended Begin" syntax.
+# For example, "=begin has more than one word errors"
+my $begin;
+if ( $Test::Pod::VERSION ) {
+ $begin = \&Pod::Simple::BlackBox::_ponder_begin;
+}
+sub mybegin {
+ my $para = $_[1];
+ my $content = join ' ', splice @$para, 2;
+ $content =~ s/^\s+//s;
+ $content =~ s/\s+$//s;
+ my @words = split /\s+/, $content;
+ if ( $words[0] =~ /^test(?:ing)?\z/s ) {
+ foreach ( 2 .. $#$para ) {
+ $para->[$_] = '';
+ }
+ $para->[2] = $words[0];
+ }
+
+ # Continue as normal
+ push @$para, @words;
+ return &$begin(@_);
+}
+
+SCOPE: {
+ local $^W = 0;
+ if ( $Test::Pod::VERSION ) {
+ *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
+ }
+}
+
+#####################################################################
+# END BLACK MAGIC
+#####################################################################
Added: branches/upstream/libclass-inspector-perl/current/99_pmv.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/99_pmv.t?rev=14914&op=file
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/99_pmv.t (added)
+++ branches/upstream/libclass-inspector-perl/current/99_pmv.t Thu Feb 14 11:56:57 2008
@@ -1,0 +1,27 @@
+#!/usr/bin/perl
+
+# Test that our declared minimum Perl version matches our syntax
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my $MODULE = 'Test::MinimumVersion 0.007';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" );
+ : plan( skip_all => "$MODULE not available for testing" );
+}
+
+all_minimum_version_from_metayml_ok();
Modified: branches/upstream/libclass-inspector-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/Changes?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/Changes (original)
+++ branches/upstream/libclass-inspector-perl/current/Changes Thu Feb 14 11:56:57 2008
@@ -1,4 +1,11 @@
Revision history for Perl extension Class::Inspector.
+
+1.20 Tue 12 Feb 2008
+ - CPAN Testers results look good for 1.19_01,
+ converting to a production release.
+
+1.19_01 Mon 11 Feb 2008
+ - Bug fix to adapt to changes to File::Spec
1.18 Thu 8 Nov 2007
- Incremental release, no functional changes
Modified: branches/upstream/libclass-inspector-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/MANIFEST?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/MANIFEST (original)
+++ branches/upstream/libclass-inspector-perl/current/MANIFEST Thu Feb 14 11:56:57 2008
@@ -1,3 +1,6 @@
+97_meta.t
+98_pod.t
+99_pmv.t
Changes
inc/Module/Install.pm
inc/Module/Install/Base.pm
@@ -15,5 +18,4 @@
README
t/01_compile.t
t/02_main.t
-t/98_pod.t
-t/99_pmv.t
+t/03_inc_to_local.t
Modified: branches/upstream/libclass-inspector-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/META.yml?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/META.yml (original)
+++ branches/upstream/libclass-inspector-perl/current/META.yml Thu Feb 14 11:56:57 2008
@@ -5,7 +5,7 @@
build_requires:
Test::More: 0.47
distribution_type: module
-generated_by: Module::Install version 0.68
+generated_by: Module::Install version 0.680
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
@@ -18,4 +18,4 @@
requires:
File::Spec: 0.80
perl: 5.005
-version: 1.18
+version: 1.20
Modified: branches/upstream/libclass-inspector-perl/current/lib/Class/Inspector.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/lib/Class/Inspector.pm?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/lib/Class/Inspector.pm (original)
+++ branches/upstream/libclass-inspector-perl/current/lib/Class/Inspector.pm Thu Feb 14 11:56:57 2008
@@ -40,22 +40,22 @@
=cut
use 5.005;
-# We don't want to use strict refs, since we do a lot of things in here
-# that arn't strict refs friendly.
+# We don't want to use strict refs anywhere in this module, since we do a
+# lot of things in here that arn't strict refs friendly.
use strict qw{vars subs};
use File::Spec ();
# Globals
-use vars qw{$VERSION $RE_IDENT $RE_CLASS $UNIX};
+use vars qw{$VERSION $RE_IDENTIFIER $RE_CLASS $UNIX};
BEGIN {
- $VERSION = '1.18';
+ $VERSION = '1.20';
# Predefine some regexs
- $RE_IDENT = qr/\A[^\W\d]\w*\z/s;
- $RE_CLASS = qr/\A[^\W\d]\w*(?:(?:'|::)\w+)*\z/s;
+ $RE_IDENTIFIER = qr/\A[^\W\d]\w*\z/s;
+ $RE_CLASS = qr/\A[^\W\d]\w*(?:(?:\'|::)\w+)*\z/s;
# Are we on something Unix-like?
- $UNIX = !! ( $File::Spec::ISA[0] eq 'File::Spec::Unix' );
+ $UNIX = !! ( $File::Spec::ISA[0] eq 'File::Spec::Unix' );
}
@@ -151,7 +151,7 @@
sub filename {
my $class = shift;
my $name = $class->_class(shift) or return undef;
- File::Spec->catfile( split /(?:'|::)/, $name ) . '.pm';
+ File::Spec->catfile( split /(?:\'|::)/, $name ) . '.pm';
}
=pod
@@ -236,7 +236,7 @@
return undef unless $class->loaded( $name );
# Get all the CODE symbol table entries
- my @functions = sort grep { /$RE_IDENT/o }
+ my @functions = sort grep { /$RE_IDENTIFIER/o }
grep { defined &{"${name}::$_"} }
keys %{"${name}::"};
\@functions;
@@ -264,7 +264,7 @@
# Get all the CODE symbol table entries, but return
# the actual CODE refs this time.
my @functions = map { \&{"${name}::$_"} }
- sort grep { /$RE_IDENT/o }
+ sort grep { /$RE_IDENTIFIER/o }
grep { defined &{"${name}::$_"} }
keys %{"${name}::"};
\@functions;
@@ -419,7 +419,7 @@
my %methods = ();
foreach my $namespace ( @path ) {
my @functions = grep { ! $methods{$_} }
- grep { /$RE_IDENT/o }
+ grep { /$RE_IDENTIFIER/o }
grep { defined &{"${namespace}::$_"} }
keys %{"${namespace}::"};
foreach ( @functions ) {
@@ -504,7 +504,7 @@
grep {
substr($_, -2, 2, '') eq '::'
and
- /$RE_IDENT/o
+ /$RE_IDENTIFIER/o
}
keys %{"${name}::"};
}
@@ -575,20 +575,22 @@
sub _inc_filename {
my $class = shift;
my $name = $class->_class(shift) or return undef;
- join( '/', split /(?:'|::)/, $name ) . '.pm';
+ join( '/', split /(?:\'|::)/, $name ) . '.pm';
}
# Convert INC-specific file name to local file name
sub _inc_to_local {
- my $class = shift;
-
# Shortcut in the Unix case
- return $_[0] if $UNIX;
-
- # Get the INC filename and convert
- my $inc_name = shift or return undef;
- my ($vol, $dir, $file) = File::Spec::Unix->splitpath( $inc_name );
- $dir = File::Spec->catdir( File::Spec::Unix->splitdir( $dir || "" ) );
+ return $_[1] if $UNIX;
+
+ # On other places, we have to deal with an unusual path that might look
+ # like C:/foo/bar.pm which doesn't fit ANY normal pattern.
+ # Putting it through splitpath/dir and back again seems to normalise
+ # it to a reasonable amount.
+ my $class = shift;
+ my $inc_name = shift or return undef;
+ my ($vol, $dir, $file) = File::Spec->splitpath( $inc_name );
+ $dir = File::Spec->catdir( File::Spec->splitdir( $dir || "" ) );
File::Spec->catpath( $vol, $dir, $file || "" );
}
Modified: branches/upstream/libclass-inspector-perl/current/t/01_compile.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/t/01_compile.t?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/t/01_compile.t (original)
+++ branches/upstream/libclass-inspector-perl/current/t/01_compile.t Thu Feb 14 11:56:57 2008
@@ -1,8 +1,6 @@
#!/usr/bin/perl
-# Load testing for Class::Inspector
-
-# This test only tests that the module compiles.
+# Compile testing for Class::Inspector
use strict;
BEGIN {
@@ -12,12 +10,6 @@
use Test::More tests => 2;
-
-
-# Check their perl version
ok( $] >= 5.005, "Your perl is new enough" );
-# Does the module load
use_ok('Class::Inspector');
-
-exit();
Modified: branches/upstream/libclass-inspector-perl/current/t/02_main.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/t/02_main.t?rev=14914&op=diff
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/t/02_main.t (original)
+++ branches/upstream/libclass-inspector-perl/current/t/02_main.t Thu Feb 14 11:56:57 2008
@@ -1,14 +1,14 @@
#!/usr/bin/perl
-# Formal testing for Class::Inspector
-
-# Do all the tests on ourself, since we know we will be loaded.
-
+# Unit testing for Class::Inspector
+
+# Do all the tests on ourself, where possible, as we know we will be loaded.
use strict;
BEGIN {
$| = 1;
- $^W = 1;
+ $^W = 1;
+ # $DB::single = 1;
}
use Test::More tests => 54;
@@ -118,16 +118,21 @@
# Check the methods method.
# First, defined a new subclass of Class::Inspector with some additional methods
-package Class::Inspector::Dummy;
-
-use strict;
-use base 'Class::Inspector';
-
-sub _a_first { 1; }
-sub adummy1 { 1; }
-sub _dummy2 { 1; }
-sub dummy3 { 1; }
-sub installed { 1; }
+CLASS: {
+ package Class::Inspector::Dummy;
+
+ use strict;
+ BEGIN {
+ require Class::Inspector;
+ @Class::Inspector::Dummy::ISA = 'Class::Inspector';
+ }
+
+ sub _a_first { 1; }
+ sub adummy1 { 1; }
+ sub _dummy2 { 1; }
+ sub dummy3 { 1; }
+ sub installed { 1; }
+}
package main;
@@ -267,7 +272,7 @@
}
# Check trivial ->find cases
-{
+SCOPE: {
is( CI->subclasses( '' ), undef, '->subclasses(bad) returns undef' );
is( CI->subclasses( BAD ), '', '->subclasses(none) returns false' );
my $rv = CI->subclasses( CI );
Added: branches/upstream/libclass-inspector-perl/current/t/03_inc_to_local.t
URL: http://svn.debian.org/wsvn/branches/upstream/libclass-inspector-perl/current/t/03_inc_to_local.t?rev=14914&op=file
==============================================================================
--- branches/upstream/libclass-inspector-perl/current/t/03_inc_to_local.t (added)
+++ branches/upstream/libclass-inspector-perl/current/t/03_inc_to_local.t Thu Feb 14 11:56:57 2008
@@ -1,0 +1,37 @@
+#!/usr/bin/perl
+
+# Unit testing for Class::Inspector
+
+# Do all the tests on ourself, where possible, as we know we will be loaded.
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+use Test::More tests => 2;
+use Class::Inspector ();
+
+
+
+
+#####################################################################
+# Try the simplistic Win32 approach
+
+SKIP: {
+ skip( "Skipping Win32 test", 1 ) unless $^O eq 'MSWin32';
+ my $inc = 'C:/foo/bar.pm';
+ my $local = Class::Inspector->_inc_to_local($inc);
+ is( $local, 'C:\foo\bar.pm', '->_inc_to_local ok' );
+}
+
+
+
+
+
+#####################################################################
+# More general tests
+
+my $module = Class::Inspector->_inc_to_local($INC{'Class/Inspector.pm'});
+ok( -f $module, 'Found ourself' );
More information about the Pkg-perl-cvs-commits
mailing list