Bump the version and update changes for 0.64_06
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index 48dd0cb..cd7dc71 100644 (file)
@@ -4,6 +4,8 @@ package Class::MOP;
 use strict;
 use warnings;
 
+use 5.008;
+
 use MRO::Compat;
 
 use Carp          'confess';
@@ -26,7 +28,7 @@ BEGIN {
         require Devel::GlobalDestruction;
         Devel::GlobalDestruction->import("in_global_destruction");
         1;
-    } or *in_global_destruction = sub () { '' };
+    } or *in_global_destruction = sub () { !1 };
 }
 
 
@@ -46,7 +48,9 @@ BEGIN {
         : sub () { 1 };
 }
 
-our $VERSION   = '0.65';
+our $VERSION   = '0.64_06';
+our $XS_VERSION = $VERSION;
+$VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';    
     
 # after that everything is loaded, if we're allowed try to load faster XS
@@ -56,7 +60,7 @@ unless ($ENV{CLASS_MOP_NO_XS}) {
         local $@;
         eval {
             require XSLoader;
-            __PACKAGE__->XSLoader::load($VERSION);
+            __PACKAGE__->XSLoader::load($XS_VERSION);
         };
         $@;
     };
@@ -500,15 +504,6 @@ Class::MOP::Method::Generated->meta->add_attribute(
     ))
 );
 
-Class::MOP::Method::Generated->meta->add_method('new' => sub {
-    my ($class, %options) = @_;
-    ($options{package_name} && $options{name})
-        || confess "You must supply the package_name and name parameters";    
-    my $self = $class->_new(%options);
-    $self->initialize_body;  
-    $self;
-});
-
 ## --------------------------------------------------------
 ## Class::MOP::Method::Accessor
 
@@ -526,36 +521,6 @@ Class::MOP::Method::Accessor->meta->add_attribute(
     ))
 );
 
-Class::MOP::Method::Accessor->meta->add_method('new' => sub {
-    my $class   = shift;
-    my %options = @_;
-
-    (exists $options{attribute})
-        || confess "You must supply an attribute to construct with";
-
-    (exists $options{accessor_type})
-        || confess "You must supply an accessor_type to construct with";
-
-    (Scalar::Util::blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute'))
-        || confess "You must supply an attribute which is a 'Class::MOP::Attribute' instance";
-
-    ($options{package_name} && $options{name})
-        || confess "You must supply the package_name and name parameters";
-
-    # return the new object
-    my $self = $class->_new(%options);
-    
-    # we don't want this creating
-    # a cycle in the code, if not
-    # needed
-    Scalar::Util::weaken($self->{'attribute'});
-
-    $self->initialize_body;  
-    
-    $self;
-});
-
-
 ## --------------------------------------------------------
 ## Class::MOP::Method::Constructor
 
@@ -577,30 +542,6 @@ Class::MOP::Method::Constructor->meta->add_attribute(
     ))
 );
 
-Class::MOP::Method::Constructor->meta->add_method('new' => sub {
-    my $class   = shift;
-    my %options = @_;
-
-    (Scalar::Util::blessed $options{metaclass} && $options{metaclass}->isa('Class::MOP::Class'))
-        || confess "You must pass a metaclass instance if you want to inline"
-            if $options{is_inline};
-
-    ($options{package_name} && $options{name})
-        || confess "You must supply the package_name and name parameters";
-
-    # return the new object
-    my $self = $class->_new(%options);
-    
-    # we don't want this creating
-    # a cycle in the code, if not
-    # needed
-    Scalar::Util::weaken($self->{'associated_metaclass'});
-
-    $self->initialize_body;  
-    
-    $self;
-});
-
 ## --------------------------------------------------------
 ## Class::MOP::Instance
 
@@ -625,7 +566,7 @@ Class::MOP::Instance->meta->add_attribute(
 
 Class::MOP::Instance->meta->add_attribute(
     Class::MOP::Attribute->new('attributes',
-        reader   => { attributes => \&Class::MOP::Instance::attributes },
+        reader   => { attributes => \&Class::MOP::Instance::get_all_attributes },
     ),
 );
 
@@ -646,17 +587,6 @@ Class::MOP::Instance->meta->add_attribute(
 # for the constructor to be able to use it
 Class::MOP::Instance->meta->get_meta_instance;
 
-Class::MOP::Instance->meta->add_method('new' => sub {
-    my $class   = shift;
-    my $options = $class->BUILDARGS(@_);
-
-    my $self = $class->_new(%$options);
-    
-    Scalar::Util::weaken($self->{'associated_metaclass'});
-
-    $self;
-});
-
 # pretend the add_method never happenned. it hasn't yet affected anything
 undef Class::MOP::Instance->meta->{_package_cache_flag};