Class: Helmsnap::Command

Inherits:
Service show all
Defined in:
lib/helmsnap/command.rb

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Methods inherited from Service

call

Constructor Details

#initialize(cmd, stdout: $stdout, stderr: $stderr, allow_failure: false) ⇒ Command

Returns a new instance of Command.



6
7
8
9
10
11
12
13
# File 'lib/helmsnap/command.rb', line 6

def initialize(cmd, stdout: $stdout, stderr: $stderr, allow_failure: false)
  super()
  self.cmd = cmd
  self.output = +""
  self.stdout = stdout || null_file
  self.stderr = stderr || null_file
  self.allow_failure = allow_failure
end

Instance Method Details

#callObject



15
16
17
18
# File 'lib/helmsnap/command.rb', line 15

def call
  Helmsnap::Console.info(stdout, "> #{cmd}")
  run_command
end