Commit | Line | Data |
21336a02 |
1 | package Gitalist::Model::GitRepos; |
2 | |
3 | use Moose; |
4 | use Gitalist::Git::Repo; |
bddfb71e |
5 | use MooseX::Types::Common::String qw/NonEmptySimpleStr/; |
21336a02 |
6 | use namespace::autoclean; |
7 | |
bddfb71e |
8 | extends 'Catalyst::Model'; |
21336a02 |
9 | |
bddfb71e |
10 | with 'Catalyst::Component::InstancePerContext'; |
11 | |
12 | has repo_dir => ( |
13 | isa => NonEmptySimpleStr, |
14 | is => 'ro', |
15 | required => 1, |
16 | ); |
17 | |
18 | sub build_per_context_instance { |
19 | my ($self, $app) = @_; |
20 | |
21 | Gitalist::Git::Repo->new(repo_dir => $self->repo_dir); |
21336a02 |
22 | } |
23 | |
24 | __PACKAGE__->meta->make_immutable; |
bddfb71e |
25 | |