line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::BIMI::Role::Data; |
2
|
|
|
|
|
|
|
# ABSTRACT: Class to retrieve data files |
3
|
|
|
|
|
|
|
our $VERSION = '3.20210301'; # VERSION |
4
|
30
|
|
|
30
|
|
25649
|
use 5.20.0; |
|
30
|
|
|
|
|
204
|
|
5
|
30
|
|
|
30
|
|
271
|
use Moose::Role; |
|
30
|
|
|
|
|
169
|
|
|
30
|
|
|
|
|
751
|
|
6
|
30
|
|
|
30
|
|
217537
|
use Mail::BIMI::Prelude; |
|
30
|
|
|
|
|
121
|
|
|
30
|
|
|
|
|
754
|
|
7
|
30
|
|
|
30
|
|
14073
|
use File::Slurp qw{ read_file write_file }; |
|
30
|
|
|
|
|
117
|
|
|
30
|
|
|
|
|
9111
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
13
|
|
|
13
|
1
|
28
|
sub get_file_name($self,$file) { |
|
13
|
|
|
|
|
29
|
|
|
13
|
|
|
|
|
29
|
|
|
13
|
|
|
|
|
26
|
|
12
|
13
|
|
|
|
|
30
|
my $base_file = __FILE__; |
13
|
13
|
|
|
|
|
118
|
$base_file =~ s/\/Role\/Data.pm$/\/Data\/$file/; |
14
|
13
|
100
|
|
|
|
639
|
if ( ! -e $base_file ) { |
15
|
1
|
|
|
|
|
16
|
die "File $file is missing"; |
16
|
|
|
|
|
|
|
} |
17
|
12
|
|
|
|
|
63
|
return $base_file; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
13
|
|
|
13
|
1
|
5043
|
sub get_data_from_file($self,$file) { |
|
13
|
|
|
|
|
32
|
|
|
13
|
|
|
|
|
40
|
|
|
13
|
|
|
|
|
23
|
|
22
|
13
|
|
|
|
|
64
|
my $base_file = $self->get_file_name($file); |
23
|
12
|
|
|
|
|
150
|
my $body = read_file($base_file); |
24
|
12
|
|
|
|
|
5353
|
return $body; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=encoding UTF-8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Mail::BIMI::Role::Data - Class to retrieve data files |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 VERSION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
version 3.20210301 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Role for classes which require access to locally packaged files |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 I<get_file_name($file)> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns the full path and filename for included file $file |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 I<get_data_from_file($file)> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns the contents of included file $file |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 REQUIRES |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * L<File::Slurp|File::Slurp> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * L<Mail::BIMI::Prelude|Mail::BIMI::Prelude> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item * L<Moose::Role|Moose::Role> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Marc Bradshaw <marc@marcbradshaw.net> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Marc Bradshaw. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
78
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |