r30826 - in /trunk/libclass-mop-perl: ./ debian/ lib/ lib/Class/ lib/Class/MOP/ lib/Class/MOP/Method/ t/ t/lib/ t/lib/TestClassLoaded/
bricas-guest at users.alioth.debian.org
bricas-guest at users.alioth.debian.org
Wed Feb 18 13:32:47 UTC 2009
Author: bricas-guest
Date: Wed Feb 18 13:32:43 2009
New Revision: 30826
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30826
Log:
New upstream release
Added:
trunk/libclass-mop-perl/t/lib/TestClassLoaded/
- copied from r30825, branches/upstream/libclass-mop-perl/current/t/lib/TestClassLoaded/
trunk/libclass-mop-perl/t/lib/TestClassLoaded2.pm
- copied unchanged from r30825, branches/upstream/libclass-mop-perl/current/t/lib/TestClassLoaded2.pm
trunk/libclass-mop-perl/t/lib/TestClassLoaded3.pm
- copied unchanged from r30825, branches/upstream/libclass-mop-perl/current/t/lib/TestClassLoaded3.pm
Removed:
trunk/libclass-mop-perl/t/306_is_class_loaded.t
Modified:
trunk/libclass-mop-perl/Changes
trunk/libclass-mop-perl/MANIFEST
trunk/libclass-mop-perl/META.yml
trunk/libclass-mop-perl/MOP.xs
trunk/libclass-mop-perl/Makefile.PL
trunk/libclass-mop-perl/README
trunk/libclass-mop-perl/debian/changelog
trunk/libclass-mop-perl/lib/Class/MOP.pm
trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm
trunk/libclass-mop-perl/lib/Class/MOP/Class.pm
trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm
trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm
trunk/libclass-mop-perl/lib/Class/MOP/Method.pm
trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm
trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm
trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm
trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm
trunk/libclass-mop-perl/lib/Class/MOP/Module.pm
trunk/libclass-mop-perl/lib/Class/MOP/Object.pm
trunk/libclass-mop-perl/lib/Class/MOP/Package.pm
trunk/libclass-mop-perl/lib/metaclass.pm
trunk/libclass-mop-perl/t/010_self_introspection.t
trunk/libclass-mop-perl/t/083_load_class.t
Modified: trunk/libclass-mop-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/Changes?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/Changes (original)
+++ trunk/libclass-mop-perl/Changes Wed Feb 18 13:32:43 2009
@@ -1,6 +1,33 @@
Revision history for Perl extension Class-MOP.
-0.76
+0.77 Sat, February 14, 2009
+ * MOP.xs
+ - Avoid assertion errors on debugging perls in is_class_loaded
+ (Florian Ragwitz)
+
+ * Class::MOP
+ - Fixed various corner cases where is_class_loaded incorrectly
+ returned true for a class that wasn't really loaded. (Dave
+ Rolsky)
+
+ * Class::MOP::Class
+ - Add get_all_method_names (Sartak)
+ - Add a wrapped_method_metaclass attribute (Florian Ragwitz)
+
+ * Class::MOP::Package
+ - Disable deprecated get_all_package_symbols in list
+ context. (Florian Ragwitz)
+
+ * Makefile.PL
+ - Make sure we generate a BSD-compatible Makefile (Florian
+ Ragwitz)
+
+ * Class::MOP::Class
+ - The mispelled "check_metaclass_compatability" method we've
+ kept around for backwards compat_i_bility will be removed in a
+ near future release. You've been warned.
+
+0.76 Thu, January 22, 2009
* Class::MOP::Method::Generated
- Added new private methods to support code generation, which
are being used by Moose and can be used by MooseX
Modified: trunk/libclass-mop-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/MANIFEST?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/MANIFEST (original)
+++ trunk/libclass-mop-perl/MANIFEST Wed Feb 18 13:32:43 2009
@@ -88,7 +88,6 @@
t/303_RT_39001_fix.t
t/304_constant_codeinfo.t
t/305_RT_41255.t
-t/306_is_class_loaded.t
t/header_pp.inc
t/lib/BinaryTree.pm
t/lib/MyMetaClass.pm
@@ -98,5 +97,8 @@
t/lib/MyMetaClass/Random.pm
t/lib/SyntaxError.pm
t/lib/TestClassLoaded.pm
+t/lib/TestClassLoaded/Sub.pm
+t/lib/TestClassLoaded2.pm
+t/lib/TestClassLoaded3.pm
typemap
META.yml Module meta-data (added by MakeMaker)
Modified: trunk/libclass-mop-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/META.yml?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/META.yml (original)
+++ trunk/libclass-mop-perl/META.yml Wed Feb 18 13:32:43 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Class-MOP
-version: 0.76
+version: 0.77
abstract: A Meta Object Protocol for Perl 5
author:
- Stevan Little <stevan at iinteractive.com>
Modified: trunk/libclass-mop-perl/MOP.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/MOP.xs?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/MOP.xs (original)
+++ trunk/libclass-mop-perl/MOP.xs Wed Feb 18 13:32:43 2009
@@ -344,6 +344,9 @@
PUSHs(newSVpv(name, 0));
}
+# This is some pretty grotty logic. It _should_ be parallel to the
+# pure Perl version in lib/Class/MOP.pm, so if you want to understand
+# it we suggest you start there.
void
is_class_loaded(klass=&PL_sv_undef)
SV *klass
@@ -351,7 +354,7 @@
HV *stash;
char *key;
I32 keylen;
- GV *gv;
+ SV *gv;
PPCODE:
if (!SvPOK(klass) || !SvCUR(klass)) {
XSRETURN_NO;
@@ -364,8 +367,18 @@
if (hv_exists_ent (stash, key_VERSION, hash_VERSION)) {
HE *version = hv_fetch_ent(stash, key_VERSION, 0, hash_VERSION);
- if (version && HeVAL(version) && GvSV(HeVAL(version))) {
- XSRETURN_YES;
+ SV *version_sv;
+ if (version && HeVAL(version) && (version_sv = GvSV(HeVAL(version)))) {
+ if (SvROK(version_sv)) {
+ SV *version_sv_ref = SvRV(version_sv);
+
+ if (SvOK(version_sv_ref)) {
+ XSRETURN_YES;
+ }
+ }
+ else if (SvOK(version_sv)) {
+ XSRETURN_YES;
+ }
}
}
@@ -377,7 +390,7 @@
}
(void)hv_iterinit(stash);
- while ((gv = (GV *)hv_iternextsv(stash, &key, &keylen))) {
+ while ((gv = hv_iternextsv(stash, &key, &keylen))) {
if (keylen <= 0) {
continue;
}
@@ -386,8 +399,7 @@
continue;
}
- if (!isGV(gv) || GvCV(gv) || GvSV(gv) || GvAV(gv)
- || GvHV(gv) || GvIO(gv) || GvFORM(gv)) {
+ if (!isGV(gv) || GvCV(gv)) {
XSRETURN_YES;
}
}
@@ -413,7 +425,6 @@
XSRETURN_EMPTY;
}
-
PUTBACK;
if ( (he = hv_fetch_ent((HV *)SvRV(self), key_package, 0, hash_package)) ) {
@@ -422,34 +433,11 @@
if (!stash) {
- switch (GIMME_V) {
- case G_SCALAR: XSRETURN_UNDEF; break;
- case G_ARRAY: XSRETURN_EMPTY; break;
- }
+ XSRETURN_UNDEF;
}
symbols = get_all_package_symbols(stash, filter);
-
- switch (GIMME_V) {
- case G_SCALAR:
- PUSHs(sv_2mortal(newRV_inc((SV *)symbols)));
- break;
- case G_ARRAY:
- warn("Class::MOP::Package::get_all_package_symbols in list context is deprecated. use scalar context instead.");
-
- EXTEND(SP, HvKEYS(symbols) * 2);
-
- while ((he = hv_iternext(symbols))) {
- PUSHs(hv_iterkeysv(he));
- PUSHs(sv_2mortal(SvREFCNT_inc(HeVAL(he))));
- }
-
- break;
- default:
- break;
- }
-
- SvREFCNT_dec((SV *)symbols);
+ PUSHs(sv_2mortal(newRV_noinc((SV *)symbols)));
void
name(self)
Modified: trunk/libclass-mop-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/Makefile.PL?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/Makefile.PL (original)
+++ trunk/libclass-mop-perl/Makefile.PL Wed Feb 18 13:32:43 2009
@@ -130,9 +130,7 @@
sub get_pp_tests {
opendir my $dh, 't' or die "Cannot read t: $!";
- return map {
- File::Spec->catfile('t', "pp_${_}")
- } grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
+ return grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
}
# This is EUMM voodoo
@@ -149,9 +147,17 @@
package MY;
sub postamble {
- my $pp_tests = join q{ }, ::get_pp_tests();
- my $test_dep = $::has_compiler && ::is_maintainer()
- ? 'pure_all :: pp_tests'
+ my @test_files = ::get_pp_tests();
+ my $pp_tests = join q{ }, map { File::Spec->catfile('t', "pp_${_}") } @test_files;
+ my @pp_test_targets = join qq{\n}, map {
+ my $source = File::Spec->catfile('t', ${_});
+ File::Spec->catfile('t', "pp_${_}") . q{: }
+ . qq{$source t/header_pp.inc\n\t}
+ . q{$(NOECHO) $(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc }
+ . $source . q{ > $@} . qq{\n}
+ } @test_files;
+ my $test_dep = $::has_compiler && (::is_maintainer() || $ENV{AUTOMATED_TESTING})
+ ? qq{pure_all :: pp_tests\n} . join qq{\n}, @pp_test_targets
: '';
return <<"EOM"
@@ -159,7 +165,5 @@
${test_dep}
-t/pp_%: t/% t/header_pp.inc
-\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@
EOM
}
Modified: trunk/libclass-mop-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/README?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/README (original)
+++ trunk/libclass-mop-perl/README Wed Feb 18 13:32:43 2009
@@ -1,4 +1,4 @@
-Class::MOP version 0.76
+Class::MOP version 0.77
===========================
See the individual module documentation for more information
Modified: trunk/libclass-mop-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/debian/changelog?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/debian/changelog (original)
+++ trunk/libclass-mop-perl/debian/changelog Wed Feb 18 13:32:43 2009
@@ -1,3 +1,9 @@
+libclass-mop-perl (0.77-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Brian Cassidy <brian.cassidy at gmail.com> Wed, 18 Feb 2009 09:31:01 -0400
+
libclass-mop-perl (0.76-1) unstable; urgency=low
[ gregor herrmann ]
Modified: trunk/libclass-mop-perl/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP.pm Wed Feb 18 13:32:43 2009
@@ -9,7 +9,7 @@
use MRO::Compat;
use Carp 'confess';
-use Scalar::Util 'weaken';
+use Scalar::Util 'weaken', 'reftype';
use Class::MOP::Class;
@@ -31,7 +31,7 @@
*check_package_cache_flag = \&mro::get_pkg_gen;
}
-our $VERSION = '0.76';
+our $VERSION = '0.77';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
@@ -186,9 +186,19 @@
$pack = \*{${$$pack}{"${part}::"}};
}
- # check for $VERSION or @ISA
- return 1 if exists ${$$pack}{VERSION}
- && defined *{${$$pack}{VERSION}}{SCALAR};
+ # We used to check in the package stash, but it turns out that
+ # *{${$$package}{VERSION}{SCALAR}} can end up pointing to a
+ # reference to undef. It looks
+
+ my $version = do {
+ no strict 'refs';
+ ${$class . '::VERSION'};
+ };
+
+ return 1 if ! ref $version && defined $version;
+ # Sometimes $VERSION ends up as a reference to undef (weird)
+ return 1 if ref $version && reftype $version eq 'SCALAR' && defined ${$version};
+
return 1 if exists ${$$pack}{ISA}
&& defined *{${$$pack}{ISA}}{ARRAY};
@@ -378,6 +388,18 @@
);
Class::MOP::Class->meta->add_attribute(
+ Class::MOP::Attribute->new('wrapped_method_metaclass' => (
+ reader => {
+ # NOTE:
+ # we just alias the original method
+ # rather than re-produce it here
+ 'wrapped_method_metaclass' => \&Class::MOP::Class::wrapped_method_metaclass
+ },
+ default => 'Class::MOP::Method::Wrapped',
+ ))
+);
+
+Class::MOP::Class->meta->add_attribute(
Class::MOP::Attribute->new('instance_metaclass' => (
reader => {
# NOTE: we need to do this in order
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm Wed Feb 18 13:32:43 2009
@@ -9,7 +9,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Class.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Class.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Class.pm Wed Feb 18 13:32:43 2009
@@ -11,7 +11,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
@@ -103,7 +103,7 @@
bless {
# inherited from Class::MOP::Package
- 'package' => $options->{package},
+ 'package' => $options->{package},
# NOTE:
# since the following attributes will
@@ -113,18 +113,25 @@
# listed here for reference, because they
# should not actually have a value associated
# with the slot.
- 'namespace' => \undef,
+ 'namespace' => \undef,
+
# inherited from Class::MOP::Module
- 'version' => \undef,
- 'authority' => \undef,
+ 'version' => \undef,
+ 'authority' => \undef,
+
# defined in Class::MOP::Class
- 'superclasses' => \undef,
+ 'superclasses' => \undef,
'methods' => {},
'attributes' => {},
- 'attribute_metaclass' => $options->{'attribute_metaclass'} || 'Class::MOP::Attribute',
- 'method_metaclass' => $options->{'method_metaclass'} || 'Class::MOP::Method',
- 'instance_metaclass' => $options->{'instance_metaclass'} || 'Class::MOP::Instance',
+ 'attribute_metaclass' => $options->{'attribute_metaclass'}
+ || 'Class::MOP::Attribute',
+ 'method_metaclass' => $options->{'method_metaclass'}
+ || 'Class::MOP::Method',
+ 'wrapped_method_metaclass' => $options->{'wrapped_method_metaclass'}
+ || 'Class::MOP::Method::Wrapped',
+ 'instance_metaclass' => $options->{'instance_metaclass'}
+ || 'Class::MOP::Instance',
}, $class;
}
@@ -306,10 +313,11 @@
# all these attribute readers will be bootstrapped
# away in the Class::MOP bootstrap section
-sub get_attribute_map { $_[0]->{'attributes'} }
-sub attribute_metaclass { $_[0]->{'attribute_metaclass'} }
-sub method_metaclass { $_[0]->{'method_metaclass'} }
-sub instance_metaclass { $_[0]->{'instance_metaclass'} }
+sub get_attribute_map { $_[0]->{'attributes'} }
+sub attribute_metaclass { $_[0]->{'attribute_metaclass'} }
+sub method_metaclass { $_[0]->{'method_metaclass'} }
+sub wrapped_method_metaclass { $_[0]->{'wrapped_method_metaclass'} }
+sub instance_metaclass { $_[0]->{'instance_metaclass'} }
sub get_method_map {
my $self = shift;
@@ -658,6 +666,7 @@
{
my $fetch_and_prepare_method = sub {
my ($self, $method_name) = @_;
+ my $wrapped_metaclass = $self->wrapped_method_metaclass;
# fetch it locally
my $method = $self->get_method($method_name);
# if we dont have local ...
@@ -670,12 +679,12 @@
# and now make sure to wrap it
# even if it is already wrapped
# because we need a new sub ref
- $method = Class::MOP::Method::Wrapped->wrap($method);
+ $method = $wrapped_metaclass->wrap($method);
}
else {
# now make sure we wrap it properly
- $method = Class::MOP::Method::Wrapped->wrap($method)
- unless $method->isa('Class::MOP::Method::Wrapped');
+ $method = $wrapped_metaclass->wrap($method)
+ unless $method->isa($wrapped_metaclass);
}
$self->add_method($method_name => $method);
return $method;
@@ -798,6 +807,12 @@
code => $_, # sigh, overloading
},
} shift->get_all_methods(@_);
+}
+
+sub get_all_method_names {
+ my $self = shift;
+ my %uniq;
+ grep { $uniq{$_}++ == 0 } map { $_->name } $self->get_all_methods;
}
sub find_all_methods_by_name {
@@ -1100,6 +1115,7 @@
class_precedence_list => 'ARRAY',
linearized_isa => 'ARRAY', # FIXME perl 5.10 memoizes this on its own, no need?
get_all_methods => 'ARRAY',
+ get_all_method_names => 'ARRAY',
#get_all_attributes => 'ARRAY', # it's an alias, no need, but maybe in the future
compute_all_applicable_attributes => 'ARRAY',
get_meta_instance => 'SCALAR',
@@ -1243,8 +1259,9 @@
=item B<initialize ($package_name, %options)>
-This initializes and returns returns a B<Class::MOP::Class> object
-for a given a C<$package_name>.
+This initializes and returns returns a B<Class::MOP::Class> object for
+a given a C<$package_name>. If a metaclass already exists for the
+package, it simply returns it instead of creating a new one.
=item B<construct_class_instance (%options)>
@@ -1553,6 +1570,12 @@
Use L<get_all_methods>, which is easier/better/faster. This method predates
L<Class::MOP::Method>.
+
+=item B<get_all_method_names>
+
+This will traverse the inheritance heirachy and return a list of all the
+applicable method names for this class. Duplicate names are removed, but the
+order the methods come out is not defined.
=item B<find_all_methods_by_name ($method_name)>
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm Wed Feb 18 13:32:43 2009
@@ -9,7 +9,7 @@
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Instance.pm Wed Feb 18 13:32:43 2009
@@ -6,7 +6,7 @@
use Scalar::Util 'weaken', 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'weaken';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Accessor.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Constructor.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Generated.pm Wed Feb 18 13:32:43 2009
@@ -6,7 +6,7 @@
use Carp 'confess';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Method/Wrapped.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Module.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Module.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Module.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Object.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Object.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Object.pm Wed Feb 18 13:32:43 2009
@@ -6,7 +6,7 @@
use Scalar::Util 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Package.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/Class/MOP/Package.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Package.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Package.pm Wed Feb 18 13:32:43 2009
@@ -8,7 +8,7 @@
use Scalar::Util 'blessed';
use Carp 'confess';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
@@ -284,11 +284,7 @@
my $namespace = $self->namespace;
- if (wantarray) {
- warn 'Class::MOP::Package::get_all_package_symbols in list context is deprecated. use scalar context instead.';
- }
-
- return (wantarray ? %$namespace : $namespace) unless defined $type_filter;
+ return $namespace unless defined $type_filter;
my %ret;
# for some reason this nasty impl is orders of magnitude faster than a clean version
@@ -316,7 +312,7 @@
} keys %$namespace;
}
- return wantarray ? %ret : \%ret;
+ return \%ret;
}
1;
Modified: trunk/libclass-mop-perl/lib/metaclass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/lib/metaclass.pm?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/metaclass.pm (original)
+++ trunk/libclass-mop-perl/lib/metaclass.pm Wed Feb 18 13:32:43 2009
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.76';
+our $VERSION = '0.77';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
Modified: trunk/libclass-mop-perl/t/010_self_introspection.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/010_self_introspection.t?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/010_self_introspection.t (original)
+++ trunk/libclass-mop-perl/t/010_self_introspection.t Wed Feb 18 13:32:43 2009
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 234;
+use Test::More tests => 246;
use Test::Exception;
use Class::MOP;
@@ -66,12 +66,12 @@
add_dependent_meta_instance remove_dependent_meta_instance
invalidate_meta_instances invalidate_meta_instance
- attribute_metaclass method_metaclass
+ attribute_metaclass method_metaclass wrapped_method_metaclass
superclasses subclasses class_precedence_list linearized_isa
has_method get_method add_method remove_method alias_method wrap_method_body
- get_method_list get_method_map get_all_methods compute_all_applicable_methods
+ get_method_list get_method_map get_all_method_names get_all_methods compute_all_applicable_methods
find_method_by_name find_all_methods_by_name find_next_method_by_name
add_before_method_modifier add_after_method_modifier add_around_method_modifier
@@ -157,6 +157,7 @@
'attributes',
'attribute_metaclass',
'method_metaclass',
+ 'wrapped_method_metaclass',
'instance_metaclass'
);
@@ -263,6 +264,21 @@
is($class_mop_class_meta->get_attribute('method_metaclass')->init_arg,
'method_metaclass',
'... Class::MOP::Class method_metaclass\'s init_arg is method_metaclass');
+
+ok($class_mop_class_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Class method_metaclass has a default');
+is($class_mop_class_meta->get_attribute('method_metaclass')->default,
+ 'Class::MOP::Method',
+ '... Class::MOP::Class method_metaclass\'s a default is Class::MOP:::Method');
+
+ok($class_mop_class_meta->get_attribute('wrapped_method_metaclass')->has_reader, '... Class::MOP::Class wrapped_method_metaclass has a reader');
+is_deeply($class_mop_class_meta->get_attribute('wrapped_method_metaclass')->reader,
+ { 'wrapped_method_metaclass' => \&Class::MOP::Class::wrapped_method_metaclass },
+ '... Class::MOP::Class wrapped_method_metaclass\'s a reader is &wrapped_method_metaclass');
+
+ok($class_mop_class_meta->get_attribute('wrapped_method_metaclass')->has_init_arg, '... Class::MOP::Class wrapped_method_metaclass has a init_arg');
+is($class_mop_class_meta->get_attribute('wrapped_method_metaclass')->init_arg,
+ 'wrapped_method_metaclass',
+ '... Class::MOP::Class wrapped_method_metaclass\'s init_arg is wrapped_method_metaclass');
ok($class_mop_class_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Class method_metaclass has a default');
is($class_mop_class_meta->get_attribute('method_metaclass')->default,
Modified: trunk/libclass-mop-perl/t/083_load_class.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libclass-mop-perl/t/083_load_class.t?rev=30826&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/083_load_class.t (original)
+++ trunk/libclass-mop-perl/t/083_load_class.t Wed Feb 18 13:32:43 2009
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 28;
+use Test::More tests => 33;
use Test::Exception;
require Class::MOP;
@@ -82,4 +82,35 @@
Class::MOP::load_first_existing_class("Does::Not::Exist", "Also::Does::Not::Exist")
} qr/Could not load class \(Does::Not::Exist.*Could not load class \(Also::Does::Not::Exist/s, 'Multiple non-existant classes cause exception';
+{
+ sub whatever {
+ TestClassLoaded::this_method_does_not_even_exist();
+ }
+ ok( ! Class::MOP::is_class_loaded('TestClassLoaded'),
+ 'the mere mention of TestClassLoaded in the whatever sub does not make us think it has been loaded' );
+}
+
+{
+ require TestClassLoaded::Sub;
+ ok( ! Class::MOP::is_class_loaded('TestClassLoaded'),
+ 'requiring TestClassLoaded::Sub does not make us think TestClassLoaded is loaded' );
+}
+
+{
+ require TestClassLoaded;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded'),
+ 'We see that TestClassLoaded is loaded after requiring it (it has methods but no $VERSION or @ISA)' );
+}
+
+{
+ require TestClassLoaded2;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded2'),
+ 'We see that TestClassLoaded2 is loaded after requiring it (it has a $VERSION but no methods or @ISA)' );
+}
+
+{
+ require TestClassLoaded3;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded3'),
+ 'We see that TestClassLoaded3 is loaded after requiring it (it has an @ISA but no methods or $VERSION)' );
+}
More information about the Pkg-perl-cvs-commits
mailing list