File Coverage

blib/lib/Ixchel/functions/install_cpanm.pm
Criterion Covered Total %
statement 20 25 80.0
branch 0 6 0.0
condition 0 21 0.0
subroutine 7 8 87.5
pod 1 1 100.0
total 28 61 45.9


line stmt bran cond sub pod time code
1             package Ixchel::functions::install_cpanm;
2              
3 5     5   129120 use 5.006;
  5         21  
4 5     5   31 use strict;
  5         9  
  5         157  
5 5     5   24 use warnings;
  5         21  
  5         319  
6 5     5   34 use Exporter 'import';
  5         57  
  5         435  
7             our @EXPORT = qw(install_cpanm);
8 5     5   1464 use Rex -feature => [qw/1.4/];
  5         238913  
  5         65  
9 5     5   1073817 use Rex::Commands::Gather;
  5         13  
  5         53  
10 5     5   7825 use Rex::Commands::Pkg;
  5         11  
  5         58  
11              
12             # prevents Rex from printing out rex is exiting after the script ends
13             $::QUIET = 2;
14              
15             =head1 NAME
16              
17             Ixchel::functions::install_cpanm - Installs cpanm
18              
19             =head1 VERSION
20              
21             Version 0.0.1
22              
23             =cut
24              
25             our $VERSION = '0.0.1';
26              
27             =head1 SYNOPSIS
28              
29             use Ixchel::functions::install_cpanm;
30             use Data::Dumper;
31              
32             eval{ install_cpanm };
33             if ($@) {
34             print 'Failed to install cpanm...'.$@."\n";
35             }
36              
37             Supported OS families are...
38              
39             Alt Linux
40             Arch Linux
41             Debian Linux
42             FreeBSD
43             Mageia Linux
44             NetBSD
45             OpenBSD
46             Redhat Linux
47             Suse Linux
48             Void Linux
49              
50             =head1 Functions
51              
52             =head2 install_cpanm
53              
54             Installs cpanm for the OS.
55              
56             eval{ install_cpanm };
57             if ($@) {
58             print 'Failed to install cpanm ...'.$@;
59             }
60              
61             =cut
62              
63             sub install_cpanm {
64 0     0 1   my (%opts) = @_;
65              
66 0 0 0       if ( is_freebsd || is_netbsd || is_freebsd ) {
    0 0        
    0 0        
      0        
      0        
      0        
      0        
67 0           pkg( "p5-App-cpanminus", ensure => "present" );
68             } elsif ( is_debian || is_arch || is_mageia || is_void ) {
69 0           pkg( "cpanminus", ensure => "present" );
70             } elsif (is_redhat || is_suse || is_alt ) {
71 0           pkg( "perl-App-cpanminus", ensure => "present" );
72             }
73              
74             } ## end sub perl_module_via_pkg
75              
76             1;