File Coverage

blib/lib/charm.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package charm;
2              
3 1     1   856 use strict;
  1         3  
  1         37  
4 1     1   4 use warnings;
  1         2  
  1         27  
5 1     1   243 no bareword::filehandles;
  0            
  0            
6             no indirect ':fatal';
7              
8             use autobox ();
9             use autobox::Core ();
10             use true ();
11             use feature ();
12             use Path::Tiny ();
13             use Test::More ();
14             use Rex ();
15             use Rex::Commands ();
16             use Rex::Commands::File ();
17             use Rex::Commands::Fs ();
18             use Rex::Commands::MD5 ();
19             use Rex::Commands::Network ();
20             use Rex::Commands::Notify ();
21             use Rex::Commands::Pkg ();
22             use Rex::Commands::Run ();
23             use Rex::Commands::SCM ();
24             use Rex::Commands::Service ();
25             use Rex::Commands::User ();
26             use POSIX ();
27             use Data::Printer ();
28              
29             use Import::Into;
30              
31             sub import {
32             my $target = caller;
33             my $class = shift;
34              
35             my @flags = grep /^-\w+/, @_;
36             my %flags = map +($_, 1), map substr($_, 1), @flags;
37              
38             'strict'->import::into($target);
39             'warnings'->import::into($target);
40             'English'->import::into($target, '-no_match_vars');
41             'autobox'->import::into($target);
42             'autobox::Core'->import::into($target);
43              
44             warnings->unimport('once');
45             warnings->unimport('experimental');
46             warnings->unimport('experimental::signatures');
47             warnings->unimport('reserved');
48              
49             bareword::filehandles->unimport;
50             indirect->unimport(':fatal');
51              
52             feature->import(':5.20');
53             feature->import('signatures');
54              
55             true->import;
56              
57             POSIX->import::into($target, qw(strftime));
58             Rex->import::into($target, '-feature' => [qw(no_path_cleanup disable_taskname_warning)]);
59             Rex::Commands->import::into($target);
60             Rex::Commands::File->import::into($target);
61             Rex::Commands::Fs->import::into($target);
62             Rex::Commands::MD5->import::into($target);
63             Rex::Commands::Network->import::into($target);
64             Rex::Commands::Notify->import::into($target);
65             Rex::Commands::Pkg->import::into($target);
66             Rex::Commands::Run->import::into($target);
67             Rex::Commands::SCM->import::into($target);
68             Rex::Commands::Service->import::into($target);
69             Rex::Commands::User->import::into($target);
70             Path::Tiny->import::into($target, qw(path cwd));
71             Data::Printer->import::into($target);
72              
73             if ($flags{tester}) {
74             Test::More->import::into($target);
75             }
76             }
77              
78             1;