diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-08-25 02:33:26 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-08-25 02:33:26 -0500 |
commit | dd21b9ecbd5c850b2569c75a2a6dd1a5eaf11440 (patch) | |
tree | 86d8d3bb435403bb5ae0e97c74cb2221283f68bf | |
parent | ae48f65cedf7115f1efe34091595f28e1b60c35f (diff) | |
download | im-engine-plugin-commands-dd21b9ecbd5c850b2569c75a2a6dd1a5eaf11440.tar.gz im-engine-plugin-commands-dd21b9ecbd5c850b2569c75a2a6dd1a5eaf11440.zip |
have the custom exporter automatically set the base class when possible
-rw-r--r-- | lib/IM/Engine/Plugin/Commands/OO.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/IM/Engine/Plugin/Commands/OO.pm b/lib/IM/Engine/Plugin/Commands/OO.pm index 132d08a..581582c 100644 --- a/lib/IM/Engine/Plugin/Commands/OO.pm +++ b/lib/IM/Engine/Plugin/Commands/OO.pm @@ -63,7 +63,12 @@ sub init_meta { ['IM::Engine::Plugin::Commands::Trait::Class::Command', 'IM::Engine::Plugin::Commands::Trait::Class::Formatted'], ); - return $options{for_class}->meta; + my $meta = Class::MOP::class_of($options{for_class}); + my @supers = $meta->superclasses; + $meta->superclasses('IM::Engine::Plugin::Commands::Command') + if @supers == 1 && $supers[0] eq 'Moose::Object' + && $options{for_class} ne 'IM::Engine::Plugin::Commands::Command'; + return $meta; } 1; |