Sha256: 693ffe4e6c07797d432f1d6f3f9835ce1606356e389c7ac880cdf6f35330feb6

Contents?: true

Size: 830 Bytes

Versions: 13

Compression:

Stored size: 830 Bytes

Contents

module CMSScanner
  # Interesting Finding
  class InterestingFinding
    include Finders::Finding

    attr_reader :url
    attr_writer :to_s

    # @param [ String ] url
    # @param [ Hash ] opts
    #   :to_s (override the to_s method)
    #   See Finders::Finding for other available options
    def initialize(url, opts = {})
      @url  = url
      @to_s = opts[:to_s]

      parse_finding_options(opts)
    end

    # @return [ Array<String> ]
    def entries
      res = NS::Browser.get(url)

      return [] unless res && res.headers['Content-Type'] =~ %r{\Atext/plain;}i

      res.body.split("\n").reject { |s| s.strip.empty? }
    end

    # @return [ String ]
    def to_s
      @to_s || url
    end

    # @return [ Bollean ]
    def ==(other)
      self.class == other.class && to_s == other.to_s
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cms_scanner-0.0.37.12 app/models/interesting_finding.rb
cms_scanner-0.0.37.11 app/models/interesting_finding.rb
cms_scanner-0.0.37.10 app/models/interesting_finding.rb
cms_scanner-0.0.37.9 app/models/interesting_finding.rb
cms_scanner-0.0.37.8 app/models/interesting_finding.rb
cms_scanner-0.0.37.7 app/models/interesting_finding.rb
cms_scanner-0.0.37.6 app/models/interesting_finding.rb
cms_scanner-0.0.37.5 app/models/interesting_finding.rb
cms_scanner-0.0.37.4 app/models/interesting_finding.rb
cms_scanner-0.0.37.3 app/models/interesting_finding.rb
cms_scanner-0.0.37.2 app/models/interesting_finding.rb
cms_scanner-0.0.37.1 app/models/interesting_finding.rb
cms_scanner-0.0.37 app/models/interesting_finding.rb