Commit | Line | Data |
a18818fd |
1 | package Gitalist::ScriptRole; |
2 | use Moose::Role; |
5e26dc93 |
3 | use MooseX::Types::Moose qw/ Undef /; |
a18818fd |
4 | use MooseX::Types::Common::String qw/NonEmptySimpleStr/; |
5 | use namespace::autoclean; |
6 | |
7 | has repo_dir => ( |
5e26dc93 |
8 | isa => Undef | NonEmptySimpleStr, |
9 | is => 'ro', |
10 | default => sub { |
11 | return unless exists $ENV{GITALIST_REPO_DIR}; |
12 | $ENV{GITALIST_REPO_DIR}; |
13 | }, |
a18818fd |
14 | ); |
15 | |
a18818fd |
16 | 1; |
17 | |
e56c039f |
18 | =head1 NAME |
19 | |
20 | Gitalist::ScriptRole - Role for Gitalist scripts. |
21 | |
22 | =head1 DESCRIPTION |
23 | |
24 | Wraps the run method in Catalyst scripts to apply the C<< --repo_dir >> |
25 | option. |
26 | |
27 | =head1 AUTHORS |
28 | |
29 | See L<Gitalist> for authors. |
30 | |
31 | =head1 LICENSE |
32 | |
33 | See L<Gitalist> for the license. |
34 | |
35 | =cut |