Class: Reviewer::Output::Scrubber

Inherits:
Object
  • Object
show all
Defined in:
lib/reviewer/output/scrubber.rb

Overview

Provides a structure interface for the results of running a command

Constant Summary collapse

RAKE_ABORTED_TEXT =

A lot of tools are run via rake which inclues some unhelpful drive when there’s a non-zero

exit status. This is what it starts with so Reviewer can recognize and remove it.
<<~DRIVEL
  rake aborted!
DRIVEL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ self

Creates a scrubber instance for the provided text content

Parameters:

  • raw (String)

    the text to be scrubbed of unhelpful content



19
20
21
# File 'lib/reviewer/output/scrubber.rb', line 19

def initialize(raw)
  @raw = raw || ''
end

Instance Attribute Details

#rawObject

Returns the value of attribute raw.



13
14
15
# File 'lib/reviewer/output/scrubber.rb', line 13

def raw
  @raw
end

Instance Method Details

#cleanObject



23
24
25
# File 'lib/reviewer/output/scrubber.rb', line 23

def clean
  rake_aborted_text? ? preceding_text : raw
end