Class: Cliqr::Command::ShellRunner Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cliqr/command/shell_command.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.

The runner for shell command

Instance Method Summary collapse

Constructor Details

#initialize(base_command, context, prompt) ⇒ ShellRunner

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.

Create the runner instance



83
84
85
86
87
# File 'lib/cliqr/command/shell_command.rb', line 83

def initialize(base_command, context, prompt)
  @base_command = base_command
  @context = context
  @prompt = prompt
end

Instance Method Details

#runInteger

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.

Start shell

Returns:

  • (Integer)

    Exit code



92
93
94
95
96
97
98
99
# File 'lib/cliqr/command/shell_command.rb', line 92

def run
  loop do
    command = prompt
    execute(command) unless command == 'exit'
    break if command == 'exit'
  end
  0
end