Class: Bryton::Lite::Runner::Capture

Inherits:
Object
  • Object
show all
Defined in:
lib/bryton/lite.rb

Overview

Executes the given command and captures the results.

Instance Method Summary collapse

Constructor Details

#initialize(*cmd) ⇒ Capture

Executes the command with Open3.capture3 and holds on to the results.



204
205
206
# File 'lib/bryton/lite.rb', line 204

def initialize(*cmd)
	@results = Open3.capture3(*cmd)
end

Instance Method Details

#statusProcess::Status

Returns the status of execution.

Returns:

  • (Process::Status)


222
223
224
# File 'lib/bryton/lite.rb', line 222

def status
	return @results[2]
end

#stderrString

Returns the content of STDERR from the execution.

Returns:

  • (String)


216
217
218
# File 'lib/bryton/lite.rb', line 216

def stderr
	return @results[1]
end

#stdoutString

Returns the content of STDOUT from the execution.

Returns:

  • (String)


210
211
212
# File 'lib/bryton/lite.rb', line 210

def stdout
	return @results[0]
end

#success?Boolean

Returns the success or failure of the execution.

Returns:

  • (Boolean)


228
229
230
# File 'lib/bryton/lite.rb', line 228

def success?
	return status.success?
end