module Ethon::Curl

def self.windows?

:nodoc:
def self.windows?
  !(RbConfig::CONFIG['host_os'] !~ /mingw|mswin|bccwin/)
end

def init

Raises:
  • (Ethon::Errors::GlobalInit) - If Curl.global_init fails.
def init
  @@init_mutex.synchronize {
    if not @@initialized
      raise Errors::GlobalInit.new if Curl.global_init(GLOBAL_ALL) != 0
      @@initialized = true
      Ethon.logger.debug("ETHON: Libcurl initialized") if Ethon.logger
    end
  }
end