Class: Podjumper::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/podjumper/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(info) ⇒ Command

Returns a new instance of Command.



3
4
5
6
7
# File 'lib/podjumper/command.rb', line 3

def initialize(info)
  @namespace = info.namespace
  @pod       = info.pod_name
  @container = info.container_name
end

Instance Method Details

#exec(command) ⇒ Object



9
10
11
12
# File 'lib/podjumper/command.rb', line 9

def exec(command)
  tty = TTY::Command.new
  tty.run(exec_command(command))
end

#logsObject



14
15
16
17
18
19
# File 'lib/podjumper/command.rb', line 14

def logs
  tty = TTY::Command.new(printer: :null)
  tty.run(logs_command) do |out, _|
    puts out if !ping?(out)
  end
end