Flowdock
method

fetch

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: WSDL::XMLSchema::Importer
fetch(location) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/wsdl/xmlSchema/importer.rb, line 45
  def fetch(location)
    warn("importing: #{location}") if $DEBUG
    content = nil
    if location.scheme == 'file' or
        (location.relative? and FileTest.exist?(location.path))
      content = File.open(location.path).read
    elsif location.scheme and location.scheme.size == 1 and
        FileTest.exist?(location.to_s)
      # ToDo: remove this ugly workaround for a path with drive letter
      # (D://foo/bar)
      content = File.open(location.to_s).read
    else
      client = web_client.new(nil, "WSDL4R")
      client.proxy = ::SOAP::Env::HTTP_PROXY
      client.no_proxy = ::SOAP::Env::NO_PROXY
      if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName)
        ::SOAP::HTTPConfigLoader.set_options(client,
          opt["client.protocol.http"])
      end
      content = client.get_content(location)
    end
    content
  end
Register or log in to add new notes.