Changeset 1878 for lang/perl/Class-Hookable
- Timestamp:
- 11/21/07 13:29:47 (14 months ago)
- Location:
- lang/perl/Class-Hookable/trunk
- Files:
-
- 5 modified
-
Changes (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
lib/Class/Hookable.pm (modified) (10 diffs)
-
t/01_register/00_register_hook.t (modified) (1 diff)
-
t/03_call/00_run_hook.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Class-Hookable/trunk/Changes
r1132 r1878 1 1 Revision history for Perl extension Class::Hookable 2 3 0.02 Wed Nov 11 13:00:00 JST 2007 4 * renamed 2 methods 5 filter_plugin -> filter_register_hook 6 dispatch_plugin -> filter_run_hook 7 - classified test files and POD. 8 - modified POD. 2 9 3 10 0.01 Sat Nov 3 15:08:06 2007 -
lang/perl/Class-Hookable/trunk/Makefile.PL
r1614 r1878 9 9 build_requires 'Test::More' ; 10 10 11 tests 't/*.t ';11 tests 't/*.t t/*/*.t'; 12 12 13 13 auto_include; -
lang/perl/Class-Hookable/trunk/lib/Class/Hookable.pm
r1877 r1878 7 7 use Scalar::Util(); 8 8 9 our $VERSION = '0.0 1';9 our $VERSION = '0.02'; 10 10 11 11 sub new { bless {}, shift } … … 35 35 }; 36 36 37 if ( $self->filter_ plugin( $hook, $action ) ) {37 if ( $self->filter_register_hook( $hook, $action ) ) { 38 38 $self->hooks->{$hook} = [] 39 39 if ( ref $self->hooks->{$hook} ne 'ARRAY' ); … … 44 44 } 45 45 46 sub filter_ plugin{ 1 }46 sub filter_register_hook { 1 } 47 47 48 48 sub registered_hooks { … … 141 141 142 142 for my $action ( $self->registered_plugins( $hook ) ) { 143 if ( $self-> dispatch_plugin( $hook, $args, $action ) ) {143 if ( $self->filter_run_hook( $hook, $args, $action ) ) { 144 144 my $plugin = $action->{'plugin'}; 145 145 my $result = $action->{'callback'}->( $plugin, $context, $args ); … … 163 163 } 164 164 165 sub dispatch_plugin{ 1 }165 sub filter_run_hook { 1 } 166 166 167 167 sub context { … … 210 210 211 211 This module was made by making reference to the hook mechanism of L<Plagger>. 212 I thank L<Tatsuhiko miyagawa|http://search.cpan.org/~miyagawa/>who made wonderful application.212 I thank Tatsuhiko Miyagawa who made wonderful application. 213 213 214 214 =head1 BASIC METHOD … … 236 236 and one after that is specified by the order of C<'hook' =E<gt> \&callabck>. 237 237 238 =head2 filter_ plugin239 240 sub filter_ plugin{238 =head2 filter_register_hook 239 240 sub filter_register_hook { 241 241 my ( $self, $hook, $action ) = @_; 242 242 my ( $plugin, $callback ) = @{ $action }{qw( plugin callback )}; … … 394 394 This method is an alias of C<$hook-E<gt>run_hook( $hook, $args, 1, \&callback )>. 395 395 396 =head2 dispatch_plugin397 398 sub dispatch_plugin{396 =head2 filter_run_hook 397 398 sub filter_run_hook { 399 399 my ( $self, $hook, $args, $action ) = @_; 400 400 my ( $plugin, $callabck ) = @{ $action }{qw( plugin callback )}; … … 402 402 } 403 403 404 When calling a hook, this method does a dispatch ofa plugin.404 When calling a hook, this method is filtered a plugin. 405 405 Argument are passed by the order of C<$hook>, C<$args>, C<$action>. 406 406 … … 449 449 =head1 AUTHOR 450 450 451 Naoki Okamura (Nyarla) E<lt>thotep@nayrla.netE<gt> 451 Original idea by Tatsuhiko Miyagawa L<http://search.cpan.org/~miyagawa> in L<Plagger> 452 453 Code by Naoki Okamura (Nyarla) E<lt>thotep@nayrla.netE<gt> 452 454 453 455 =head1 LICENSE -
lang/perl/Class-Hookable/trunk/t/01_register/00_register_hook.t
r1876 r1878 27 27 { 28 28 no warnings 'redefine'; 29 *Class::Hookable::filter_ plugin= sub { 0 };29 *Class::Hookable::filter_register_hook = sub { 0 }; 30 30 } 31 31 -
lang/perl/Class-Hookable/trunk/t/03_call/00_run_hook.t
r1876 r1878 63 63 64 64 no warnings 'redefine'; 65 *Class::Hookable:: dispatch_plugin= sub {65 *Class::Hookable::filter_run_hook = sub { 66 66 my ( $self, $hook, $args, $action ) = @_; 67 67
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)