lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.39.1 vs lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.39.2

- old
+ new

@@ -1,6 +1,5 @@ -require 'cms_scanner/mocked_progress_bar' require 'cms_scanner/finders/finder/smart_url_checker' require 'cms_scanner/finders/finder/enumerator' require 'cms_scanner/finders/finder/fingerprinter' module CMSScanner @@ -28,14 +27,15 @@ def aggressive(_opts = {}); end # @param [ Hash ] opts See https://github.com/jfelchner/ruby-progressbar/wiki/Options # @option opts [ Boolean ] :show_progression # - # @return [ ProgressBar::Base, CMSScanner::MockedProgressBar ] + # @return [ ProgressBar::Base ] def create_progress_bar(opts = {}) - klass = opts[:show_progression] ? ProgressBar : MockedProgressBar + bar_opts = { format: '%t %a <%B> (%c / %C) %P%% %e' } + bar_opts[:output] = ProgressBar::Outputs::Null unless opts[:show_progression] - @progress_bar = klass.create({ format: '%t %a <%B> (%c / %C) %P%% %e' }.merge(opts)) + @progress_bar = ProgressBar.create(bar_opts.merge(opts)) end # @return [ Browser ] def browser @browser ||= NS::Browser.instance