Changeset 10534

Show
Ignore:
Timestamp:
04/27/08 14:14:45 (5 years ago)
Author:
tokuhirom
Message:

check the role

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Nanto/trunk/lib/Nanto/Plugin/Factory.pm

    r10532 r10534  
    33use Moose::Role; 
    44use UNIVERSAL::require; 
     5use Carp; 
    56 
    67requires 'base_name', 'config'; 
     
    1112    $factory->use or die $@; 
    1213 
    13     # TODO: check $class does Nanto::Role::Factory? 
     14    croak "$factory does not Nanto::Role::Factory" unless $factory->does('Nanto::Role::Factory'); 
     15 
    1416    if ($factory->per_context) { 
    1517        $self->{__PACKAGE__ . "__Factory::$module"} ||= $self->_create_instance( $factory, $module );