Sha256: 29fcf1e95e1320ef2d102d77c480fedbf107453daee6a361a116909497b732b2

Contents?: true

Size: 617 Bytes

Versions: 5

Compression:

Stored size: 617 Bytes

Contents

module CMSScanner
  # Interesting File
  class InterestingFile
    include NS::Finders::Finding

    attr_reader :url

    def initialize(url, opts = {})
      @url = url
      parse_finding_options(opts)
    end

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

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

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

    def ==(other)
      url == other.url
    end

    def eql?(other)
      url == other.url && confidence == other.confidence && found_by == other.found_by
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cms_scanner-0.0.6 app/models/interesting_file.rb
cms_scanner-0.0.5 app/models/interesting_file.rb
cms_scanner-0.0.4 app/models/interesting_file.rb
cms_scanner-0.0.3 app/models/interesting_file.rb
cms_scanner-0.0.2 app/models/interesting_file.rb