Hello community, here is the log from the commit of package perl-Class-Load for openSUSE:Factory checked in at 2013-06-05 17:48:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Class-Load (Old) and /work/SRC/openSUSE:Factory/.perl-Class-Load.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Class-Load" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Class-Load/perl-Class-Load.changes 2012-03-06 14:06:00.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Class-Load.new/perl-Class-Load.changes 2013-06-05 17:48:43.000000000 +0200 @@ -1,0 +2,16 @@ +Mon Jun 3 15:33:02 UTC 2013 - [email protected] + +- updated to 0.20 + - The load_class() subroutine now returns the class name on success. Requested + by Caleb Cushing. RT #76931. + + - Exceptions and errors from Class::Load no longer contain references to line + numbers in Class::Load or Module::Runtime. This applies to exceptions thrown + by load_class, load_first_existing_class, and load_optional_class, as well + as the error returned by try_load_class. + + - Exceptions are now croaked properly so they appear to come from the calling + code, not from an internal subroutine. This makes the exceptions look more + like the ones thrown by Perl's require. RT #68663. + +------------------------------------------------------------------- Old: ---- Class-Load-0.18.tar.gz New: ---- Class-Load-0.20.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Class-Load.spec ++++++ --- /var/tmp/diff_new_pack.JFOyQZ/_old 2013-06-05 17:48:43.000000000 +0200 +++ /var/tmp/diff_new_pack.JFOyQZ/_new 2013-06-05 17:48:43.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Class-Load # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-Class-Load -Version: 0.18 +Version: 0.20 Release: 0 %define cpan_name Class-Load Summary: a working (require "Class::Name") and more @@ -25,9 +25,7 @@ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Class-Load/ Source: http://www.cpan.org/authors/id/D/DR/DROLSKY/%{cpan_name}-%{version}.tar.gz -%if 0%{?suse_version} <= 1110 Patch0: perl-Class-Load-old_test_more.patch -%endif BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl @@ -70,6 +68,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +# MANUAL %if 0%{?suse_version} <= 1110 %patch0 %endif ++++++ Class-Load-0.18.tar.gz -> Class-Load-0.20.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/Changes new/Class-Load-0.20/Changes --- old/Class-Load-0.18/Changes 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/Changes 2012-07-15 23:18:44.000000000 +0200 @@ -1,19 +1,42 @@ +0.20 2012-07-15 + +- Same as the most recently 0.19, but with a new version. + +0.19 2012-07-15 + +- Uploaded by Dave Rolsky, not realizing 0.19 was already used + +- The load_class() subroutine now returns the class name on success. Requested + by Caleb Cushing. RT #76931. + +- Exceptions and errors from Class::Load no longer contain references to line + numbers in Class::Load or Module::Runtime. This applies to exceptions thrown + by load_class, load_first_existing_class, and load_optional_class, as well + as the error returned by try_load_class. + +- Exceptions are now croaked properly so they appear to come from the calling + code, not from an internal subroutine. This makes the exceptions look more + like the ones thrown by Perl's require. RT #68663. + +0.19 2012-04-03 + +- Uploaded by doy (Jesse Luehrs) + +- No changes, reupload to fix indexing. + 0.18 2012-02-18 - Require Package::Stash 0.14+. Fixes RT #75095. Reported by Zefram. - 0.17 2012-02-12 - A bug in Class::Load caused test failures when Module::Runtime 0.012 was used with Perl 5.8.x. Reported by Zefram. RT #74897. ( Jesse Luehrs ) - 0.16 2012-02-12 - Require Module::Runtime 0.012, which has a number of useful bug fixes. - 0.15 2012-02-08 - Small test changes to accomodate latest version of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/MANIFEST new/Class-Load-0.20/MANIFEST --- old/Class-Load-0.18/MANIFEST 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/MANIFEST 2012-07-15 23:18:44.000000000 +0200 @@ -22,6 +22,7 @@ t/010-isa-false-positive.t t/011-without-xs.t t/012-without-implementation.t +t/013-errors.t t/lib/Class/Load/Error/DieAfterBeginIsa.pm t/lib/Class/Load/Error/DieAfterIsa.pm t/lib/Class/Load/Error/SyntaxErrorAfterIsa.pm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/META.json new/Class-Load-0.20/META.json --- old/Class-Load-0.18/META.json 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/META.json 2012-07-15 23:18:44.000000000 +0200 @@ -4,7 +4,7 @@ "Shawn M Moore <sartak at bestpractical.com>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 4.300006, CPAN::Meta::Converter version 2.113640", + "generated_by" : "Dist::Zilla version 4.300016, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], @@ -21,26 +21,26 @@ }, "runtime" : { "requires" : { - "Carp" : 0, - "Data::OptList" : 0, - "Exporter" : 0, + "Carp" : "0", + "Data::OptList" : "0", + "Exporter" : "0", "Module::Implementation" : "0.04", "Module::Runtime" : "0.012", "Package::Stash" : "0.14", - "Scalar::Util" : 0, - "Try::Tiny" : 0, - "base" : 0, - "strict" : 0, - "warnings" : 0 + "Scalar::Util" : "0", + "Try::Tiny" : "0", + "base" : "0", + "strict" : "0", + "warnings" : "0" } }, "test" : { "requires" : { - "Test::Fatal" : 0, + "Test::Fatal" : "0", "Test::More" : "0.88", - "Test::Requires" : 0, - "constant" : 0, - "version" : 0 + "Test::Requires" : "0", + "constant" : "0", + "version" : "0" } } }, @@ -56,6 +56,6 @@ "web" : "https://github.com/autarch/class-load" } }, - "version" : "0.18" + "version" : "0.20" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/META.yml new/Class-Load-0.20/META.yml --- old/Class-Load-0.18/META.yml 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/META.yml 2012-07-15 23:18:44.000000000 +0200 @@ -11,7 +11,7 @@ configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.300006, CPAN::Meta::Converter version 2.113640' +generated_by: 'Dist::Zilla version 4.300016, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -32,4 +32,4 @@ resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Load repository: git://github.com/autarch/class-load.git -version: 0.18 +version: 0.20 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/Makefile.PL new/Class-Load-0.20/Makefile.PL --- old/Class-Load-0.18/Makefile.PL 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/Makefile.PL 2012-07-15 23:18:44.000000000 +0200 @@ -38,7 +38,7 @@ "strict" => 0, "warnings" => 0 }, - "VERSION" => "0.18", + "VERSION" => "0.20", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/README new/Class-Load-0.20/README --- old/Class-Load-0.18/README 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/README 2012-07-15 23:18:44.000000000 +0200 @@ -1,7 +1,7 @@ This archive contains the distribution Class-Load, -version 0.18: +version 0.20: a working (require "Class::Name") and more diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/dist.ini new/Class-Load-0.20/dist.ini --- old/Class-Load-0.18/dist.ini 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/dist.ini 2012-07-15 23:18:44.000000000 +0200 @@ -3,7 +3,7 @@ license = Perl_5 copyright_holder = Shawn M Moore -version = 0.18 +version = 0.20 [NextRelease] format = %-8v %{yyyy-MM-dd}d diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/lib/Class/Load/PP.pm new/Class-Load-0.20/lib/Class/Load/PP.pm --- old/Class-Load-0.18/lib/Class/Load/PP.pm 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/lib/Class/Load/PP.pm 2012-07-15 23:18:44.000000000 +0200 @@ -1,6 +1,6 @@ package Class::Load::PP; { - $Class::Load::PP::VERSION = '0.18'; + $Class::Load::PP::VERSION = '0.20'; } use strict; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/lib/Class/Load.pm new/Class-Load-0.20/lib/Class/Load.pm --- old/Class-Load-0.18/lib/Class/Load.pm 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/lib/Class/Load.pm 2012-07-15 23:18:44.000000000 +0200 @@ -1,6 +1,6 @@ package Class::Load; { - $Class::Load::VERSION = '0.18'; + $Class::Load::VERSION = '0.20'; } use strict; use warnings; @@ -36,7 +36,7 @@ my $options = shift; my ($res, $e) = try_load_class($class, $options); - return 1 if $res; + return $class if $res; _croak($e); } @@ -129,7 +129,7 @@ return 0 if $e =~ _nonexistent_fail_re($class); - _croak($ERROR); + _croak($e); } sub try_load_class { @@ -184,14 +184,19 @@ } sub _error { - $ERROR = shift; + my $e = shift; + + $e =~ s/ at .+?Runtime\.pm line [0-9]+\.$//; + chomp $e; + + $ERROR = $e; return 0 unless wantarray; return 0, $ERROR; } sub _croak { require Carp; - local $Carp::CarpLevel = $Carp::CarpLevel + 1; + local $Carp::CarpLevel = $Carp::CarpLevel + 2; Carp::croak(shift); } @@ -209,7 +214,7 @@ =head1 VERSION -version 0.18 +version 0.20 =head1 SYNOPSIS @@ -256,6 +261,8 @@ $options{-version} ) >> internally, which will throw an error if the class's version is not equal to or greater than the version you requested. +This method will return the name of the class on success. + =head2 try_load_class Class::Name, \%options -> (0|1, error message) Returns 1 if the class was loaded, 0 if it was not. If the class was not diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/t/003-load-class.t new/Class-Load-0.20/t/003-load-class.t --- old/Class-Load-0.18/t/003-load-class.t 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/t/003-load-class.t 2012-07-15 23:18:44.000000000 +0200 @@ -6,51 +6,92 @@ use Test::Class::Load ':all'; use Test::Fatal; -ok(load_class('Class::Load::OK'), "loaded class OK"); -is($Class::Load::ERROR, undef); +is( load_class('Class::Load::OK'), 'Class::Load::OK', 'loaded class OK' ); +is( $Class::Load::ERROR, undef, 'ERROR is undef' ); -like( exception { - load_class('Class::Load::Nonexistent') -}, qr{^Can't locate Class/Load/Nonexistent.pm in \@INC}); -like($Class::Load::ERROR, qr{^Can't locate Class/Load/Nonexistent.pm in \@INC}); - -ok(load_class('Class::Load::OK'), "loaded class OK"); -is($Class::Load::ERROR, undef); - -like( exception { - load_class('Class::Load::SyntaxError') -}, qr{^Missing right curly or square bracket at }); -like($Class::Load::ERROR, qr{^Missing right curly or square bracket at }); - -ok(is_class_loaded('Class::Load::OK')); -ok(!is_class_loaded('Class::Load::Nonexistent')); -ok(!is_class_loaded('Class::Load::SyntaxError')); +like( + exception { + load_class('Class::Load::Nonexistent'); + }, + qr{^Can't locate Class/Load/Nonexistent.pm in \@INC}, + 'threw exception for nonexistent class' +); + +like( + $Class::Load::ERROR, + qr{^Can't locate Class/Load/Nonexistent.pm in \@INC}, + 'ERROR message for nonexistent class', +); + +ok( load_class('Class::Load::OK'), 'loaded class OK' ); +is( $Class::Load::ERROR, undef, 'ERROR is undef' ); + +like( + exception { + load_class('Class::Load::SyntaxError'); + }, + qr{^Missing right curly or square bracket at }, + 'exception contains syntax error message' +); + +like( + $Class::Load::ERROR, + qr{^Missing right curly or square bracket at }, + 'ERROR contains syntax error message' +); + +ok( is_class_loaded('Class::Load::OK') ); +ok( !is_class_loaded('Class::Load::Nonexistent') ); +ok( !is_class_loaded('Class::Load::SyntaxError') ); do { + package Class::Load::Inlined; sub inlined { 1 } }; -ok(load_class('Class::Load::Inlined'), "loaded class Inlined"); -is($Class::Load::ERROR, undef); -ok(is_class_loaded('Class::Load::Inlined')); - -like( exception { - load_class('Class::Load::VersionCheck', { -version => 43 }) -}, qr/^Class::Load::VersionCheck version 43 required/); - -ok(load_class('Class::Load::VersionCheck', { -version => 41 }), - "loaded class with version check"); - -ok(load_class('Class::Load::VersionCheck2', { -version => 41 }), - "loaded class with version check"); - -like( exception { - load_class('Class::Load::VersionCheck2', { -version => 43 }) -}, qr/^Class::Load::VersionCheck2 version 43 required/); - -like( exception { - load_class('__PACKAGE__') -}, qr/__PACKAGE__\.pm.*\@INC/, 'errors sanely on __PACKAGE__.pm' ); +is( + load_class('Class::Load::Inlined'), + 'Class::Load::Inlined', + 'loaded class Inlined' +); +is( $Class::Load::ERROR, undef ); +ok( is_class_loaded('Class::Load::Inlined') ); + +like( + exception { + load_class( 'Class::Load::VersionCheck', { -version => 43 } ); + }, + qr/^Class::Load::VersionCheck version 43 required/, + 'got expected error for load_class with explicit version' +); + +is( + load_class( 'Class::Load::VersionCheck', { -version => 41 } ), + 'Class::Load::VersionCheck', + 'loaded class with version check' +); + +is( + load_class( 'Class::Load::VersionCheck2', { -version => 41 } ), + 'Class::Load::VersionCheck2', + 'loaded class with version check' +); + +like( + exception { + load_class( 'Class::Load::VersionCheck2', { -version => 43 } ); + }, + qr/^Class::Load::VersionCheck2 version 43 required/, + 'got expected error for load_class with explicit version (after class has been loaded into memory)' +); + +like( + exception { + load_class('__PACKAGE__'); + }, + qr/__PACKAGE__\.pm.*\@INC/, + 'errors sanely on __PACKAGE__.pm' +); done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/t/013-errors.t new/Class-Load-0.20/t/013-errors.t --- old/Class-Load-0.18/t/013-errors.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Class-Load-0.20/t/013-errors.t 2012-07-15 23:18:44.000000000 +0200 @@ -0,0 +1,123 @@ +use strict; +use warnings; + +use Test::More 0.88; + +use lib 't/lib'; +use Test::Class::Load ':all'; + +my $file = __FILE__; + +{ +# line 1 + eval { load_class('Class::NonExistent') }; + my $e = $@; + + unlike( + $e, + qr/at .+Load\.pm line \d+/, + 'load_class exception does not refer to Class::Load internals' + ); + + unlike( + $e, + qr/at .+Runtime\.pm line \d+/, + 'load_class exception does not refer to Module::Runtime internals' + ); + + like( + $e, + qr/Can't locate [^\n]+ at \Q$file\E line 1/, + 'error appears from the spot that called load_class' + ); +} + +{ + my ( $ok, $e ) = try_load_class('Class::NonExistent::Take2'); + + unlike( + $e, + qr/at .+Load\.pm line \d+/, + 'try_load_class exception does not refer to Class::Load internals' + ); + + unlike( + $e, + qr/at .+Runtime\.pm line \d+/, + 'try_load_class exception does not refer to Module::Runtime internals' + ); +} + +{ +# line 2 + eval { load_first_existing_class('Class::NonExistent::Take3') }; + my $e = $@; + + unlike( + $e, + qr/at .+Load\.pm line \d+/, + 'load_first_existing_class exception does not refer to Class::Load internals' + ); + + unlike( + $e, + qr/at .+Runtime\.pm line \d+/, + 'load_first_existing_class exception does not refer to Module::Runtime internals' + ); + + like( + $e, + qr/Can't locate [^\n]+ at \Q$file\E line 2/, + 'error appears from the spot that called load_first_existing_class' + ); +} + +{ +# line 3 + eval { load_first_existing_class('Class::Load::SyntaxError') }; + my $e = $@; + + unlike( + $e, + qr/at .+Load\.pm line \d+/, + 'load_first_existing_class exception does not refer to Class::Load internals' + ); + + unlike( + $e, + qr/at .+Runtime\.pm line \d+/, + 'load_first_existing_class exception does not refer to Module::Runtime internals' + ); + + like( + $e, + qr/Compilation failed .+? at \Q$file\E line 3/s, + 'error appears from the spot that called load_first_existing_class' + ); +} + +{ +# line 4 + eval { load_optional_class('Class::Load::SyntaxError') }; + my $e = $@; + + unlike( + $e, + qr/at .+Load\.pm line \d+/, + 'load_optional_class exception does not refer to Class::Load internals' + ); + + unlike( + $e, + qr/at .+Runtime\.pm line \d+/, + 'load_optional_class exception does not refer to Module::Runtime internals' + ); + + like( + $e, + qr/Compilation failed .+? at \Q$file\E line 4/s, + 'error appears from the spot that called load_optional_class' + ); +} + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Class-Load-0.18/t/release-pod-coverage.t new/Class-Load-0.20/t/release-pod-coverage.t --- old/Class-Load-0.18/t/release-pod-coverage.t 2012-02-18 21:51:26.000000000 +0100 +++ new/Class-Load-0.20/t/release-pod-coverage.t 2012-07-15 23:18:44.000000000 +0200 @@ -34,12 +34,10 @@ } } - push @{$trustme}, qr/^BUILD$/; - pod_coverage_ok( - $module, { - coverage_class => 'Pod::Coverage::Moose', - trustme => $trustme, + $module, + { + trustme => $trustme, }, "Pod coverage for $module" ); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
