r11607 - in /trunk/libclass-mop-perl: Changes META.yml README debian/changelog lib/Class/MOP.pm lib/Class/MOP/Attribute.pm lib/Class/MOP/Class.pm lib/Class/MOP/Immutable.pm t/073_make_mutable.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Tue Dec 25 22:14:57 UTC 2007
Author: gregoa-guest
Date: Tue Dec 25 22:14:56 2007
New Revision: 11607
URL: http://svn.debian.org/wsvn/?sc=1&rev=11607
Log:
New upstream release.
Modified:
trunk/libclass-mop-perl/Changes
trunk/libclass-mop-perl/META.yml
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/t/073_make_mutable.t
Modified: trunk/libclass-mop-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/Changes?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/Changes (original)
+++ trunk/libclass-mop-perl/Changes Tue Dec 25 22:14:56 2007
@@ -1,7 +1,20 @@
Revision history for Perl extension Class-MOP.
+0.50 Fri. Dec. 21, 2007
+ * Class::MOP::Class
+ - fixed bug in immutable to make sure that
+ transformation arguments are saved
+ correctly (mst)
+ - added tests for this
+
+ * Class::MOP::Immutable
+ - fixed a bug (see above)
+
+ * Class::MOP::Attribute
+ - some doc updates
+
0.49 Fri. Dec. 14, 2007
- !! Class::MOP now loads ~45% faster !!
+ !! Class::MOP now loads 2 x faster !!
!! with XS speedups (thanks konobi) !!
* Class::MOP
Modified: trunk/libclass-mop-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/META.yml?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/META.yml (original)
+++ trunk/libclass-mop-perl/META.yml Tue Dec 25 22:14:56 2007
@@ -20,16 +20,16 @@
provides:
Class::MOP:
file: lib/Class/MOP.pm
- version: 0.49
+ version: 0.50
Class::MOP::Attribute:
file: lib/Class/MOP/Attribute.pm
- version: 0.20
+ version: 0.21
Class::MOP::Class:
file: lib/Class/MOP/Class.pm
version: 0.25
Class::MOP::Immutable:
file: lib/Class/MOP/Immutable.pm
- version: 0.02
+ version: 0.03
Class::MOP::Instance:
file: lib/Class/MOP/Instance.pm
version: 0.03
@@ -64,4 +64,4 @@
Carp: 0
Scalar::Util: 1.18
Sub::Name: 0.02
-version: 0.49
+version: 0.50
Modified: trunk/libclass-mop-perl/README
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/README?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/README (original)
+++ trunk/libclass-mop-perl/README Tue Dec 25 22:14:56 2007
@@ -1,4 +1,4 @@
-Class::MOP version 0.49
+Class::MOP version 0.50
===========================
See the individual module documentation for more information
Modified: trunk/libclass-mop-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/debian/changelog?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/debian/changelog (original)
+++ trunk/libclass-mop-perl/debian/changelog Tue Dec 25 22:14:56 2007
@@ -1,3 +1,9 @@
+libclass-mop-perl (0.50-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at> Tue, 25 Dec 2007 23:13:45 +0100
+
libclass-mop-perl (0.49-1) unstable; urgency=low
[ gregor herrmann ]
Modified: trunk/libclass-mop-perl/lib/Class/MOP.pm
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/lib/Class/MOP.pm?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP.pm Tue Dec 25 22:14:56 2007
@@ -14,7 +14,7 @@
use Class::MOP::Immutable;
BEGIN {
- our $VERSION = '0.49';
+ our $VERSION = '0.50';
our $AUTHORITY = 'cpan:STEVAN';
use XSLoader;
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Attribute.pm Tue Dec 25 22:14:56 2007
@@ -9,7 +9,7 @@
use Carp 'confess';
use Scalar::Util 'blessed', 'reftype', 'weaken';
-our $VERSION = '0.20';
+our $VERSION = '0.21';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Object';
@@ -534,7 +534,7 @@
=item B<has_value ($instance)>
-Returns a boolean indicating if the item in the C<$instance> has a value in it.
+Return a boolean indicating if the item in the C<$instance> has a value in it.
This is basically what the default C<predicate> method calls.
=item B<clear_value ($instance)>
@@ -570,13 +570,15 @@
=item B<default (?$instance)>
-As noted in the documentation for C<new> above, if the I<default>
-value is a CODE reference, this accessor will pass a single additional
-argument C<$instance> into it and return the value.
+Return the default value for the attribute.
+
+If you pass in an C<$instance> argument to this accessor and the
+I<default> is a CODE reference, then the CODE reference will be
+executed with the C<$instance> as its argument.
=item B<slots>
-Returns a list of slots required by the attribute. This is usually
+Return a list of slots required by the attribute. This is usually
just one, which is the name of the attribute.
=item B<get_read_method>
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Class.pm
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/lib/Class/MOP/Class.pm?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Class.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Class.pm Tue Dec 25 22:14:56 2007
@@ -808,7 +808,7 @@
$IMMUTABLE_TRANSFORMERS{$class} ||= $self->create_immutable_transformer;
my $transformer = $IMMUTABLE_TRANSFORMERS{$class};
- $transformer->make_metaclass_immutable($self, %options);
+ $transformer->make_metaclass_immutable($self, \%options);
$IMMUTABLE_OPTIONS{$self->name} =
{ %options, IMMUTABLE_TRANSFORMER => $transformer };
@@ -824,7 +824,7 @@
my $options = delete $IMMUTABLE_OPTIONS{$self->name};
confess "unable to find immutabilizing options" unless ref $options;
my $transformer = delete $options->{IMMUTABLE_TRANSFORMER};
- $transformer->make_metaclass_mutable($self, %$options);
+ $transformer->make_metaclass_mutable($self, $options);
}
}
Modified: trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm (original)
+++ trunk/libclass-mop-perl/lib/Class/MOP/Immutable.pm Tue Dec 25 22:14:56 2007
@@ -9,7 +9,7 @@
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.02';
+our $VERSION = '0.03';
our $AUTHORITY = 'cpan:STEVAN';
sub new {
@@ -69,13 +69,19 @@
# existing metaclass to an immutable
# version of itself
sub make_metaclass_immutable {
- my ($self, $metaclass, %options) = @_;
-
- $options{inline_accessors} = 1 unless exists $options{inline_accessors};
- $options{inline_constructor} = 1 unless exists $options{inline_constructor};
- $options{inline_destructor} = 0 unless exists $options{inline_destructor};
- $options{constructor_name} = 'new' unless exists $options{constructor_name};
- $options{debug} = 0 unless exists $options{debug};
+ my ($self, $metaclass, $options) = @_;
+
+ foreach my $pair (
+ [ inline_accessors => 1 ],
+ [ inline_constructor => 1 ],
+ [ inline_destructor => 0 ],
+ [ constructor_name => 'new' ],
+ [ debug => 0 ],
+ ) {
+ $options->{$pair->[0]} = $pair->[1] unless exists $options->{$pair->[0]};
+ }
+
+ my %options = %$options;
if ($options{inline_accessors}) {
foreach my $attr_name ($metaclass->get_attribute_list) {
@@ -141,7 +147,9 @@
}
sub make_metaclass_mutable {
- my ($self, $immutable, %options) = @_;
+ my ($self, $immutable, $options) = @_;
+
+ my %options = %$options;
my $original_class = $immutable->get_mutable_metaclass_name;
delete $immutable->{'___original_class'} ;
@@ -180,7 +188,6 @@
# 14:26 <@stevan> the only user of ::Method::Constructor is immutable
# 14:27 <@stevan> if someone uses it outside of immutable,.. they are either: mst or groditi
# 14:27 <@stevan> so I am not worried
- $options{constructor_name} = 'new' unless exists $options{constructor_name};
if ($options{inline_constructor}) {
my $constructor_class = $options{constructor_class} || 'Class::MOP::Method::Constructor';
$immutable->remove_method( $options{constructor_name} )
Modified: trunk/libclass-mop-perl/t/073_make_mutable.t
URL: http://svn.debian.org/wsvn/trunk/libclass-mop-perl/t/073_make_mutable.t?rev=11607&op=diff
==============================================================================
--- trunk/libclass-mop-perl/t/073_make_mutable.t (original)
+++ trunk/libclass-mop-perl/t/073_make_mutable.t Tue Dec 25 22:14:56 2007
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 104;
+use Test::More tests => 108;
use Test::Exception;
use Scalar::Util;
@@ -51,11 +51,13 @@
ok(!$meta->is_mutable, '... our class is no longer mutable');
ok($meta->is_immutable, '... our class is now immutable');
ok(!$meta->make_immutable, '... make immutable now returns nothing');
+ ok($meta->get_method_map->{new}, '... inlined constructor created');
lives_ok { $meta->make_mutable; } '... changed Baz to be mutable';
ok($meta->is_mutable, '... our class is mutable');
ok(!$meta->is_immutable, '... our class is not immutable');
ok(!$meta->make_mutable, '... make mutable now returns nothing');
+ ok(!$meta->get_method_map->{new}, '... inlined constructor removed');
my @new_keys = sort keys %$meta;
is_deeply(\@orig_keys, \@new_keys, '... no straneous hashkeys');
@@ -88,6 +90,9 @@
ok( $meta->$_ , "... ${_} works")
for qw(get_meta_instance compute_all_applicable_attributes
class_precedence_list get_method_map );
+
+ lives_ok {$meta->make_immutable; } '... changed Baz to be immutable again';
+ ok($meta->get_method_map->{new}, '... inlined constructor recreated');
}
{
More information about the Pkg-perl-cvs-commits
mailing list