Permalink
Browse files

added catalyst like plugin name resolver

  • Loading branch information...
1 parent 32e279f commit 43441d44974391b2e7b1ebf53cccbc041162633b @dann committed Apr 14, 2009
@@ -85,10 +85,11 @@ requires(
'DBIx::Class::UTF8Columns' => 0,
# Controller plugins
- 'Time::HiRes' => 0,
+ 'Time::HiRes' => 0,
+ 'HTML::Shakan' => 0,
# I18N
- 'Data::Localize' => 0,
+ 'Data::Localize' => '0.00005',
'Locale::Maketext::Simple' => 0,
'Locale::Maketext::Extract' => 0,
@@ -5,8 +5,8 @@ type: :task
component: angelos
release: "0.01"
reporter: dann <techmemo@gmail.com>
-status: :unstarted
-disposition:
+status: :closed
+disposition: :fixed
creation_time: 2009-03-13 23:08:26.156138 Z
references: []
@@ -16,3 +16,7 @@ log_events:
- dann <techmemo@gmail.com>
- created
- ""
+- - 2009-03-27 04:04:18.921719 Z
+ - dann <techmemo@gmail.com>
+ - closed with disposition fixed
+ - ""
@@ -25,10 +25,6 @@ sub _build_request_handler {
my $middleware_name
= $class->resovle_middleware_name( $middleware->{module} );
my $config = $middleware->{config} || {};
-
- #$middleware_name->require;
- #Angelos::Exception->throw( message => "Can't load middleware:$@" )
- # if $@;
$mw->install( $middleware_name => $config );
}
@@ -37,7 +33,13 @@ sub _build_request_handler {
sub resovle_middleware_name {
my ( $class, $name ) = @_;
- my $middleeware_name ||= 'Angelos::Middleware::' . $name;
+ my $middleeware_name;
+ if ( index( $name, '+' ) == 0 ) {
+ $middleeware_name = $name;
+ }
+ else {
+ $middleeware_name = 'Angelos::Middleware::' . $name;
+ }
return $middleeware_name;
}
@@ -3,10 +3,10 @@ components:
controller:
- module: A
-#plugins:
-# controller:
+plugins:
+ controller:
+ - module: HTML::Shakan
# - module: ActionProfiler
-#
# - module: DebugHook
#mixins:
@@ -1,19 +0,0 @@
-package TestApp::Web::Controller::MiddlewareUnicode;
-use Mouse;
-extends 'Angelos::Controller';
-
-no Mouse;
-
-sub index {
- my ( $self, $c, $params ) = @_;
- my $name = $c->req->param('name');
- die "this isn't utf8 flagged" unless utf8::is_utf8($name);
-
- # must not reach here because we use Unicode middleware
- $c->res->code(200);
- $c->res->body('HelloWorld');
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
@@ -1,13 +0,0 @@
-package TestApp::Web::Controller::PluginDumper;
-use Mouse;
-use Carp ();
-use Angelos::Utils;
-extends 'Angelos::Controller';
-
-sub dumper {
- my ( $self, $c, $params ) = @_;
- #$self->dump($c->req);
- $c->res->body('HelloWorld');
-}
-
-1;

0 comments on commit 43441d4

Please sign in to comment.