/
Config.pm
118 lines (82 loc) · 2.5 KB
/
Config.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package Pinto::Config;
# ABSTRACT: Internal configuration for a Pinto repository
use Moose;
use MooseX::Configuration;
use MooseX::Types::Moose qw(Str Bool Int);
use Pinto::Types 0.017 qw(URI Dir);
use namespace::autoclean;
#------------------------------------------------------------------------------
# VERSION
#------------------------------------------------------------------------------
# Moose attributes
has repos => (
is => 'ro',
isa => Dir,
required => 1,
coerce => 1,
);
has source => (
is => 'ro',
isa => URI,
key => 'source',
default => 'http://cpan.perl.org',
coerce => 1,
documentation => 'URL of a CPAN mirror (or Pinto repository) where foreign dists will be pulled from',
);
has nocleanup => (
is => 'ro',
isa => Bool,
key => 'nocleanup',
default => 0,
documentation => 'If true, then Pinto will not delete older distributions when newer versions are added',
);
has noclobber => (
is => 'ro',
isa => Bool,
key => 'noclobber',
default => 0,
documentation => 'If true, then Pinto will not clobber existing packages when adding new ones',
);
has noinit => (
is => 'ro',
isa => Bool,
key => 'noinit',
default => 0,
documentation => 'If true, then Pinto will not pull/update from VCS before each operation',
);
has store => (
is => 'ro',
isa => Str,
key => 'store',
default => 'Pinto::Store',
documentation => 'Name of the class that will handle storage of your repository',
);
has svn_trunk => (
is => 'ro',
isa => Str,
key => 'trunk',
section => 'Pinto::Store::VCS::Svn',
);
has svn_tag => (
is => 'ro',
isa => Str,
key => 'tag',
section => 'Pinto::Store::VCS::Svn',
);
#------------------------------------------------------------------------------
# Builders
sub _build_config_file {
my ($self) = @_;
my $repos = $self->repos();
my $config_file = Path::Class::file($repos, qw(config pinto.ini) );
return -e $config_file ? $config_file : ();
}
#------------------------------------------------------------------------------
__PACKAGE__->meta->make_immutable();
#------------------------------------------------------------------------------
1;
__END__
=head1 DESCRIPTION
This is a private module for internal use only. There is nothing for
you to see here (yet).
=cut