[Bps-public-commit] r14420 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Wed Jul 23 01:41:40 EDT 2008


Author: sartak
Date: Wed Jul 23 01:41:40 2008
New Revision: 14420

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/Command/Html.pm

Log:
 r64794 at onn:  sartak | 2008-07-23 01:41:35 -0400
 Allow user to choose a particular type to render (I keep using this word, maybe it should be the command's name..) and allow subclasses to define which types are rendered by default


Modified: Prophet/trunk/lib/Prophet/CLI/Command/Html.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Html.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Html.pm	Wed Jul 23 01:41:40 2008
@@ -28,10 +28,10 @@
     my $self = shift;
     my $dir  = shift;
 
-    my @types = @{ $self->app_handle->handle->list_types };
-    for my $type (@types) {
-        next if $self->should_skip_type($type);
+    # allow user to specify a specific type to render
+    my @types = $self->type || $self->types_to_render;
 
+    for my $type (@types) {
         my $subdir = $dir->subdir($type);
         $subdir->mkpath;
 
@@ -59,6 +59,13 @@
     return 0;
 }
 
+sub types_to_render {
+    my $self = shift;
+
+    return grep { !$self->should_skip_type($_) }
+           @{ $self->app_handle->handle->list_types };
+}
+
 __PACKAGE__->meta->make_immutable;
 no Moose;
 



More information about the Bps-public-commit mailing list