File: Plugin.pm

package info (click to toggle)
libdevel-repl-perl 1.003011-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 408 kB
  • ctags: 252
  • sloc: perl: 3,380; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package Devel::REPL::Meta::Plugin;

use Moose;

extends 'Moose::Meta::Role';

before 'apply' => sub {
  my ($self, $other) = @_;
  return unless $other->isa('Devel::REPL');
  if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
    $pre->body->($other, $self);
  }
};

after 'apply' => sub {
  my ($self, $other) = @_;
  return unless $other->isa('Devel::REPL');
  if (my $pre = $self->get_method('AFTER_PLUGIN')) {
    $pre->body->($other, $self);
  }
};

1;