Sha256: b9b5e142fc15db8ee7227eab25e783e467aab713e7989a056228ee6e3d252745

Contents?: true

Size: 612 Bytes

Versions: 15

Compression:

Stored size: 612 Bytes

Contents

require 'ruby-progressbar/outputs/null'

module CMSScanner
  # 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
  class ProgressBarNullOutput < ::ProgressBar::Outputs::Null
    # @retutn [ Array<String> ]
    def logs
      @logs ||= []
    end

    # Override of parent method
    # @return [ Array<String> ] return the logs when no string provided
    def log(string = nil)
      return logs if string.nil?

      logs << string
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cms_scanner-0.0.41.10 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.9 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.8 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.7 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.6 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.5 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.4 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.3 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.2 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.1 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.41.0 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.40.3 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.40.2 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.40.1 lib/cms_scanner/progressbar_null_output.rb
cms_scanner-0.0.40 lib/cms_scanner/progressbar_null_output.rb