lib/test_rail/api.rb
# Creates and caches an http object that is used by the get and
# post commands
Creates and caches an http object that is used by the get and
post commands
Creates and caches an http object that is used by the get and post commands
def http
      if !@http
        path = @host.to_s + @api
        uri  = URI.parse(path)
        proxy_env = ENV['HTTP_PROXY']
        if proxy_env
          proxy_uri = URI(proxy_env)
          proxy     = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port)
          @http     = proxy.new(uri.host, uri.port)
        else
          @http = Net::HTTP.new(uri.host, uri.port)
        end
        @http.use_ssl     = true
        @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end
      @http
    end
def http if ! @http path = @host . to_s + @api uri = URI . parse ( path ) proxy_env = ENV [ 'HTTP_PROXY' ] if proxy_env proxy_uri = URI ( proxy_env ) proxy = Net :: HTTP :: Proxy ( proxy_uri . host , proxy_uri . port ) @http = proxy . new ( uri . host , uri . port ) else @http = Net :: HTTP . new ( uri . host , uri . port ) end @http . use_ssl = true @http . verify_mode = OpenSSL :: SSL :: VERIFY_NONE end @http end
Creates and caches an http object that is used by the get and
post commands
Creates and caches an http object that is used by the get and post commands