Class: Cliqr::Executor::CommandRunnerFactory Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cliqr/executor/command_runner_factory.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Factory class to get instance of CommandRunner based on input options

Class Method Summary collapse

Class Method Details

.get(**options) ⇒ Cliqr::Executor::StandardCommandRunner, Cliqr::Executor::BufferedCommandRunner

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get a instance of command runner based on options

Parameters:

  • options (Hash)

    Used to build a command runner instance

Returns:



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cliqr/executor/command_runner_factory.rb', line 17

def self.get(**options)
  case options[:output]
  when :default
    StandardCommandRunner.new
  when :buffer
    BufferedCommandRunner.new
  else
    fail Cliqr::Error::UnknownCommandRunnerException,
         'cannot find a command runner for the given options'
  end
end