Revision history for Perl extension Class-MOP.
+0.38
+ ~~ More documentation updates ~~
+ * Class::MOP::Package
+ - we now deal with stub methods properly
+ - added tests for this
+
0.37 Sat. March 10, 2007
~~ Many, many documentation updates ~~
-Class::MOP version 0.37
+Class::MOP version 0.38
===========================
See the individual module documentation for more information
use Class::MOP::Immutable;
-our $VERSION = '0.37';
+our $VERSION = '0.38';
our $AUTHORITY = 'cpan:STEVAN';
{
use Sub::Name 'subname';
use B 'svref_2object';
-our $VERSION = '0.21';
+our $VERSION = '0.22';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Module';
it does not need a C<$package_name>. Instead it will create a suitably
unique package name for you to stash things into.
+On very important distinction is that anon classes are destroyed once
+the metaclass they are attached to goes out of scope. In the DESTROY
+method, the created package will be removed from the symbol table.
+
=item B<initialize ($package_name, %options)>
This initializes and returns returns a B<Class::MOP::Class> object
use Scalar::Util 'blessed';
use Carp 'confess';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Object';
my $namespace = $self->namespace;
return grep {
defined(*{$namespace->{$_}}{$type_filter})
+ } grep {
+ ref(\$namespace->{$_}) eq 'GLOB'
} keys %{$namespace};
}
use strict;
use warnings;
-use Test::More tests => 64;
+use Test::More tests => 66;
use Test::Exception;
use Scalar::Util qw/reftype/;
# import a sub
use Scalar::Util 'blessed';
+ sub pie;
+ sub cake ();
+
use constant FOO_CONSTANT => 'Foo-CONSTANT';
# define a sub in package
my $Foo = Class::MOP::Class->initialize('Foo');
+ok(!$Foo->has_method('pie'), '... got the method stub pie');
+ok(!$Foo->has_method('cake'), '... got the constant method stub cake');
+
my $foo = sub { 'Foo::foo' };
ok(!UNIVERSAL::isa($foo, 'Class::MOP::Method'), '... our method is not yet blessed');