File Coverage

lib/Rex/Commands/Inventory.pm
Criterion Covered Total %
statement 14 17 82.3
branch n/a
condition n/a
subroutine 5 7 71.4
pod 1 2 50.0
total 20 26 76.9


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             =head1 NAME
6              
7             Rex::Commands::Inventory - Get an inventory of your systems
8              
9             =head1 DESCRIPTION
10              
11             With this module you can get an inventory of your system.
12              
13             All these functions will not be reported. These functions don't modify anything.
14              
15             =head1 SYNOPSIS
16              
17             use Data::Dumper;
18             task "inventory", "remoteserver", sub {
19             my $inventory = inventory();
20             print Dumper($inventory);
21             };
22              
23             =head1 EXPORTED FUNCTIONS
24              
25             =cut
26              
27             package Rex::Commands::Inventory;
28              
29 1     1   22 use v5.12.5;
  1         3  
30 1     1   5 use warnings;
  1         2  
  1         40  
31              
32             our $VERSION = '1.14.2.3'; # TRIAL VERSION
33              
34 1     1   11 use Rex::Inventory;
  1         3  
  1         13  
35              
36             require Rex::Exporter;
37              
38 1     1   40 use vars qw(@EXPORT);
  1         2  
  1         43  
39 1     1   5 use base qw(Rex::Exporter);
  1         3  
  1         135  
40              
41             @EXPORT = qw(inventor inventory);
42              
43             =head2 inventory
44              
45             This function returns a hashRef of all gathered hardware. Use the Data::Dumper module to see its structure.
46              
47             task "get_inventory", sub {
48             my $inventory = inventory();
49             print Dumper($inventory);
50             };
51              
52             =cut
53              
54             sub inventory {
55 0     0 1   my $inv = Rex::Inventory->new;
56              
57 0           return $inv->get;
58             }
59              
60             sub inventor {
61 0     0 0   return inventory();
62             }
63              
64             1;