[Moose-commits] r7164 - in Mouse/trunk: . lib/Mouse/Meta
t/800_shikabased
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Mon Dec 22 04:10:08 GMT 2008
Author: sartak
Date: 2008-12-21 20:10:07 -0800 (Sun, 21 Dec 2008)
New Revision: 7164
Modified:
Mouse/trunk/
Mouse/trunk/lib/Mouse/Meta/Class.pm
Mouse/trunk/t/800_shikabased/008-create_class.t
Log:
r77775 at onn: sartak | 2008-12-21 23:09:58 -0500
Begin stealing more Moose meta API
Property changes on: Mouse/trunk
___________________________________________________________________
Name: svk:merge
- 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77773
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
+ 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77775
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
Modified: Mouse/trunk/lib/Mouse/Meta/Class.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Class.pm 2008-12-22 04:06:32 UTC (rev 7163)
+++ Mouse/trunk/lib/Mouse/Meta/Class.pm 2008-12-22 04:10:07 UTC (rev 7164)
@@ -208,13 +208,8 @@
}
sub create {
- my ( $class, @args ) = @_;
+ my ($self, $package_name, %options) = @_;
- unshift @args, 'package' if @args % 2 == 1;
-
- my (%options) = @args;
- my $package_name = $options{package};
-
(ref $options{superclasses} eq 'ARRAY')
|| confess "You must pass an ARRAY ref of superclasses"
if exists $options{superclasses};
@@ -228,9 +223,6 @@
if exists $options{methods};
do {
- # XXX should I implement Mouse::Meta::Module?
- my $package_name = $options{package};
-
( defined $package_name && $package_name )
|| confess "You must pass a package name";
@@ -244,8 +236,7 @@
confess "creation of $package_name failed : $@" if $@;
};
- my (%initialize_options) = @args;
- delete @initialize_options{qw(
+ delete @options{qw(
package
superclasses
attributes
@@ -253,11 +244,11 @@
version
authority
)};
- my $meta = $class->initialize( $package_name => %initialize_options );
+ my $meta = $self->initialize( $package_name => %options );
# FIXME totally lame
$meta->add_method('meta' => sub {
- $class->initialize(ref($_[0]) || $_[0]);
+ $self->initialize(ref($_[0]) || $_[0]);
});
$meta->superclasses(@{$options{superclasses}})
Modified: Mouse/trunk/t/800_shikabased/008-create_class.t
===================================================================
--- Mouse/trunk/t/800_shikabased/008-create_class.t 2008-12-22 04:06:32 UTC (rev 7163)
+++ Mouse/trunk/t/800_shikabased/008-create_class.t 2008-12-22 04:10:07 UTC (rev 7164)
@@ -38,7 +38,7 @@
isa_ok(
Mouse::Meta::Class->create(
- package => "Baz",
+ "Baz",
superclasses => [ "FooBar", "Mouse::Object" ],
attributes => [
Mouse::Meta::Attribute->new(
More information about the Moose-commits
mailing list