diff options
author | doy <doy@tozt.net> | 2009-04-26 19:21:10 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-04-26 19:21:10 -0500 |
commit | 27da6e113d34fef72de8b95b7261c137d6f9ef76 (patch) | |
tree | 465ec1a6b5dad9b6d5cb9fb964b85631917c6a99 | |
parent | 39d4781a8db91a1892ffb170117a7e623348ebc3 (diff) | |
download | bot-games-27da6e113d34fef72de8b95b7261c137d6f9ef76.tar.gz bot-games-27da6e113d34fef72de8b95b7261c137d6f9ef76.zip |
renamespace a bunch of things
-rw-r--r-- | lib/Bot/Games.pm | 2 | ||||
-rw-r--r-- | lib/Bot/Games/Game.pm | 2 | ||||
-rw-r--r-- | lib/Bot/Games/Meta/Role/Attribute/Command.pm (renamed from lib/Bot/Games/Meta/Role/Attribute.pm) | 4 | ||||
-rw-r--r-- | lib/Bot/Games/Meta/Role/Class/Command.pm (renamed from lib/Bot/Games/Meta/Role/Class.pm) | 6 | ||||
-rw-r--r-- | lib/Bot/Games/Meta/Role/Method/Command.pm (renamed from lib/Bot/Games/Meta/Role/Command.pm) | 2 | ||||
-rw-r--r-- | lib/Bot/Games/OO/Game.pm | 13 |
6 files changed, 16 insertions, 13 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm index faae682..7bdcd79 100644 --- a/lib/Bot/Games.pm +++ b/lib/Bot/Games.pm @@ -172,7 +172,7 @@ sub _get_command { return $method_meta if blessed($method_meta) && $method_meta->meta->can('does_role') - && $method_meta->meta->does_role('Bot::Games::Meta::Role::Command'); + && $method_meta->meta->does_role('Bot::Games::Meta::Role::Method::Command'); } __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Bot/Games/Game.pm b/lib/Bot/Games/Game.pm index 7d82ce3..55a1547 100644 --- a/lib/Bot/Games/Game.pm +++ b/lib/Bot/Games/Game.pm @@ -15,7 +15,7 @@ has help => ( # just use that instead. has players => ( metaclass => 'Collection::Array', - traits => [qw/Bot::Games::Meta::Role::Attribute/], + traits => [qw/Bot::Games::Meta::Role::Attribute::Command/], is => 'ro', isa => 'ArrayRef[Str]', auto_deref => 1, diff --git a/lib/Bot/Games/Meta/Role/Attribute.pm b/lib/Bot/Games/Meta/Role/Attribute/Command.pm index 12c5803..bf3ea50 100644 --- a/lib/Bot/Games/Meta/Role/Attribute.pm +++ b/lib/Bot/Games/Meta/Role/Attribute/Command.pm @@ -1,4 +1,4 @@ -package Bot::Games::Meta::Role::Attribute; +package Bot::Games::Meta::Role::Attribute::Command; use Moose::Role; has command => ( @@ -27,7 +27,7 @@ around accessor_metaclass => sub { return $metaclass unless $self->command; return Moose::Meta::Class->create_anon_class( superclasses => [$metaclass], - roles => ['Bot::Games::Meta::Role::Command'], + roles => ['Bot::Games::Meta::Role::Method::Command'], cache => 1, )->name; }; diff --git a/lib/Bot/Games/Meta/Role/Class.pm b/lib/Bot/Games/Meta/Role/Class/Command.pm index b5eb061..9e8d647 100644 --- a/lib/Bot/Games/Meta/Role/Class.pm +++ b/lib/Bot/Games/Meta/Role/Class/Command.pm @@ -1,4 +1,4 @@ -package Bot::Games::Meta::Role::Class; +package Bot::Games::Meta::Role::Class::Command; use Moose::Role; after ((map { "add_${_}_method_modifier" } qw/before after around/) => sub { @@ -8,11 +8,11 @@ after ((map { "add_${_}_method_modifier" } qw/before after around/) => sub { my $method_meta = $self->get_method($name); my $orig_method_meta = $method_meta->get_original_method; return unless $orig_method_meta->meta->can('does_role') - && $orig_method_meta->meta->does_role('Bot::Games::Meta::Role::Command'); + && $orig_method_meta->meta->does_role('Bot::Games::Meta::Role::Method::Command'); my $pass_args = $orig_method_meta->pass_args; my $method_metaclass = Moose::Meta::Class->create_anon_class( superclasses => [blessed $method_meta], - roles => ['Bot::Games::Meta::Role::Command'], + roles => ['Bot::Games::Meta::Role::Method::Command'], cache => 1, ); $method_metaclass->rebless_instance($method_meta, pass_args => $pass_args); diff --git a/lib/Bot/Games/Meta/Role/Command.pm b/lib/Bot/Games/Meta/Role/Method/Command.pm index 75475f9..36e496f 100644 --- a/lib/Bot/Games/Meta/Role/Command.pm +++ b/lib/Bot/Games/Meta/Role/Method/Command.pm @@ -1,4 +1,4 @@ -package Bot::Games::Meta::Role::Command; +package Bot::Games::Meta::Role::Method::Command; use Moose::Role; has pass_args => ( diff --git a/lib/Bot/Games/OO/Game.pm b/lib/Bot/Games/OO/Game.pm index b95b33a..938af7c 100644 --- a/lib/Bot/Games/OO/Game.pm +++ b/lib/Bot/Games/OO/Game.pm @@ -8,7 +8,7 @@ sub command { my $superclass = Moose::blessed($method_meta) || 'Moose::Meta::Method'; my $method_metaclass = Moose::Meta::Class->create_anon_class( superclasses => [$superclass], - roles => ['Bot::Games::Meta::Role::Command'], + roles => ['Bot::Games::Meta::Role::Method::Command'], cache => 1, ); if ($method_meta) { @@ -22,7 +22,7 @@ sub command { ); $class->meta->add_method($name, $method_meta); } - for my $attr (Bot::Games::Meta::Role::Command->meta->get_attribute_list) { + for my $attr (Bot::Games::Meta::Role::Method::Command->meta->get_attribute_list) { $method_meta->$attr($args{$attr}) if exists $args{$attr}; } } @@ -37,9 +37,12 @@ sub init_meta { my %options = @_; Moose->init_meta(%options); Moose::Util::MetaRole::apply_metaclass_roles( - for_class => $options{for_class}, - attribute_metaclass_roles => ['Bot::Games::Meta::Role::Attribute'], - metaclass_roles => ['Bot::Games::Meta::Role::Class'], + for_class => + $options{for_class}, + attribute_metaclass_roles => + ['Bot::Games::Meta::Role::Attribute::Command'], + metaclass_roles => + ['Bot::Games::Meta::Role::Class::Command'], ); return $options{for_class}->meta; } |