determine unique perls by their sitelibexp config setting
[scpubgit/System-Introspector.git] / lib / System / Introspector / Probe / ResolvConf.pm
1 package System::Introspector::Probe::ResolvConf;
2 use Moo;
3
4 use System::Introspector::Util qw(
5     output_from_file
6     transform_exceptions
7 );
8
9 has resolv_conf_file => (
10     is      => 'ro',
11     default => sub { '/etc/resolv.conf' },
12 );
13
14 sub gather {
15     my ($self) = @_;
16     return {
17         resolv_conf_file => transform_exceptions {
18             my $file = $self->resolv_conf_file;
19             return {
20                 file_name => $file,
21                 body => scalar output_from_file $file,
22             };
23         },
24     };
25 }
26
27 1;
28
29 __END__
30
31 =head1 NAME
32
33 System::Introspector::ResolvConf - Gather name resolution configuration
34
35 =head1 DESCRIPTION
36
37 Reads a C<resolv.conf> file to gather information about name resolution.
38
39 =head1 ATTRIBUTES
40
41 =head2 resolv_conf_file
42
43 The path to the C<resolv.conf> file that should be read. Defaults to
44 C</etc/resolv.conf>.
45
46 =head1 SEE ALSO
47
48 =over
49
50 =item L<System::Introspector>
51
52 =back
53
54 =cut
55