require "rubygems" require "uri" require "digest/sha1" require "base64" require "rack/utils" require "curl" require "json" require 'nokogiri' require 'cloud_query/client' require 'cloud_query/crypto' require 'cloud_query/field' require 'cloud_query/request' require 'cloud_query/schema' module CloudQuery SCHEME = "https".freeze HOST = "api.xoopit.com".freeze PATH = "/v0".freeze API_PATHS = { :account => "account".freeze, :schema => "schema".freeze, :indexes => "i".freeze, :documents => "i".freeze, }.freeze # Standard Content-Types for requests CONTENT_TYPES = { :json => 'application/json;charset=utf-8'.freeze, :form => 'application/x-www-form-urlencoded'.freeze, :xml => 'application/xml;charset=utf-8'.freeze, }.freeze SIGNING_METHOD = "SHA1".freeze COOKIE_JAR = (ENV["COOKIE_JAR"] || ".cookies.lwp").freeze end class Time def to_i_with_milliseconds (to_f * 1000).to_i end end