Show
Ignore:
Timestamp:
01/19/08 22:30:13 (5 years ago)
Author:
tokuhirom
Message:

プラグインの仕様を変更。プラグインから HTTP::Proxy に依存した動作をとりのぞいた。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Moxy/trunk/lib/Moxy.pm

    r4944 r4970  
    1616use Carp; 
    1717use Log::Dispatch; 
     18use Scalar::Util qw/blessed/; 
    1819my $TERM_ANSICOLOR_ENABLED = eval { use Term::ANSIColor; 1; }; 
    1920 
     
    174175} 
    175176 
     177sub run_hook_and_get_response { 
     178    my ($self, $hook, @args) = @_; 
     179 
     180    $self->log(debug => "Run hook and get response: $hook"); 
     181    for my $action (@{$self->{hooks}->{$hook}}) { 
     182        my $response = $action->($self, @args); 
     183        return $response if blessed $response && $response->isa('HTTP::Response'); 
     184    } 
     185    return; # not finished yet 
     186} 
     187 
    176188sub get_hooks { 
    177189    my ($self, $hook) = @_;