algoliasearch 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/algoliasearch.gemspec +1 -1
- data/lib/algolia/client.rb +2 -7
- data/lib/algolia/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44798747404ff35fdb5615eb23c0c2de53cba36f
|
|
4
|
+
data.tar.gz: 3748e5a659bf37cf6b5643ac44954e6637247ce3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56b88360c2f076c427c9c30353c92a066f539fbb60df652aaf2180db29a4598b9143ee7f1891ff04ff146c81ddf9bff863ab00eb5676f2f292c7f13136c1c410
|
|
7
|
+
data.tar.gz: cdb63ccc75378a65b9b39660fc1fcd48abebe4efec632af336cbaeab49e77e608fb1110022ef5e2c1c9e4c7707164bc94d6209c49ac1add17e997aff4d986c89
|
data/algoliasearch.gemspec
CHANGED
data/lib/algolia/client.rb
CHANGED
|
@@ -17,7 +17,6 @@ module Algolia
|
|
|
17
17
|
@ssl = data[:ssl].nil? ? true : data[:ssl]
|
|
18
18
|
@application_id = data[:application_id]
|
|
19
19
|
@api_key = data[:api_key]
|
|
20
|
-
@gzip = data[:gzip].nil? ? true : data[:gzip]
|
|
21
20
|
@hosts = (data[:hosts] || 1.upto(3).map { |i| "#{@application_id}-#{i}.algolia.io" }).shuffle
|
|
22
21
|
@debug = data[:debug]
|
|
23
22
|
end
|
|
@@ -46,11 +45,7 @@ module Algolia
|
|
|
46
45
|
if session.response_code >= 400 || session.response_code < 200
|
|
47
46
|
raise AlgoliaProtocolError.new(session.response_code, "Cannot #{method} to #{session.url}: #{session.body_str} (#{session.response_code})")
|
|
48
47
|
end
|
|
49
|
-
|
|
50
|
-
gz = Zlib::GzipReader.new(StringIO.new(session.body_str))
|
|
51
|
-
return JSON.parse(gz.read)
|
|
52
|
-
end
|
|
53
|
-
return JSON.parse(session.body_str)
|
|
48
|
+
return JSON.parse(session.body_str)
|
|
54
49
|
rescue AlgoliaProtocolError => e
|
|
55
50
|
raise if e.code != Protocol::ERROR_TIMEOUT and e.code != Protocol::ERROR_UNAVAILABLE
|
|
56
51
|
exceptions << e
|
|
@@ -91,8 +86,8 @@ module Algolia
|
|
|
91
86
|
s.headers[Protocol::HEADER_APP_ID] = application_id
|
|
92
87
|
s.headers["Content-Type"] = "application/json; charset=utf-8"
|
|
93
88
|
s.headers["User-Agent"] = "Algolia for Ruby #{::Algolia::VERSION}"
|
|
94
|
-
s.headers["Accept-Encoding"] = "gzip,deflate" if @gzip
|
|
95
89
|
s.verbose = true if @debug
|
|
90
|
+
s.encoding = ''
|
|
96
91
|
end
|
|
97
92
|
hinfo
|
|
98
93
|
end
|
data/lib/algolia/version.rb
CHANGED