require 'rexml/document' require 'nokogiri' require 'active_support' require 'log4r' # We don't NEED the JSON gem, but if it's available, use it. begin require 'json' rescue LoadError nil end class String def is_json? slice(0,1) == '{' end def is_v2_json? is_json? && match('"apiVersion"\s?:\s?"2.0"') end def is_xml? slice(0,5) == '') end def is_v2_atom? is_xml? && (include?('