New port: devel/p5-Class-Method-Modifiers, Provides Moose-like method modifiers

This commit is contained in:
Lars Balker Rasmussen 2008-07-23 08:05:22 +00:00
parent a709a835ba
commit 71dc6f234c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=217350
5 changed files with 60 additions and 0 deletions

View file

@ -1016,6 +1016,7 @@
SUBDIR += p5-Class-MOP SUBDIR += p5-Class-MOP
SUBDIR += p5-Class-MakeMethods SUBDIR += p5-Class-MakeMethods
SUBDIR += p5-Class-Measure SUBDIR += p5-Class-Measure
SUBDIR += p5-Class-Method-Modifiers
SUBDIR += p5-Class-MethodMaker SUBDIR += p5-Class-MethodMaker
SUBDIR += p5-Class-MethodMapper SUBDIR += p5-Class-MethodMapper
SUBDIR += p5-Class-MixinFactory SUBDIR += p5-Class-MixinFactory

View file

@ -0,0 +1,27 @@
# New ports collection makefile for: devel/p5-Class-Method-Modifiers
# Date created: 23 Jul 2008
# Whom: Lars Balker Rasmussen <lbr@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= Class-Method-Modifiers
PORTVERSION= 1.01
CATEGORIES= devel perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
MAINTAINER= lbr@FreeBSD.org
COMMENT= Provides Moose-like method modifiers
RUN_DEPENDS= p5-MRO-Compat>=0:${PORTSDIR}/devel/p5-MRO-Compat
BUILD_DEPENDS= ${RUN_DEPENDS}
PERL_CONFIGURE= 5.8.0+
MAN3= Class::Method::Modifiers.3
post-extract:
@${PERL} -i -ne 'print unless m,build_requires,' ${WRKSRC}/Makefile.PL
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
MD5 (Class-Method-Modifiers-1.01.tar.gz) = f0398c468025d21493745619b1114a46
SHA256 (Class-Method-Modifiers-1.01.tar.gz) = ce22a834bbe79e2ff5c01709becffaf0c9a7d71b3bd94b2e07b611fe4f0375be
SIZE (Class-Method-Modifiers-1.01.tar.gz) = 23163

View file

@ -0,0 +1,22 @@
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.
WWW: http://search.cpan.org/dist/Class-Method-Modifiers/

View file

@ -0,0 +1,7 @@
%%SITE_PERL%%/Class/Method/Modifiers.pm
%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Method/Modifiers/.packlist
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Method/Modifiers
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Method
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class
@dirrmtry %%SITE_PERL%%/Class/Method
@dirrmtry %%SITE_PERL%%/Class