r3302 - in /packages/libclass-mop-perl/trunk: ./ debian/ examples/
lib/ lib/Class/ lib/Class/MOP/ lib/Class/MOP/Class/ t/
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Fri Jul 21 11:47:52 UTC 2006
Author: gregoa-guest
Date: Fri Jul 21 11:47:51 2006
New Revision: 3302
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3302
Log:
* New upstream release.
* Added libalgorithm-c3-perl, libclass-c3-perl,libtest-pod-perl and
libtest-pod-coverage-perl to Build-Depends-Indep.
Modified:
packages/libclass-mop-perl/trunk/Changes
packages/libclass-mop-perl/trunk/META.yml
packages/libclass-mop-perl/trunk/debian/changelog
packages/libclass-mop-perl/trunk/debian/control
packages/libclass-mop-perl/trunk/examples/ArrayBasedStorage.pod
packages/libclass-mop-perl/trunk/examples/AttributesWithHistory.pod
packages/libclass-mop-perl/trunk/examples/C3MethodDispatchOrder.pod
packages/libclass-mop-perl/trunk/examples/ClassEncapsulatedAttributes.pod
packages/libclass-mop-perl/trunk/examples/InsideOutClass.pod
packages/libclass-mop-perl/trunk/examples/InstanceCountingClass.pod
packages/libclass-mop-perl/trunk/examples/LazyClass.pod
packages/libclass-mop-perl/trunk/examples/Perl6Attribute.pod
packages/libclass-mop-perl/trunk/lib/Class/MOP.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Attribute.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Class.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Class/Immutable.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Instance.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Method.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Module.pm
packages/libclass-mop-perl/trunk/lib/Class/MOP/Package.pm
packages/libclass-mop-perl/trunk/lib/metaclass.pm
packages/libclass-mop-perl/trunk/t/003_methods.t
packages/libclass-mop-perl/trunk/t/010_self_introspection.t
packages/libclass-mop-perl/trunk/t/014_attribute_introspection.t
Modified: packages/libclass-mop-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/Changes?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/Changes (original)
+++ packages/libclass-mop-perl/trunk/Changes Fri Jul 21 11:47:51 2006
@@ -1,4 +1,15 @@
Revision history for Perl extension Class-MOP.
+
+0.31 Sat. July 15, 2006
+
+ * Class::MOP::Class
+ - added &find_method_by_name to locate a method
+ anywhere within the class hierarchy
+
+ * Class::MOP::Attribute
+ - added &set_value and &get_value for getting
+ the value of the attribute for a particular
+ instance.
0.30 Wed. July 5, 2006
---------------------------------------
Modified: packages/libclass-mop-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/META.yml?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/META.yml (original)
+++ packages/libclass-mop-perl/trunk/META.yml Fri Jul 21 11:47:51 2006
@@ -1,8 +1,7 @@
---
name: Class-MOP
-version: 0.30
-author:
- - 'Stevan Little E<lt>stevan at iinteractive.comE<gt>'
+version: 0.31
+author: ~
abstract: A Meta Object Protocol for Perl 5
license: perl
requires:
@@ -17,16 +16,16 @@
provides:
Class::MOP:
file: lib/Class/MOP.pm
- version: 0.30
+ version: 0.31
Class::MOP::Attribute:
file: lib/Class/MOP/Attribute.pm
- version: 0.09
+ version: 0.10
Class::MOP::Attribute::Accessor:
file: lib/Class/MOP/Attribute.pm
- version: 0.09
+ version: 0.10
Class::MOP::Class:
file: lib/Class/MOP/Class.pm
- version: 0.15
+ version: 0.16
Class::MOP::Class::Immutable:
file: lib/Class/MOP/Class/Immutable.pm
version: 0.01
Modified: packages/libclass-mop-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/debian/changelog?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/debian/changelog (original)
+++ packages/libclass-mop-perl/trunk/debian/changelog Fri Jul 21 11:47:51 2006
@@ -1,3 +1,11 @@
+libclass-mop-perl (0.31-1) unstable; urgency=low
+
+ * New upstream release.
+ * Added libalgorithm-c3-perl, libclass-c3-perl,libtest-pod-perl and
+ libtest-pod-coverage-perl to Build-Depends-Indep.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at> Fri, 21 Jul 2006 13:46:11 +0200
+
libclass-mop-perl (0.30-1) unstable; urgency=low
* New upstream release
Modified: packages/libclass-mop-perl/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/debian/control?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/debian/control (original)
+++ packages/libclass-mop-perl/trunk/debian/control Fri Jul 21 11:47:51 2006
@@ -2,9 +2,9 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 5.0), libmodule-build-perl
-Build-Depends-Indep: perl (>= 5.8.0-7), libsub-name-perl, libtest-exception-perl
+Build-Depends-Indep: perl (>= 5.8.0-7), libsub-name-perl, libtest-exception-perl, libtest-pod-perl, libtest-pod-coverage-perl, libalgorithm-c3-perl, libclass-c3-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Krzysztof Krzyzaniak (eloy) <eloy at debian.org>
+Uploaders: Krzysztof Krzyzaniak (eloy) <eloy at debian.org>, gregor herrmann <gregor+debian at comodo.priv.at>
Standards-Version: 3.7.2.1
Package: libclass-mop-perl
Modified: packages/libclass-mop-perl/trunk/examples/ArrayBasedStorage.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/ArrayBasedStorage.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/ArrayBasedStorage.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/ArrayBasedStorage.pod Fri Jul 21 11:47:51 2006
@@ -94,9 +94,11 @@
in fact, they both share the exact same test suite, with
the only difference being the Instance metaclass they use.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 SEE ALSO
Modified: packages/libclass-mop-perl/trunk/examples/AttributesWithHistory.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/AttributesWithHistory.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/AttributesWithHistory.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/AttributesWithHistory.pod Fri Jul 21 11:47:51 2006
@@ -106,9 +106,11 @@
autogenerate a means of accessing that history for the class
which these attributes are added too.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/examples/C3MethodDispatchOrder.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/C3MethodDispatchOrder.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/C3MethodDispatchOrder.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/C3MethodDispatchOrder.pod Fri Jul 21 11:47:51 2006
@@ -121,9 +121,11 @@
as well, all that is required is to write a the C<class_precedence_list> method
which will return a linearized list of classes to dispatch along.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/examples/ClassEncapsulatedAttributes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/ClassEncapsulatedAttributes.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/ClassEncapsulatedAttributes.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/ClassEncapsulatedAttributes.pod Fri Jul 21 11:47:51 2006
@@ -133,9 +133,11 @@
Thanks to Yuval "nothingmuch" Kogman for the idea for this example.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/examples/InsideOutClass.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/InsideOutClass.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/InsideOutClass.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/InsideOutClass.pod Fri Jul 21 11:47:51 2006
@@ -162,7 +162,7 @@
well (threading, etc), but this is an example. A real implementation is left as
an exercise to the reader.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
Modified: packages/libclass-mop-perl/trunk/examples/InstanceCountingClass.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/InstanceCountingClass.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/InstanceCountingClass.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/InstanceCountingClass.pod Fri Jul 21 11:47:51 2006
@@ -55,9 +55,11 @@
This is a classic example of a metaclass which keeps a count of each
instance which is created.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/examples/LazyClass.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/LazyClass.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/LazyClass.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/LazyClass.pod Fri Jul 21 11:47:51 2006
@@ -133,9 +133,11 @@
ideal for a class which has a large amount of attributes,
several of which are optional.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/examples/Perl6Attribute.pod
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/examples/Perl6Attribute.pod?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/examples/Perl6Attribute.pod (original)
+++ packages/libclass-mop-perl/trunk/examples/Perl6Attribute.pod Fri Jul 21 11:47:51 2006
@@ -65,9 +65,11 @@
the reader though (if you do it, please send me a patch
though, and will update this).
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP.pm Fri Jul 21 11:47:51 2006
@@ -13,7 +13,7 @@
use Class::MOP::Class::Immutable;
-our $VERSION = '0.30';
+our $VERSION = '0.31';
## ----------------------------------------------------------------------------
## Setting up our environment ...
@@ -479,9 +479,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Attribute.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Attribute.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Attribute.pm Fri Jul 21 11:47:51 2006
@@ -7,7 +7,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'reftype', 'weaken';
-our $VERSION = '0.09';
+our $VERSION = '0.10';
sub meta {
require Class::MOP::Class;
@@ -15,7 +15,7 @@
}
# NOTE: (meta-circularity)
-# This method will be replaces in the
+# This method will be replaced in the
# boostrap section of Class::MOP, by
# a new version which uses the
# &Class::MOP::Class::construct_instance
@@ -49,7 +49,7 @@
# NOTE:
# this is a primative (and kludgy) clone operation
-# for now, it will be repleace in the Class::MOP
+# for now, it will be replaced in the Class::MOP
# bootstrap with a proper one, however we know
# that this one will work fine for now.
sub clone {
@@ -132,15 +132,31 @@
$self->{associated_class} = undef;
}
+## Slot management
+
+sub set_value {
+ my ( $self, $instance, $value ) = @_;
+
+ Class::MOP::Class->initialize(Scalar::Util::blessed($instance))
+ ->get_meta_instance
+ ->set_slot_value( $instance, $self->name, $value );
+}
+
+sub get_value {
+ my ( $self, $instance ) = @_;
+
+ Class::MOP::Class->initialize(Scalar::Util::blessed($instance))
+ ->get_meta_instance
+ ->get_slot_value( $instance, $self->name );
+}
+
## Method generation helpers
sub generate_accessor_method {
- my $self = shift;
- my $attr_name = $self->name;
+ my $attr = shift;
return sub {
- my $meta_instance = Class::MOP::Class->initialize(Scalar::Util::blessed($_[0]))->get_meta_instance;
- $meta_instance->set_slot_value($_[0], $attr_name, $_[1]) if scalar(@_) == 2;
- $meta_instance->get_slot_value($_[0], $attr_name);
+ $attr->set_value( $_[0], $_[1] ) if scalar(@_) == 2;
+ $attr->get_value( $_[0] );
};
}
@@ -159,13 +175,10 @@
}
sub generate_reader_method {
- my $self = shift;
- my $attr_name = $self->name;
+ my $attr = shift;
return sub {
confess "Cannot assign a value to a read-only accessor" if @_ > 1;
- Class::MOP::Class->initialize(Scalar::Util::blessed($_[0]))
- ->get_meta_instance
- ->get_slot_value($_[0], $attr_name);
+ $attr->get_value( $_[0] );
};
}
@@ -184,12 +197,9 @@
}
sub generate_writer_method {
- my $self = shift;
- my $attr_name = $self->name;
- return sub {
- Class::MOP::Class->initialize(Scalar::Util::blessed($_[0]))
- ->get_meta_instance
- ->set_slot_value($_[0], $attr_name, $_[1]);
+ my $attr = shift;
+ return sub {
+ $attr->set_value( $_[0], $_[1] );
};
}
@@ -473,6 +483,22 @@
=back
+=head2 Value management
+
+=over 4
+
+=item set_value $instance, $value
+
+Set the value without going through the accessor. Note that this may be done to
+even attributes with just read only accessors.
+
+=item get_value $instance
+
+Return the value without going through the accessor. Note that this may be done
+even to attributes with just write only accessors.
+
+=back
+
=head2 Informational
These are all basic read-only value accessors for the values
@@ -614,9 +640,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
@@ -627,4 +655,5 @@
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
+=cut
+
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Class.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Class.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Class.pm Fri Jul 21 11:47:51 2006
@@ -9,7 +9,7 @@
use Sub::Name 'subname';
use B 'svref_2object';
-our $VERSION = '0.15';
+our $VERSION = '0.16';
use base 'Class::MOP::Module';
@@ -429,6 +429,12 @@
*{$full_method_name} = $method;
}
+sub find_method_by_name {
+ my ( $self, $method_name ) = @_;
+
+ return $self->name->can( $method_name );
+}
+
sub has_method {
my ($self, $method_name) = @_;
(defined $method_name && $method_name)
@@ -441,10 +447,14 @@
my $method = \&{$sub_name};
return 0 if (svref_2object($method)->GV->STASH->NAME || '') ne $self->name &&
(svref_2object($method)->GV->NAME || '') ne '__ANON__';
-
- # at this point we are relatively sure
- # it is our method, so we bless/wrap it
- $self->method_metaclass->wrap($method) unless blessed($method);
+
+ #if ( $self->name->can("meta") ) {
+ # don't bless (destructive operation) classes that didn't ask for it
+
+ # at this point we are relatively sure
+ # it is our method, so we bless/wrap it
+ $self->method_metaclass->wrap($method) unless blessed($method);
+ #}
return 1;
}
@@ -964,6 +974,13 @@
This will return a CODE reference of the specified C<$method_name>,
or return undef if that method does not exist.
+=item B<find_method_by_name ($method_name>
+
+This will return a CODE reference of the specified C<$method_name>,
+or return undef if that method does not exist.
+
+Unlike C<get_method> this will also look in the superclasses.
+
=item B<remove_method ($method_name)>
This will attempt to remove a given C<$method_name> from the class.
@@ -1227,9 +1244,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Class/Immutable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Class/Immutable.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Class/Immutable.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Class/Immutable.pm Fri Jul 21 11:47:51 2006
@@ -260,9 +260,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Instance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Instance.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Instance.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Instance.pm Fri Jul 21 11:47:51 2006
@@ -289,7 +289,7 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Method.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Method.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Method.pm Fri Jul 21 11:47:51 2006
@@ -291,9 +291,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
@@ -304,4 +306,5 @@
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
+=cut
+
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Module.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Module.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Module.pm Fri Jul 21 11:47:51 2006
@@ -46,9 +46,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/Class/MOP/Package.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/Class/MOP/Package.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/Class/MOP/Package.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/Class/MOP/Package.pm Fri Jul 21 11:47:51 2006
@@ -164,9 +164,11 @@
=back
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
Modified: packages/libclass-mop-perl/trunk/lib/metaclass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/lib/metaclass.pm?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/lib/metaclass.pm (original)
+++ packages/libclass-mop-perl/trunk/lib/metaclass.pm Fri Jul 21 11:47:51 2006
@@ -20,7 +20,7 @@
else {
$metaclass = shift;
($metaclass->isa('Class::MOP::Class'))
- || confess 'The metaclass must be derived from Class::MOP::Class';
+ || confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
}
my %options = @_;
my $package = caller();
@@ -79,9 +79,11 @@
and a set of custom attribute and method metaclasses. It also
installs a C<meta> method to your class as well.
-=head1 AUTHOR
+=head1 AUTHORS
Stevan Little E<lt>stevan at iinteractive.comE<gt>
+
+Yuval Kogman E<lt>nothingmuch at woobling.comE<gt>
=head1 COPYRIGHT AND LICENSE
@@ -92,4 +94,4 @@
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
+=cut
Modified: packages/libclass-mop-perl/trunk/t/003_methods.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/t/003_methods.t?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/t/003_methods.t (original)
+++ packages/libclass-mop-perl/trunk/t/003_methods.t Fri Jul 21 11:47:51 2006
@@ -3,8 +3,10 @@
use strict;
use warnings;
-use Test::More tests => 52;
+use Test::More tests => 56;
use Test::Exception;
+
+use Scalar::Util qw/reftype/;
BEGIN {
use_ok('Class::MOP');
@@ -32,6 +34,11 @@
# We hateses the "used only once" warnings
{ my $temp = \&Foo::baz }
+
+ package OinkyBoinky;
+ our @ISA = "Foo";
+
+ sub elk { 'OinkyBoinky::elk' }
package main;
@@ -77,6 +84,17 @@
ok($Foo->has_method('bling'), '... Foo->has_method(bling) (defined in main:: using symbol tables (no Sub::Name))');
ok($Foo->has_method('bang'), '... Foo->has_method(bang) (defined in main:: using symbol tables and Sub::Name)');
ok($Foo->has_method('evaled_foo'), '... Foo->has_method(evaled_foo) (evaled in main::)');
+
+my $OinkyBoinky = Class::MOP::Class->initialize('OinkyBoinky');
+
+ok($OinkyBoinky->has_method('elk'), "the method 'elk' is defined in OinkyBoinky");
+
+ok(!$OinkyBoinky->has_method('bar'), "the method 'bar' is not defined in OinkyBoinky");
+
+ok(my $bar = $OinkyBoinky->find_method_by_name('bar'), "but if you look in the inheritence chain then 'bar' does exist");
+
+is( reftype($bar), "CODE", "the returned value is a code ref" );
+
# calling get_method blessed them all
isa_ok($_, 'Class::MOP::Method') for (
Modified: packages/libclass-mop-perl/trunk/t/010_self_introspection.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/t/010_self_introspection.t?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/t/010_self_introspection.t (original)
+++ packages/libclass-mop-perl/trunk/t/010_self_introspection.t Fri Jul 21 11:47:51 2006
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 169;
+use Test::More tests => 171;
use Test::Exception;
BEGIN {
@@ -61,7 +61,7 @@
has_method get_method add_method remove_method alias_method
get_method_list compute_all_applicable_methods
- find_all_methods_by_name find_next_method_by_name
+ 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
Modified: packages/libclass-mop-perl/trunk/t/014_attribute_introspection.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libclass-mop-perl/trunk/t/014_attribute_introspection.t?rev=3302&op=diff
==============================================================================
--- packages/libclass-mop-perl/trunk/t/014_attribute_introspection.t (original)
+++ packages/libclass-mop-perl/trunk/t/014_attribute_introspection.t Fri Jul 21 11:47:51 2006
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 46;
+use Test::More tests => 48;
use Test::Exception;
BEGIN {
@@ -34,6 +34,8 @@
has_default default is_default_a_coderef
slots
+ get_value
+ set_value
associated_class
attach_to_class detach_from_class
More information about the Pkg-perl-cvs-commits
mailing list