Changeset 499

Show
Ignore:
Timestamp:
04/02/06 13:31:32
Author:
miyagawa
Message:

YAMLified chuspo; allow extract_after_hook

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r496 r499  
    179179    if (my @match = $args->{content} =~ /$self->{extract}/s) { 
    180180        my @capture = split /\s+/, $self->{extract_capture}; 
    181         my %data; @data{@capture} = @match; 
    182         if ($data{date} && $self->{extract_date_format}) { 
    183             @data{date} = Plagger::Date->strptime($self->{extract_date_format}, $data{date}); 
     181        my $data; 
     182        @{$data}{@capture} = @match; 
     183 
     184        if ($data->{date} && $self->{extract_date_format}) { 
     185            $data->{date} = Plagger::Date->strptime($self->{extract_date_format}, $data->{date}); 
    184186        } 
    185         return \%data; 
     187 
     188        if ($self->{extract_after_hook}) { 
     189            eval $self->{extract_after_hook}; 
     190            Plagger->context->error($@) if $@; 
     191        } 
     192 
     193        return $data; 
    186194    } 
    187195}