basic porting work for SCSite
[scpubgit/App-SCS.git] / lib / App / SCS / Role / Plugin.pm
CommitLineData
632f0e07 1package App::SCS::Role::Plugin;
2
3use Moo::Role;
4
5with 'App::SCS::Role::WithConfig';
6
7has app => (
8 is => 'ro', weak_ref => 1, required => 1,
9 handles => [ 'pages' ],
10);
11
12sub page_plugins { () }
13
14sub default_page_plugins { () }
15
16sub page_dispatchers { () }
17
18sub provides_pages { () }
19
20sub register { return }
21
f50b4a35 22sub 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 311;