Class: Roast::Cogs::Cmd::Output

Inherits:
Roast::Cog::Output show all
Includes:
Roast::Cog::Output::WithJson, Roast::Cog::Output::WithNumber, Roast::Cog::Output::WithText
Defined in:
lib/roast/cogs/cmd.rb

Overview

Output from running the cmd cog

Contains the standard output, standard error, and exit status from the executed command. Includes JSON and text parsing capabilities via WithJson and WithText modules.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Roast::Cog::Output::WithText

#lines, #text

Methods included from Roast::Cog::Output::WithNumber

#float, #float!, #integer, #integer!

Constructor Details

#initialize(out, err, status) ⇒ Output

: ( String, String, Process::Status) -> void



259
260
261
262
263
264
# File 'lib/roast/cogs/cmd.rb', line 259

def initialize(out, err, status)
  super()
  @out = out #: String
  @err = err #: String
  @status = status #: Process::Status
end

Instance Attribute Details

#errObject (readonly)

The standard error (STDERR) from the command

: String



251
252
253
# File 'lib/roast/cogs/cmd.rb', line 251

def err
  @err
end

#outObject (readonly)

The standard output (STDOUT) from the command

: String



246
247
248
# File 'lib/roast/cogs/cmd.rb', line 246

def out
  @out
end

#statusObject (readonly)

The exit status of the command process

: Process::Status



256
257
258
# File 'lib/roast/cogs/cmd.rb', line 256

def status
  @status
end