gather current branch and last commit
[scpubgit/System-Introspector.git] / lib / System / Introspector / Probe / ResolvConf.pm
CommitLineData
afd7c030 1package System::Introspector::Probe::ResolvConf;
9cebf8c1 2use Moo;
3
f3d816a0 4use System::Introspector::Util qw(
13642dda 5 output_from_file
f3d816a0 6 transform_exceptions
7);
8
21fd4f46 9has resolv_conf_file => (
10 is => 'ro',
11 default => sub { '/etc/resolv.conf' },
12);
13
9cebf8c1 14sub gather {
15 my ($self) = @_;
13642dda 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 },
f3d816a0 24 };
9cebf8c1 25}
26
9cebf8c1 271;
535e84b6 28
29__END__
30
31=head1 NAME
32
f24afb0e 33System::Introspector::Probe::ResolvConf - Gather name resolution configuration
535e84b6 34
35=head1 DESCRIPTION
36
37Reads a C<resolv.conf> file to gather information about name resolution.
38
39=head1 ATTRIBUTES
40
41=head2 resolv_conf_file
42
43The path to the C<resolv.conf> file that should be read. Defaults to
44C</etc/resolv.conf>.
45
46=head1 SEE ALSO
47
48=over
49
50=item L<System::Introspector>
51
52=back
53
f24afb0e 54=head1 COPYRIGHT
55
56Copyright (c) 2012 the L<System::Introspector>
57L<AUTHOR|System::Introspector/AUTHOR>,
58L<CONTRIBUTORS|System::Introspector/CONTRIBUTORS> and
59L<SPONSORS|System::Introspector/SPONSORS>.
60
61=head1 LICENSE
535e84b6 62
f24afb0e 63This library is free software and may be distributed under the same terms
64as perl itself.
65
66=cut