sub setup_component {
my( $class, $component ) = @_;
+
+ #warn("Component $component has meta " . $component->meta);
unless ( $component->can( 'COMPONENT' ) ) {
return $component;
}
use Moose::Role;
use Class::MOP;
-use Class::MOP::Object;
+use Moose::Util ();
sub mk_classdata {
my ($class, $attribute) = @_;
my $slot = '$'.$attribute;
my $accessor = sub {
my $pkg = ref $_[0] || $_[0];
- # Hack - delberately create a metaclass instance
- my $meta = $pkg->Moose::Object::meta();
+ my $meta = Moose::Util::find_meta($pkg)
+ || Moose->init_meta( for_class => $pkg );
if (@_ > 1) {
$meta->namespace->{$attribute} = \$_[1];
return $_[1];
#this is still not correct for some reason.
my $namespace = $self->action_namespace($c);
my $meta = find_meta($self);
+ confess("Wrong metaclass $meta for $self - " . $meta->name)
+ unless $meta->can('get_all_methods_with_attributes');
my @methods = $meta->get_all_methods_with_attributes;
foreach my $method (@methods) {