Permalink
Browse files

Also added Any and Regexp blocks for duplicate check

  • Loading branch information...
1 parent 181ef9a commit 8867f9db544d3461bc7e77d761f7967b4d2276bc @Getty Getty committed Mar 5, 2013
Showing with 3 additions and 8 deletions.
  1. +2 −2 lib/DDG/Block/Any.pm
  2. +1 −6 lib/DDG/Block/Regexp.pm
@@ -20,8 +20,8 @@ sub request {
for (@{$self->plugin_objs}) {
my $trigger = $_->[0];
my $plugin = $_->[1];
- push @results, $plugin->handle_request_matches($request,0);
- return @results if $self->return_one;
+ push @results, $self->handle_request_matches($plugin,$request,0);
+ return @results if $self->return_one && @results;
}
return @results;
}
@@ -25,11 +25,6 @@ sub parse_trigger {
return $triggers;
}
-=method request
-
-
-=cut
-
sub request {
my ( $self, $request ) = @_;
my @results;
@@ -40,7 +35,7 @@ sub request {
for my $attr (keys %{$trigger}) {
for (@{$trigger->{$attr}}) {
if ( my @matches = $request->$attr =~ m/$_/ ) {
- push @results, $plugin->handle_request_matches($request,@matches);
+ push @results, $self->handle_request_matches($plugin,$request,@matches);
return @results if $self->return_one && @results;
}
}

0 comments on commit 8867f9d

Please sign in to comment.