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.20210225'; # VERSION |
4
|
30
|
|
|
30
|
|
27651
|
use 5.20.0; |
|
30
|
|
|
|
|
218
|
|
5
|
30
|
|
|
30
|
|
293
|
use Moose::Role; |
|
30
|
|
|
|
|
147
|
|
|
30
|
|
|
|
|
785
|
|
6
|
30
|
|
|
30
|
|
235459
|
use Mail::BIMI::Prelude; |
|
30
|
|
|
|
|
128
|
|
|
30
|
|
|
|
|
843
|
|
7
|
30
|
|
|
30
|
|
15043
|
use File::Slurp qw{ read_file write_file }; |
|
30
|
|
|
|
|
136
|
|
|
30
|
|
|
|
|
9362
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
13
|
|
|
13
|
1
|
31
|
sub get_file_name($self,$file) { |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
26
|
|
12
|
13
|
|
|
|
|
38
|
my $base_file = __FILE__; |
13
|
13
|
|
|
|
|
141
|
$base_file =~ s/\/Role\/Data.pm$/\/Data\/$file/; |
14
|
13
|
100
|
|
|
|
702
|
if ( ! -e $base_file ) { |
15
|
1
|
|
|
|
|
15
|
die "File $file is missing"; |
16
|
|
|
|
|
|
|
} |
17
|
12
|
|
|
|
|
65
|
return $base_file; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
13
|
|
|
13
|
1
|
4990
|
sub get_data_from_file($self,$file) { |
|
13
|
|
|
|
|
34
|
|
|
13
|
|
|
|
|
31
|
|
|
13
|
|
|
|
|
26
|
|
22
|
13
|
|
|
|
|
90
|
my $base_file = $self->get_file_name($file); |
23
|
12
|
|
|
|
|
172
|
my $body = read_file($base_file); |
24
|
12
|
|
|
|
|
6223
|
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.20210225 |
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 |