Sha256: 0a15876233820d2f961fce1a286867577718abdcc1c75d70d075a06f54c38a8b

Contents?: true

Size: 996 Bytes

Versions: 3

Compression:

Stored size: 996 Bytes

Contents

=begin
                  Arachni
  Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>

  This is free software; you can copy and distribute and modify
  this program under the term of the GPL v2.0 License
  (See LICENSE file for details)

=end

module Anemone::Extractors

#
# Extract URLs from arbitrary text.
#
# You might think that this renders the rest path extractors redundant
# but the others can extract paths from HTML attributes, this one can only extract
# full URLs.
#
# @author: Tasos "Zapotek" Laskos
#                                      <tasos.laskos@gmail.com>
#                                      <zapotek@segfault.gr>
# @version: 0.1
#
class Generic < Paths

    #
    # Returns an array of paths as plain strings
    #
    # @param    [Nokogiri]  Nokogiri document
    #
    # @return   [Array<String>]  paths
    #
    def run( doc )
        begin
            URI.extract( doc.to_s )
        rescue
            return []
        end
    end

end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arachni-0.2.4 path_extractors/generic.rb
arachni-0.2.3 path_extractors/generic.rb
arachni-0.2.2.2 path_extractors/generic.rb