From: matthewt Date: Fri, 17 Aug 2007 15:51:52 +0000 (+0000) Subject: renamed compose to pipeline cos Lemm@netgoth.org.uk#orgy convinced me it made more... X-Git-Tag: 1.006009~114 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b94dce5a79a169474bc581ec122a2ff5e2eb3ef;p=p5sagit%2Flocal-lib.git renamed compose to pipeline cos Lemm@netgoth.org.uk#orgy convinced me it made more sense git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@3685 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 557a9a6..26f60ec 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -19,15 +19,15 @@ sub import { $class->setup_local_lib_for($path); } -sub compose; +sub pipeline; -sub compose { +sub pipeline { my @methods = @_; my $last = pop(@methods); if (@methods) { \sub { my ($obj, @args) = @_; - $obj->${compose @methods}( + $obj->${pipeline @methods}( $obj->$last(@args) ); }; @@ -44,13 +44,13 @@ package local::lib; { package Foo; sub foo { -$_[1] } sub bar { $_[1]+2 } sub baz { $_[1]+3 } } my $foo = bless({}, 'Foo'); -ok($foo->${compose qw(foo bar baz)}(10) == -15); +ok($foo->${pipeline qw(foo bar baz)}(10) == -15); =cut sub resolve_path { my ($class, $path) = @_; - $class->${compose qw( + $class->${pipeline qw( resolve_relative_path resolve_home_path resolve_empty_path