summaryrefslogtreecommitdiffstats
path: root/t/lib/FileAttributes.pm
blob: 04e6f2e8ec6f3740a21e51257b674b7ab493d73b (plain) (blame)
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
package FileAttributes;
use MooseX::Exporter::Easy;
use MooseX::Types::Path::Class qw(File Dir);

with_meta has_file => sub {
    my ($meta, $name, %options) = @_;
    $meta->add_attribute(
        $name,
        is     => 'ro',
        isa    => File,
        coerce => 1,
        %options,
    );
};

with_meta has_dir => sub {
    my ($meta, $name, %options) = @_;
    $meta->add_attribute(
        $name,
        is     => 'ro',
        isa    => Dir,
        coerce => 1,
        %options,
    );
};

export;

1;