Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

factor out rerendering into a method on Blawd.pm

  • Loading branch information...
commit 70c533db4cc3b5a71c66953b84fa2d5f5155bfaa 1 parent b467327
@doy doy authored
View
3  bin/autoblog
@@ -19,6 +19,5 @@ while ($watcher->wait_for_events) {
my $storage = Blawd::Storage::Directory->new(location => $repo);
my $container = Blawd::Cmd::Container->new(storage => $storage);
my $blawd = $container->build_app;
- $_->render_to_file( $out . '/' . $_->filename . $_->extension )
- for ( @{ $blawd->indexes }, $blawd->entries );
+ $blawd->render_all($out);
}
View
7 lib/Blawd.pm
@@ -38,6 +38,13 @@ sub get_entry {
return $entry;
}
+sub render_all {
+ my $self = shift;
+ my ($output_dir) = @_;
+ $_->render_to_file( $output_dir . '/' . $_->filename . $_->extension )
+ for ( @{ $self->indexes }, $self->entries );
+}
+
__PACKAGE__->meta->make_immutable;
1;
__END__
View
3  lib/Blawd/Cmd/Command/render.pm
@@ -26,8 +26,7 @@ sub _build_container {
sub execute {
my $self = shift;
my $blawd = $self->container->build_app;
- $_->render_to_file( $self->output_dir . '/' . $_->filename . $_->extension )
- for ( @{ $blawd->indexes }, $blawd->entries );
+ $blawd->render_all($self->output_dir);
}
__PACKAGE__->meta->make_immutable;
Please sign in to comment.
Something went wrong with that request. Please try again.