lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.11 vs lib/cms_scanner/finders/finder.rb in cms_scanner-0.0.12

- old
+ new

@@ -11,20 +11,30 @@ def initialize(target) @target = target end + # @return [ String ] The titleize name of the finder + def titleize + self.class.to_s.demodulize.underscore.titleize + end + # @param [ Hash ] _opts def passive(_opts = {}) end # @param [ Hash ] _opts def aggressive(_opts = {}) end def found_by - "#{self.class.to_s.demodulize.underscore.titleize} " \ - "(#{caller_locations(1, 1)[0].label.capitalize} Detection)" + caller_locations.each do |call| + label = call.label + + next unless label == 'aggressive' || label == 'passive' + + return "#{titleize} (#{label.capitalize} Detection)" + end end end end end