# File lib/hawlerhelper.rb, line 38
  def self.brute_from_uri(uri)
    uri = valid_uri(uri)
    links = Set.new

    # if we get http://foo/bar/baf/blah, also
    # queue up http://foo/bar/baf, http://foo/bar
    # and http://foo.  Don't bother carrying the query
    # string around either.
    uri.query = nil
    parts = uri.path.split(/\//)
    
    (parts.size - 1).downto(0) do |s|
      links << uri.merge(parts[0..s].join("/") + "/") unless (s == parts.size - 1)
      links << uri.merge(parts[0..s].join("/")) unless (s == 0)
    end

    links.to_a
  end