• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
You are now the owner of this repo.

RexOps / Rex / 12857828056

19 Jan 2025 10:25PM UTC coverage: 50.671% (+0.03%) from 50.646%
12857828056

push

github

ferki
Test command environment on Windows

2 of 2 new or added lines in 1 file covered. (100.0%)

7 existing lines in 1 file now uncovered.

9966 of 19668 relevant lines covered (50.67%)

99.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.82
/lib/Rex/Interface/Shell.pm
1
#
2
# (c) Jan Gehring <jan.gehring@gmail.com>
3
#
4

5
package Rex::Interface::Shell;
6

7
use v5.12.5;
69✔
8
use warnings;
69✔
9

10
our $VERSION = '9999.99.99_99'; # VERSION
11

12
use Rex::Logger;
69✔
13

14
my %SHELL_PROVIDER = (
15
  ash   => "Rex::Interface::Shell::Ash",
16
  bash  => "Rex::Interface::Shell::Bash",
17
  csh   => "Rex::Interface::Shell::Csh",
18
  idrac => "Rex::Interface::Shell::Idrac",
19
  ksh   => "Rex::Interface::Shell::Ksh",
20
  sh    => "Rex::Interface::Shell::Sh",
21
  tcsh  => "Rex::Interface::Shell::Tcsh",
22
  zsh   => "Rex::Interface::Shell::Zsh",
23
);
24

25
sub register_shell_provider {
UNCOV
26
  my ( $class, $shell_name, $shell_class ) = @_;
×
UNCOV
27
  $SHELL_PROVIDER{"\L$shell_name"} = $shell_class;
×
UNCOV
28
  return 1;
×
29
}
30

31
sub get_shell_provider {
32
  return %SHELL_PROVIDER;
14✔
33
}
34

35
sub create {
36
  my ( $class, $shell ) = @_;
14✔
37

38
  $shell =~ s/[\r\n]//gms; # sometimes there are some wired things...
14✔
39

40
  my $klass = "Rex::Interface::Shell::\u$shell";
14✔
41
  eval "use $klass";
14✔
42
  if ($@) {
14✔
UNCOV
43
    Rex::Logger::info(
×
44
      "Can't load wanted shell: '$shell' ('$klass'). Using default shell.",
45
      "warn" );
UNCOV
46
    Rex::Logger::info(
×
47
      "If you want to help the development of Rex please report this issue in our Github issue tracker.",
48
      "warn"
49
    );
UNCOV
50
    $klass = "Rex::Interface::Shell::Default";
×
UNCOV
51
    eval "use $klass";
×
52
  }
53

54
  return $klass->new;
14✔
55
}
56

57
1;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc