Sha256: f76facae49665da4ff4ac863e7db9a082981f86533b45f0973158746265507b0

Contents?: true

Size: 778 Bytes

Versions: 13

Compression:

Stored size: 778 Bytes

Contents

module CMSScanner
  # ProgressBar to be used in formatter w/o user_interaction such as
  # JSON etc, to still be able to have a log of messages to output.
  # The object must implement the methods in ruby-progressbar
  # and used in CMSScanner, See https://github.com/jfelchner/ruby-progressbar
  class MockedProgressBar
    attr_reader :increment, :finish

    def self.create(opts = {})
      new(opts)
    end

    def initialize(_opts = {}); end

    # @return [ Integer ]
    def total
      0
    end

    def total=(_total); end

    # @return [ Array<String> ]
    def logs
      @logs ||= []
    end

    # @param [ String, nil ] message
    #
    # @return [ Mixed ]
    def log(message = nil)
      return logs unless message

      logs << message
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cms_scanner-0.0.39.1 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.39.0 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.38.4 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.38.3 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.38.2 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.38.1 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.38.0 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.12 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.11 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.10 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.9 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.8 lib/cms_scanner/mocked_progress_bar.rb
cms_scanner-0.0.37.7 lib/cms_scanner/mocked_progress_bar.rb