Created
September 26, 2012 21:58
-
-
Save tsnow/3790891 to your computer and use it in GitHub Desktop.
why soap4r-ruby1.9, why?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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