[Bps-public-commit] r15106 - in Path-Dispatcher/trunk: lib/Path
sartak at bestpractical.com
sartak at bestpractical.com
Wed Aug 13 05:08:47 EDT 2008
Author: sartak
Date: Wed Aug 13 05:08:45 2008
New Revision: 15106
Modified:
Path-Dispatcher/trunk/ (props changed)
Path-Dispatcher/trunk/lib/Path/Dispatcher.pm
Log:
r69448 at onn: sartak | 2008-08-13 04:57:59 -0400
add_rule should not silently create new rules, because we'll be getting multiple rule subclasses
Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher.pm (original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher.pm Wed Aug 13 05:08:45 2008
@@ -15,7 +15,7 @@
isa => 'ArrayRef[Path::Dispatcher::Rule]',
default => sub { [] },
provides => {
- push => '_add_rule',
+ push => 'add_rule',
elements => 'rules',
},
);
@@ -54,23 +54,6 @@
return ('first', @{ $self->_stages }, 'last');
}
-sub add_rule {
- my $self = shift;
-
- my $rule;
-
- # they pass in an already instantiated rule..
- if (@_ == 1 && blessed($_[0])) {
- $rule = shift;
- }
- # or they pass in args to create a rule
- else {
- $rule = $self->rule_class->new(@_);
- }
-
- $self->_add_rule($rule);
-}
-
sub dispatch {
my $self = shift;
my $path = shift;
More information about the Bps-public-commit
mailing list