lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.18 vs lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.19

- old
+ new

@@ -1,7 +1,8 @@ require 'cms_scanner/finders/finder/smart_url_checker' require 'cms_scanner/finders/finder/enumerator' +require 'cms_scanner/finders/finder/fingerprinter' module CMSScanner module Finders # Finder class Finder @@ -12,11 +13,11 @@ def initialize(target) @target = target end - # @return [ String ] The titleize name of the finder + # @return [ String ] The titleized name of the finder def titleize self.class.to_s.demodulize.underscore.titleize end # @param [ Hash ] _opts @@ -25,16 +26,24 @@ # @param [ Hash ] _opts def aggressive(_opts = {}) end - # @param [ Integer ] total - # @param [ String ] title - # @param [ String ] format See https://github.com/jfelchner/ruby-progressbar/wiki/Formatting + # @param [ Hash ] opts See https://github.com/jfelchner/ruby-progressbar/wiki/Options # - # @return [ ProgressBar ] - def progress_bar(total, title = '', format = '%t %a <%B> (%c / %C) %P%% %e') - ProgressBar.create(total: total, title: title, format: format) + # @return [ ProgressBar::Base ] + def progress_bar(opts = {}) + ProgressBar.create({ format: '%t %a <%B> (%c / %C) %P%% %e' }.merge(opts)) + end + + # @return [ Browser ] + def browser + @browser ||= NS::Browser.instance + end + + # @return [ Typhoeus::Hydra ] + def hydra + @hydra ||= browser.hydra end def found_by caller_locations.each do |call| label = call.label