Class: CC::Analyzer::Container::Result
- Inherits:
-
Object
- Object
- CC::Analyzer::Container::Result
- Defined in:
- lib/cc/analyzer/container/result.rb
Instance Attribute Summary collapse
-
#container_name ⇒ Object
readonly
Returns the value of attribute container_name.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#output_byte_count ⇒ Object
readonly
Returns the value of attribute output_byte_count.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Class Method Summary collapse
Instance Method Summary collapse
- #errored? ⇒ Boolean
-
#initialize(container_name: "", duration: 0, exit_status: 0, maximum_output_exceeded: false, output_byte_count: 0, skipped: false, stderr: "", stdout: "", timed_out: false) ⇒ Result
constructor
A new instance of Result.
- #maximum_output_exceeded? ⇒ Boolean
- #merge_from_exception(exception) ⇒ Object
- #skipped? ⇒ Boolean
- #timed_out? ⇒ Boolean
Constructor Details
#initialize(container_name: "", duration: 0, exit_status: 0, maximum_output_exceeded: false, output_byte_count: 0, skipped: false, stderr: "", stdout: "", timed_out: false) ⇒ Result
Returns a new instance of Result.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cc/analyzer/container/result.rb', line 13 def initialize( container_name: "", duration: 0, exit_status: 0, maximum_output_exceeded: false, output_byte_count: 0, skipped: false, stderr: "", stdout: "", timed_out: false ) @container_name = container_name @duration = duration @exit_status = exit_status @maximum_output_exceeded = maximum_output_exceeded @output_byte_count = output_byte_count @skipped = skipped @stderr = stderr @stdout = stdout @timed_out = timed_out end |
Instance Attribute Details
#container_name ⇒ Object (readonly)
Returns the value of attribute container_name.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def container_name @container_name end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def duration @duration end |
#exit_status ⇒ Object
Returns the value of attribute exit_status.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def exit_status @exit_status end |
#output_byte_count ⇒ Object (readonly)
Returns the value of attribute output_byte_count.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def output_byte_count @output_byte_count end |
#stderr ⇒ Object
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
5 6 7 |
# File 'lib/cc/analyzer/container/result.rb', line 5 def stdout @stdout end |
Class Method Details
.skipped(exception) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/cc/analyzer/container/result.rb', line 35 def self.skipped(exception) new( exit_status: 0, skipped: true, stderr: exception., ) end |
Instance Method Details
#errored? ⇒ Boolean
57 58 59 60 61 62 |
# File 'lib/cc/analyzer/container/result.rb', line 57 def errored? timed_out? || maximum_output_exceeded? || exit_status.nil? || exit_status.nonzero? end |
#maximum_output_exceeded? ⇒ Boolean
53 54 55 |
# File 'lib/cc/analyzer/container/result.rb', line 53 def maximum_output_exceeded? @maximum_output_exceeded end |
#merge_from_exception(exception) ⇒ Object
43 44 45 46 47 |
# File 'lib/cc/analyzer/container/result.rb', line 43 def merge_from_exception(exception) self.exit_status = 99 self.stderr = exception. self end |
#skipped? ⇒ Boolean
64 65 66 |
# File 'lib/cc/analyzer/container/result.rb', line 64 def skipped? @skipped end |
#timed_out? ⇒ Boolean
49 50 51 |
# File 'lib/cc/analyzer/container/result.rb', line 49 def timed_out? @timed_out end |