Skip to content

Instantly share code, notes, and snippets.

@tsnow
Created September 26, 2012 21:58
Show Gist options
  • Save tsnow/3790891 to your computer and use it in GitHub Desktop.
Save tsnow/3790891 to your computer and use it in GitHub Desktop.
why soap4r-ruby1.9, why?
def web_client
return @web_client if @web_client
begin
require 'httpclient'
@web_client = HTTPClient
rescue LoadError
begin
require 'http-access2'
if HTTPAccess2::VERSION < "2.0"
raise LoadError.new("http-access/2.0 or later is required.")
end
@web_client = HTTPAccess2::Client
rescue LoadError
warn("Loading http-access2 failed. Net/http is used.") if $DEBUG
require 'soap/netHttpClient'
@web_client = ::SOAP::NetHttpClient
end
end
@web_client
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment