Use new Catalyst features
[catagits/Gitalist.git] / lib / Gitalist / TraitFor / Script.pm
CommitLineData
7f9d2ed9 1package Gitalist::TraitFor::Script;
a18818fd 2use Moose::Role;
5e26dc93 3use MooseX::Types::Moose qw/ Undef /;
a18818fd 4use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
5use namespace::autoclean;
6
7has 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 161;
17
e56c039f 18=head1 NAME
19
20Gitalist::ScriptRole - Role for Gitalist scripts.
21
22=head1 DESCRIPTION
23
24Wraps the run method in Catalyst scripts to apply the C<< --repo_dir >>
25option.
26
27=head1 AUTHORS
28
29See L<Gitalist> for authors.
30
31=head1 LICENSE
32
33See L<Gitalist> for the license.
34
35=cut