Fix if you don't have AuthorRequires or AuthorTests
[catagits/Gitalist.git] / lib / Gitalist / ScriptRole.pm
CommitLineData
a18818fd 1package Gitalist::ScriptRole;
2use Moose::Role;
3use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
4use namespace::autoclean;
5
6has repo_dir => (
7 isa => NonEmptySimpleStr, is => 'ro',
8 predicate => 'has_repo_dir'
9);
10
11before 'run' => sub {
12 my $self = shift;
13 if ($self->has_repo_dir) {
14 # FIXME - This seems gross. I should be able to pass things through
15 # to the app instance, but the params are sent to the engine
16 # and not actually used to construct the app.. Not that
17 # $ENV{GITLIST_REPO_DIR} is a bad move, just that that being
18 # the mechanism by which this works that is non optimum.
19 $ENV{GITALIST_REPO_DIR} = $self->repo_dir;
20 }
21};
22
231;
24