• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ferki / Rex / 15240232617

28 Feb 2025 09:08AM UTC coverage: 50.961% (+10.2%) from 40.73%
15240232617

push

github

ferki
Use placeholders for template hints

10072 of 19764 relevant lines covered (50.96%)

101.57 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 {
26
  my ( $class, $shell_name, $shell_class ) = @_;
×
27
  $SHELL_PROVIDER{"\L$shell_name"} = $shell_class;
×
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✔
43
    Rex::Logger::info(
×
44
      "Can't load wanted shell: '$shell' ('$klass'). Using default shell.",
45
      "warn" );
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
    );
50
    $klass = "Rex::Interface::Shell::Default";
×
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