Module: Shells

Defined in:
lib/shells.rb,
lib/shells/errors.rb,
lib/shells/version.rb,
lib/shells/shell_base.rb,
lib/shells/bash_common.rb,
lib/shells/ssh_session.rb,
lib/shells/serial_session.rb,
lib/shells/pf_sense_common.rb,
lib/shells/pf_sense_ssh_session.rb,
lib/shells/pf_sense_serial_session.rb

Overview

A set of basic shell classes.

All shell sessions can be accessed by class name without calling new.

Shells::SshSession(host: ...)
Shells::SerialSession(path: ...)
Shells::PfSenseSshSession(host: ...)
Shells::PfSenseSerialSession(path: ...)

Defined Under Namespace

Modules: BashCommon, PfSenseCommon Classes: CommandTimeout, FailedToSetPrompt, InvalidOption, NonZeroExitCode, PfSenseSerialSession, PfSenseSshSession, SerialSession, SessionCompleted, ShellBase, ShellError, SilenceTimeout, SshSession

Constant Summary collapse

VERSION =

The current version of the gem.

"0.1.5"

Class Method Summary collapse

Class Method Details

.method_missing(m, *args, &block) ⇒ Object

Provides the ability for the Shells module to allow sessions to be instantiated without calling new.



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/shells.rb', line 23

def self.method_missing(m, *args, &block)  #:nodoc:

  is_const = const_defined?(m) rescue nil

  if is_const
    val = const_get(m)
    if val.is_a?(Class) && Shells::ShellBase > val
      return val.new(*args, &block)
    end
  end

  super
end