|
Revision 78
(checked in by miyagawa, 3 years ago)
|
- Reverted hooks method on rules.
- Added rule_hook to Plugin, which is the only point where rule can control. Refs #22
|
- Property svn:keywords set to
Id Revision
|
| Line | |
|---|
| 1 |
package Plagger::Rule::Expression; |
|---|
| 2 |
use strict; |
|---|
| 3 |
use base qw( Plagger::Rule ); |
|---|
| 4 |
|
|---|
| 5 |
sub dispatch { |
|---|
| 6 |
my($self, $args) = @_; |
|---|
| 7 |
my $status = eval $self->{expression}; |
|---|
| 8 |
if ($@) { |
|---|
| 9 |
Plagger->context->log(error => "Expression error: $@ with '$self->{expression}'"); |
|---|
| 10 |
} |
|---|
| 11 |
$status; |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
| 14 |
1; |
|---|