elastic_record 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/elastic_record.gemspec +1 -1
- data/lib/elastic_record/connection.rb +16 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d2ef3fed887aeb688bfb24abb83eec1145edf1
|
4
|
+
data.tar.gz: c7463026231a8da26cc18bb64f3ab0bebb46cfd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d8772ca376b519a7c561330be588339280284ef38364c4866c06e9e16a58255cfd7c2aaff60f8354b8c6273665e5912abed18555e74c3e9d3594c4eeec1ac4
|
7
|
+
data.tar.gz: be481f2c74f15b62a62c0dac84fd3dac654f9719340338e2b99a69f44dcb85601dd7a99a08c6c182cb6bea62d9776174c592f66fb98ec3d3e079fa29c20b67e4
|
data/elastic_record.gemspec
CHANGED
@@ -46,18 +46,9 @@ module ElasticRecord
|
|
46
46
|
json
|
47
47
|
end
|
48
48
|
|
49
|
-
METHODS = {
|
50
|
-
head: Net::HTTP::Head,
|
51
|
-
get: Net::HTTP::Get,
|
52
|
-
post: Net::HTTP::Post,
|
53
|
-
put: Net::HTTP::Put,
|
54
|
-
delete: Net::HTTP::Delete
|
55
|
-
}
|
56
|
-
|
57
49
|
def http_request(method, path, body = nil)
|
58
50
|
with_retry do
|
59
|
-
request =
|
60
|
-
request.body = body
|
51
|
+
request = new_request(method, path, body)
|
61
52
|
http = new_http
|
62
53
|
|
63
54
|
ActiveSupport::Notifications.instrument("request.elastic_record") do |payload|
|
@@ -68,7 +59,22 @@ module ElasticRecord
|
|
68
59
|
end
|
69
60
|
end
|
70
61
|
|
62
|
+
METHODS = {
|
63
|
+
head: Net::HTTP::Head,
|
64
|
+
get: Net::HTTP::Get,
|
65
|
+
post: Net::HTTP::Post,
|
66
|
+
put: Net::HTTP::Put,
|
67
|
+
delete: Net::HTTP::Delete
|
68
|
+
}
|
69
|
+
def new_request(method, path, body)
|
70
|
+
request = METHODS[method].new(path)
|
71
|
+
request.basic_auth(options[:username], options[:password]) if options[:username].present?
|
72
|
+
request.body = body
|
73
|
+
request
|
74
|
+
end
|
75
|
+
|
71
76
|
private
|
77
|
+
|
72
78
|
def next_server
|
73
79
|
if @shuffled_servers.nil?
|
74
80
|
@shuffled_servers = servers.shuffle
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infogroup
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: arelastic
|