aboutsummaryrefslogtreecommitdiff
path: root/lib/App/Acmeman/Source.pm
blob: abae3429e7f2db6df1566552db0d72794adf57b9 (plain)
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
package App::Acmeman::Source;

use strict;
use warnings;
use Carp;

sub set {
    my $self = shift;
    croak "improper use of the set method"
	unless exists $self->{_cfg};
    return $self->{_cfg}->set(@_);
}

sub add {
    my $self = shift;
    croak "improper use of the add method"
	unless exists $self->{_cfg};
    return $self->{_cfg}->add_value(@_);
}

sub get {
    my $self = shift;
    croak "improper use of the get method"
	unless exists $self->{_cfg};
    return $self->{_cfg}->get(@_);
}

sub is_set {
    my $self = shift;
    croak "improper use of the get method"
	unless exists $self->{_cfg};
    return $self->{_cfg}->is_set(@_);
}

sub define_domain {
    my $self = shift;
    my $cn = shift || croak "domain name must be given";
    $self->set('domain', $cn, 'files', 'default');
}

sub define_alias {
    my $self = shift;
    my $cn = shift || croak "domain name must be given";
    foreach my $alias (@_) {
	$self->add(['domain', $cn, 'alt'], $alias);
    }
}

sub configure {
    my ($self, $config) = @_;
    $self->{_cfg} = $config;
    return $self->scan();
}

sub setup { 1 }

1;

Return to:

Send suggestions and report system problems to the System administrator.