From: Stevan Little Date: Sun, 16 Mar 2008 21:20:27 +0000 (+0000) Subject: s/metaclass/__PACKAGE__->meta/ X-Git-Tag: 0_55~271 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a3217dee17f651ca5c748b2312f35d6cdd96955;p=gitmo%2FMoose.git s/metaclass/__PACKAGE__->meta/ --- diff --git a/benchmarks/caf_vs_moose.pl b/benchmarks/caf_vs_moose.pl index d9c8d8b..2634484 100644 --- a/benchmarks/caf_vs_moose.pl +++ b/benchmarks/caf_vs_moose.pl @@ -11,13 +11,13 @@ package MooseImmutable; use Moose; has foo => (is => 'rw'); - metaclass->make_immutable(); + __PACKAGE__->meta->make_immutable(); } { package MooseImmutable::NoConstructor; use Moose; has foo => (is => 'rw'); - metaclass->make_immutable(inline_constructor => 0); + __PACKAGE__->meta->make_immutable(inline_constructor => 0); } { package ClassAccessorFast; diff --git a/lib/Moose.pm b/lib/Moose.pm index 3c61cfd..644ac6f 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -165,12 +165,6 @@ use Moose::Util (); $class->meta->add_augment_method_modifier( $name => $method ); }; }, - metaclass => sub { - my $class = $CALLER; - return subname 'Moose::metaclass' => sub { - $class->meta; - }; - }, make_immutable => sub { my $class = $CALLER; return subname 'Moose::make_immutable' => sub { diff --git a/t/000_recipes/001_recipe.t b/t/000_recipes/001_recipe.t index 3b5651a..91b877a 100644 --- a/t/000_recipes/001_recipe.t +++ b/t/000_recipes/001_recipe.t @@ -23,7 +23,7 @@ BEGIN { $self->y(0); } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package Point3D; use Moose; @@ -37,7 +37,7 @@ BEGIN { $self->{z} = 0; }; - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $point = Point->new(x => 1, y => 2); diff --git a/t/000_recipes/002_recipe.t b/t/000_recipes/002_recipe.t index f07bb06..4e0b571 100644 --- a/t/000_recipes/002_recipe.t +++ b/t/000_recipes/002_recipe.t @@ -29,7 +29,7 @@ BEGIN { $self->balance($current_balance - $amount); } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package CheckingAccount; use Moose; @@ -47,7 +47,7 @@ BEGIN { } }; - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $savings_account = BankAccount->new(balance => 250); diff --git a/t/000_recipes/003_recipe.t b/t/000_recipes/003_recipe.t index 804e007..cc7afbd 100644 --- a/t/000_recipes/003_recipe.t +++ b/t/000_recipes/003_recipe.t @@ -46,7 +46,7 @@ BEGIN { $tree->parent($self) if defined $tree; }; - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $root = BinaryTree->new(node => 'root'); diff --git a/t/000_recipes/004_recipe.t b/t/000_recipes/004_recipe.t index b5a9af2..1f9bbc0 100644 --- a/t/000_recipes/004_recipe.t +++ b/t/000_recipes/004_recipe.t @@ -45,7 +45,7 @@ BEGIN { has 'state' => (is => 'rw', isa => 'USState'); has 'zip_code' => (is => 'rw', isa => 'USZipCode'); - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package Company; @@ -80,7 +80,7 @@ BEGIN { } }; - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package Person; @@ -98,7 +98,7 @@ BEGIN { $self->last_name; } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package Employee; @@ -114,7 +114,7 @@ BEGIN { super() . ', ' . $self->title }; - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $ii; diff --git a/t/000_recipes/005_recipe.t b/t/000_recipes/005_recipe.t index 2189c99..7ea0371 100644 --- a/t/000_recipes/005_recipe.t +++ b/t/000_recipes/005_recipe.t @@ -62,7 +62,7 @@ BEGIN { default => sub { HTTP::Headers->new } ); - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $r = Request->new; diff --git a/t/000_recipes/006_recipe.t b/t/000_recipes/006_recipe.t index d792ba7..5b8f9d2 100644 --- a/t/000_recipes/006_recipe.t +++ b/t/000_recipes/006_recipe.t @@ -81,7 +81,7 @@ BEGIN { sprintf '$%0.2f USD' => $self->amount } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } ok(US::Currency->does('Comparable'), '... US::Currency does Comparable'); diff --git a/t/010_basics/009_import_unimport.t b/t/010_basics/009_import_unimport.t index 529db5e..9bc2c76 100644 --- a/t/010_basics/009_import_unimport.t +++ b/t/010_basics/009_import_unimport.t @@ -16,7 +16,7 @@ my @moose_exports = qw( override augment super inner - metaclass + make_immutable ); { diff --git a/t/010_basics/015_metaclass_keyword.t b/t/010_basics/015_metaclass_keyword.t deleted file mode 100644 index 3c07d34..0000000 --- a/t/010_basics/015_metaclass_keyword.t +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More tests => 2; - -BEGIN { - use_ok('Moose'); -} - -{ - - package Foo; - use Moose; - - ::is( metaclass(), __PACKAGE__->meta, 'metaclass and __PACKAGE__->meta are the same' ); -} - diff --git a/t/020_attributes/019_attribute_lazy_initializer.t b/t/020_attributes/019_attribute_lazy_initializer.t index 88d755f..2c6f9ac 100644 --- a/t/020_attributes/019_attribute_lazy_initializer.t +++ b/t/020_attributes/019_attribute_lazy_initializer.t @@ -115,7 +115,7 @@ BEGIN { }, ); - metaclass->make_immutable; + __PACKAGE__->meta->make_immutable; } { @@ -143,7 +143,7 @@ BEGIN { }, ); - metaclass->make_immutable; + __PACKAGE__->meta->make_immutable; } dies_ok { diff --git a/t/030_roles/003_apply_role.t b/t/030_roles/003_apply_role.t index 96f406a..4be0dfa 100644 --- a/t/030_roles/003_apply_role.t +++ b/t/030_roles/003_apply_role.t @@ -39,7 +39,7 @@ BEGIN { sub boo { 'BarClass::boo' } sub foo { 'BarClass::foo' } # << the role overrides this ... - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package FooClass; @@ -52,7 +52,7 @@ BEGIN { sub goo { 'FooClass::goo' } # << overrides the one from the role ... - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); }{ package FooBarClass; diff --git a/t/060_compat/003_foreign_inheritence.t b/t/060_compat/003_foreign_inheritence.t index 573cc22..e3d8bbc 100644 --- a/t/060_compat/003_foreign_inheritence.t +++ b/t/060_compat/003_foreign_inheritence.t @@ -35,7 +35,7 @@ BEGIN { return $class->meta->new_object('__INSTANCE__' => $super, @_); } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); package Bucket; use metaclass 'Class::MOP::Class'; diff --git a/t/300_immutable/002_apply_roles_to_immutable.t b/t/300_immutable/002_apply_roles_to_immutable.t index 6149a1d..e4e0c3e 100644 --- a/t/300_immutable/002_apply_roles_to_immutable.t +++ b/t/300_immutable/002_apply_roles_to_immutable.t @@ -26,7 +26,7 @@ BEGIN { sub baz { 'Foo::baz' } - metaclass->make_immutable(debug => 0); + __PACKAGE__->meta->make_immutable(debug => 0); } my $foo = Foo->new; diff --git a/t/300_immutable/006_immutable_nonmoose_subclass.t b/t/300_immutable/006_immutable_nonmoose_subclass.t index 200db87..c04a44b 100644 --- a/t/300_immutable/006_immutable_nonmoose_subclass.t +++ b/t/300_immutable/006_immutable_nonmoose_subclass.t @@ -82,7 +82,7 @@ Sorry Sartak. sub child { 1 } - metaclass->make_immutable; + __PACKAGE__->meta->make_immutable; } is(blessed(Grandparent->new), "Grandparent", "got a Grandparent object out of Grandparent->new");