lib/statsmix.rb in statsmix-0.2.3 vs lib/statsmix.rb in statsmix-0.2.4
- old
+ new
@@ -413,12 +413,10 @@
}.join(sep)
@request.content_type = 'application/x-www-form-urlencoded'
end
def self.urlencode(str)
- str.gsub(/[^a-zA-Z0-9_\{\}:, \"\.\-]/n) {|s|
- sprintf('%%%02x', s[0])
- }
+ URI.encode(str, /[^a-zA-Z0-9_\{\}:, \"\.\-]/n)
end
def self.check_meta
if @params[:meta] && !@params[:meta].is_a?(String) && !@params[:meta].is_a?(Hash)
raise "Invalid data . :meta should be a hash or a json-encoded string. You passed an object of type: #{@params[:meta].type}"
\ No newline at end of file