algoliasearch 1.2.13 → 1.2.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb867d51f1112797761177032870c0298192b7d3
4
- data.tar.gz: 6f7acc04bb4e2e6674cf404c3641860c2cf32673
3
+ metadata.gz: d0971a0b998bf28d210a9355b2c2d97747559dc7
4
+ data.tar.gz: 540e7439e56e12c9fa98b1b916793c437674cb9b
5
5
  SHA512:
6
- metadata.gz: b02427a9bc1e2a9438d2178dc3abc11a447aeb2395f8cfc28eca58f657c200bcd7bd1356a9bc19b636bae43e908fa936cdc58e9f9dd9a2b88d01f2d540eeee7c
7
- data.tar.gz: e0dde1753432e5ba3235da83a1dbdb7475dfa70dc5e344a1dea97baeee96d330a3de9be0b3facd7e07dc0e1c693ea84a64435afeaa6da6185f8f39bf7babfcf0
6
+ metadata.gz: f19ac7eede0045dad8b9938900b15f101216834db4029263341e9165e47e2f4c06203fc8b3ffc9628f1001d298cc8e4fe7e6fa0fa41fae8d256cbbc30e3db127
7
+ data.tar.gz: 0eab0aaec7f3454671984142999e79f0ff5164b6cf778aa8e159eae812e7fba51ba3c81b08e75f2330231a3aa40e30e6ef9c464d75ac65c720ced30cf8237d04
data/ChangeLog CHANGED
@@ -1,5 +1,12 @@
1
1
  CHANGELOG
2
2
 
3
+ 2014-11-10 1.2.14
4
+ * Force the underlying httpclient dependency to be >= 2.4 in the gemspec as well
5
+ * Ability to force the SSL version
6
+
7
+ 2014-10-22 1.2.13
8
+ * Fix the loop on hosts to retry when the http code is different than 200, 201, 400, 403, 404
9
+
3
10
  2014-10-08 1.2.12
4
11
 
5
12
  * Upgrade to httpclient 2.4
@@ -50,17 +50,17 @@ Gem::Specification.new do |s|
50
50
  s.specification_version = 4
51
51
 
52
52
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
- s.add_runtime_dependency(%q<httpclient>, ["~> 2.3"])
53
+ s.add_runtime_dependency(%q<httpclient>, ["~> 2.4"])
54
54
  s.add_runtime_dependency(%q<json>, [">= 1.5.1"])
55
55
  s.add_development_dependency "travis"
56
56
  s.add_development_dependency "rake"
57
57
  s.add_development_dependency "rdoc"
58
58
  else
59
- s.add_dependency(%q<httpclient>, ["~> 2.3"])
59
+ s.add_dependency(%q<httpclient>, ["~> 2.4"])
60
60
  s.add_dependency(%q<json>, [">= 1.5.1"])
61
61
  end
62
62
  else
63
- s.add_dependency(%q<httpclient>, ["~> 2.3"])
63
+ s.add_dependency(%q<httpclient>, ["~> 2.4"])
64
64
  s.add_dependency(%q<json>, [">= 1.5.1"])
65
65
  end
66
66
  end
@@ -10,11 +10,12 @@ module Algolia
10
10
  # A class which encapsulates the HTTPS communication with the Algolia
11
11
  # API server. Uses the HTTPClient library for low-level HTTP communication.
12
12
  class Client
13
- attr_reader :ssl, :hosts, :application_id, :api_key, :headers, :connect_timeout, :send_timeout, :receive_timeout, :search_timeout
13
+ attr_reader :ssl, :ssl_version, :hosts, :application_id, :api_key, :headers, :connect_timeout, :send_timeout, :receive_timeout, :search_timeout
14
14
 
15
15
 
16
16
  def initialize(data = {})
17
17
  @ssl = data[:ssl].nil? ? true : data[:ssl]
18
+ @ssl_version = data[:ssl_version].nil? ? nil : data[:ssl_version]
18
19
  @application_id = data[:application_id]
19
20
  @api_key = data[:api_key]
20
21
  @hosts = (data[:hosts] || 1.upto(3).map { |i| "#{@application_id}-#{i}.algolia.io" }).shuffle
@@ -76,9 +77,11 @@ module Algolia
76
77
  def thread_local_hosts(forced_timeout)
77
78
  Thread.current[:algolia_hosts] ||= {}
78
79
  Thread.current[:algolia_hosts][forced_timeout.to_s] ||= hosts.map do |host|
80
+ client = HTTPClient.new
81
+ client.ssl_config.ssl_version = @ssl_version if @ssl && @ssl_version
79
82
  hinfo = {
80
83
  :base_url => "http#{@ssl ? 's' : ''}://#{host}",
81
- :session => HTTPClient.new
84
+ :session => client
82
85
  }
83
86
  hinfo[:session].transparent_gzip_decompression = true
84
87
  hinfo[:session].connect_timeout = @connect_timeout if @connect_timeout
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = "1.2.13"
2
+ VERSION = "1.2.14"
3
3
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.13
4
+ version: 1.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.3'
19
+ version: '2.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.3'
26
+ version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: travis
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: A simple Ruby client for the algolia.com REST API
@@ -89,8 +89,8 @@ extra_rdoc_files:
89
89
  - LICENSE.txt
90
90
  - README.md
91
91
  files:
92
- - .rspec
93
- - .travis.yml
92
+ - ".rspec"
93
+ - ".travis.yml"
94
94
  - ChangeLog
95
95
  - Gemfile
96
96
  - Gemfile.lock
@@ -121,12 +121,12 @@ require_paths:
121
121
  - lib
122
122
  required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []