Sha256: edb52c546ed790d4ea30eabb110779c724c5fa118d6cc6623aca75db9634b5c0

Contents?: true

Size: 435 Bytes

Versions: 17

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true
##
# Wrapper to make a file URI work like an http URI

class Mechanize::FileConnection

  @instance = nil

  def self.new *a
    @instance ||= super
  end

  def request uri, request
    file_path = uri.select(:host, :path)
                  .select { |part| part && (part.length > 0) }
                  .join(":")
    yield Mechanize::FileResponse.new(Mechanize::Util.uri_unescape(file_path))
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mechanize-2.14.0 lib/mechanize/file_connection.rb
mechanize-2.13.0 lib/mechanize/file_connection.rb
mechanize-2.12.2 lib/mechanize/file_connection.rb
mechanize-2.12.1 lib/mechanize/file_connection.rb
mechanize-2.12.0 lib/mechanize/file_connection.rb
mechanize-2.11.0 lib/mechanize/file_connection.rb
mechanize-2.10.1 lib/mechanize/file_connection.rb
mechanize-2.10.0 lib/mechanize/file_connection.rb
mechanize-2.9.2 lib/mechanize/file_connection.rb
mechanize-2.9.1 lib/mechanize/file_connection.rb
mechanize-2.9.0 lib/mechanize/file_connection.rb
mechanize-2.8.5 lib/mechanize/file_connection.rb
mechanize-2.8.4 lib/mechanize/file_connection.rb
mechanize-2.8.3 lib/mechanize/file_connection.rb
mechanize-2.8.2 lib/mechanize/file_connection.rb
mechanize-2.8.1 lib/mechanize/file_connection.rb
mechanize-2.8.0 lib/mechanize/file_connection.rb