Bring back p5-Class-Method-Modifiers-2.10

Needed now for p5-Moo

From new maintainer Sergey Bronniko
This commit is contained in:
afresh1 2014-04-05 06:20:05 +00:00
parent 8e20891512
commit 8eef1346ff
4 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# $OpenBSD: Makefile,v 1.8 2014/04/05 06:20:05 afresh1 Exp $
COMMENT = provides Moose-like method modifiers
MODULES = cpan
DISTNAME = Class-Method-Modifiers-2.10
CATEGORIES = devel
MAINTAINER = Sergey Bronnikov <estetus@gmail.com>
# Perl
PERMIT_PACKAGE_CDROM = Yes
TEST_DEPENDS = devel/p5-ExtUtils-BuildRC \
devel/p5-ExtUtils-Config \
devel/p5-ExtUtils-InstallPaths \
devel/p5-File-Find-Rule \
devel/p5-File-Slurp \
devel/p5-Test-Fatal \
devel/p5-Try-Tiny \
converters/p5-JSON
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (Class-Method-Modifiers-2.10.tar.gz) = Qg+1P3ifU+zdwXiQsPZIKJOXzO6y3gXwmUmZ/fMp57Y=
SIZE (Class-Method-Modifiers-2.10.tar.gz) = 36008

View File

@ -0,0 +1,23 @@
Method modifiers are a powerful feature from the CLOS (Common Lisp
Object System) world.
In its most basic form, a method modifier is just a method that calls
$self->SUPER::foo(@_). I for one have trouble remembering that exact
invocation, so my classes seldom re-dispatch to their base classes.
Very bad!
Class::Method::Modifiers provides three modifiers: before, around, and
after. before and after are run just before and after the method they
modify, but can not really affect that original method. around is run in
place of the original method, with a hook to easily call that original
method.
One clear benefit of using Class::Method::Modifiers is that you can
define multiple modifiers in a single namespace. These separate
modifiers don't need to know about each other. This makes top-down
design easy. Have a base class that provides the skeleton methods of
each operation, and have plugins modify those methods to flesh out the
specifics.
In short, Class::Method::Modifiers solves the problem of making sure you
call $self->SUPER::foo(@_), and provides a cleaner interface for it.

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST,v 1.4 2014/04/05 06:20:05 afresh1 Exp $
${P5SITE}/Class/
${P5SITE}/Class/Method/
${P5SITE}/Class/Method/Modifiers.pm
@man man/man3p/Class::Method::Modifiers.3p