| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package App::revealup::cli::export; | 
| 2 | 3 |  |  | 3 |  | 1098 | use App::revealup::base; | 
|  | 3 |  |  |  |  | 7 |  | 
|  | 3 |  |  |  |  | 18 |  | 
| 3 | 3 |  |  | 3 |  | 1037 | use Pod::Usage; | 
|  | 3 |  |  |  |  | 98259 |  | 
|  | 3 |  |  |  |  | 321 |  | 
| 4 | 3 |  |  | 3 |  | 1002 | use Try::Tiny; | 
|  | 3 |  |  |  |  | 4024 |  | 
|  | 3 |  |  |  |  | 183 |  | 
| 5 | 3 |  |  | 3 |  | 22 | use Carp qw/croak/; | 
|  | 3 |  |  |  |  | 6 |  | 
|  | 3 |  |  |  |  | 776 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | has 'sub_commands' => [qw/html theme/]; | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | sub run { | 
| 10 | 3 |  |  | 3 | 0 | 10 | my ($self, $sub_command, @args) = @_; | 
| 11 | 3 | 50 |  |  |  | 14 | usage() if !$sub_command; | 
| 12 | 3 | 100 |  |  |  | 11 | if ($sub_command eq 'generate'){ | 
| 13 | 1 |  |  |  |  | 2 | $sub_command = 'theme'; | 
| 14 |  |  |  |  |  |  | } | 
| 15 | 3 | 50 |  |  |  | 5 | if( grep { $_ eq $sub_command } @{$self->sub_commands} ) { | 
|  | 6 |  |  |  |  | 20 |  | 
|  | 3 |  |  |  |  | 9 |  | 
| 16 | 3 |  |  |  |  | 17 | my $klass = sprintf("App::revealup::cli::export::%s", lc($sub_command)); | 
| 17 | 3 | 50 |  |  |  | 165 | if(eval "require $klass;1;"){ | 
| 18 | 3 |  |  |  |  | 17 | my $instance = $klass->new(); | 
| 19 |  |  |  |  |  |  | try { | 
| 20 | 3 |  |  | 3 |  | 187 | $instance->run(@args); | 
| 21 |  |  |  |  |  |  | }catch{ | 
| 22 | 0 |  |  | 0 |  | 0 | croak $_; | 
| 23 | 3 |  |  |  |  | 24 | }; | 
| 24 | 3 |  |  |  |  | 74 | return; | 
| 25 |  |  |  |  |  |  | } | 
| 26 |  |  |  |  |  |  | } | 
| 27 | 0 |  |  |  |  |  | usage(); | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | sub usage { | 
| 31 | 0 |  |  | 0 | 0 |  | system "perldoc App::revealup::cli::export"; | 
| 32 | 0 |  |  |  |  |  | exit; | 
| 33 |  |  |  |  |  |  | } | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | 1; | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | __END__ |