Changeset 1408
- Timestamp:
- 08/19/06 18:08:21
- Files:
-
- trunk/plagger/lib/Plagger/Plugin/Publish/JSON.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Publish/JSON.pm
r1389 r1408 1 1 package Plagger::Plugin::Publish::JSON; 2 2 use strict; 3 use base qw( Plagger::Plugin ::Publish::JavaScript);3 use base qw( Plagger::Plugin ); 4 4 5 5 use File::Spec; 6 6 use JSON::Syck; 7 7 use Plagger::Walker; 8 use Plagger::Util; 9 10 sub 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 } 8 19 9 20 sub register { … … 18 29 my($self, $context, $args) = @_; 19 30 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'); 21 32 my $path = File::Spec->catfile($self->conf->{dir}, $file); 22 33 $context->log(info => "writing output to $path");
