capture origin/<name> of active branch in case remote is not tracked
[scpubgit/System-Introspector.git] / lib / System / Introspector / Probe / Hosts.pm
CommitLineData
afd7c030 1package System::Introspector::Probe::Hosts;
645a8f49 2use Moo;
3
a042903a 4use System::Introspector::Util qw(
5a9311b3 5 output_from_file
a042903a 6 transform_exceptions
7);
8
8d888cc1 9has hosts_file => (
10 is => 'ro',
11 default => sub { '/etc/hosts' },
12);
13
645a8f49 14sub gather {
15 my ($self) = @_;
5a9311b3 16 my $file = $self->hosts_file;
17 return {
18 hosts_file => transform_exceptions {
19 return {
20 file_name => $file,
21 body => scalar output_from_file $file,
22 };
23 },
a042903a 24 };
645a8f49 25}
26
645a8f49 271;
535e84b6 28
29__END__
30
31=head1 NAME
32
f24afb0e 33System::Introspector::Probe::Hosts - Gather known hosts
535e84b6 34
35=head1 DESCRIPTION
36
37Reads a C<hosts> file to produce a list of known hosts
38
39=head1 ATTRIBUTES
40
41=head2 hosts_file
42
43The path to the C<hosts> file that should be read. Defaults to C</etc/hosts>.
44
45=head1 SEE ALSO
46
47=over
48
49=item L<System::Introspector>
50
51=back
52
f24afb0e 53=head1 COPYRIGHT
54
55Copyright (c) 2012 the L<System::Introspector>
56L<AUTHOR|System::Introspector/AUTHOR>,
57L<CONTRIBUTORS|System::Introspector/CONTRIBUTORS> and
58L<SPONSORS|System::Introspector/SPONSORS>.
59
60=head1 LICENSE
535e84b6 61
f24afb0e 62This library is free software and may be distributed under the same terms
63as perl itself.
64
65=cut