Class: CMSScanner::ProgressBarNullOutput

Inherits:
ProgressBar::Outputs::Null
  • Object
show all
Defined in:
lib/cms_scanner/progressbar_null_output.rb

Overview

Adds the feature to log message sent to #log So they can be retrieved at some point, like after a password attack with a JSON output which won’t display the progressbar but still call #log for errors etc

Instance Method Summary collapse

Instance Method Details

#log(string = nil) ⇒ Array<String>

Override of parent method

Returns:

  • (Array<String>)

    return the logs when no string provided



17
18
19
20
21
# File 'lib/cms_scanner/progressbar_null_output.rb', line 17

def log(string = nil)
  return logs if string.nil?

  logs << string unless logs.include?(string)
end

#logsObject



11
12
13
# File 'lib/cms_scanner/progressbar_null_output.rb', line 11

def logs
  @logs ||= []
end