Changeset 1408

Show
Ignore:
Timestamp:
08/19/06 18:08:21
Author:
miyagawa
Message:

Publish::JSON: don't inherit from JavaScript?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/JSON.pm

    r1389 r1408  
    11package Plagger::Plugin::Publish::JSON; 
    22use strict; 
    3 use base qw( Plagger::Plugin::Publish::JavaScript ); 
     3use base qw( Plagger::Plugin ); 
    44 
    55use File::Spec; 
    66use JSON::Syck; 
    77use Plagger::Walker; 
     8use Plagger::Util; 
     9 
     10sub init { 
     11    my $self = shift; 
     12    $self->SUPER::init(@_); 
     13 
     14    my $dir = $self->conf->{dir}; 
     15    unless (-e $dir && -d _) { 
     16        mkdir $dir, 0755 or Plagger->context->error("mkdir $dir: $!"); 
     17    } 
     18} 
    819 
    920sub register { 
     
    1829    my($self, $context, $args) = @_; 
    1930 
    20     my $file = $self->gen_filename($args->{feed}, $self->conf->{filename} || '%i.json'); 
     31    my $file = Plagger::Util::filename_for($args->{feed}, $self->conf->{filename} || '%i.json'); 
    2132    my $path = File::Spec->catfile($self->conf->{dir}, $file); 
    2233    $context->log(info => "writing output to $path");