Commit | Line | Data |
632f0e07 |
1 | package App::SCS::Role::Plugin; |
2 | |
3 | use Moo::Role; |
4 | |
5 | with 'App::SCS::Role::WithConfig'; |
6 | |
7 | has app => ( |
8 | is => 'ro', weak_ref => 1, required => 1, |
9 | handles => [ 'pages' ], |
10 | ); |
11 | |
12 | sub page_plugins { () } |
13 | |
14 | sub default_page_plugins { () } |
15 | |
16 | sub page_dispatchers { () } |
17 | |
18 | sub provides_pages { () } |
19 | |
20 | sub register { return } |
21 | |
f50b4a35 |
22 | sub run_cli { |
23 | my ($self, $env) = @_; |
24 | my ($command, @argv) = @{$env->{argv}}; |
25 | return unless $command; |
26 | return unless $self->can(my $meth = "run_command_${command}"); |
27 | $self->$meth({ argv => \@argv, %$env }); |
28 | return 1; |
29 | } |
30 | |
632f0e07 |
31 | 1; |