neo4j-core 7.0.7 → 7.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4j-core/version.rb +1 -1
- data/lib/neo4j/core/cypher_session/adaptors/http.rb +15 -17
- 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: 2a65542a2290f562de9a0328eb11b8454c4be9ed
|
4
|
+
data.tar.gz: de9c7c86c59696baa6fe4e76c9dd867e49d6dbbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4b7c2a873274d91e72c2a15533652524cb7ba765dc3a189f2d8031161fa8fdad4a0b47d39efb3c3cf7010691a2b25a69e233b81de8fb0daf95d6e83a6ef23b4
|
7
|
+
data.tar.gz: b50573ced241fa10e647fa893d64c252cf274e697f100eba87f7c465aba138a76ae5eb4006d0d83a4e60d58efc4397dfbcd7facf0d47c4c8876039ef7cd957a5
|
data/lib/neo4j-core/version.rb
CHANGED
@@ -15,8 +15,12 @@ module Neo4j
|
|
15
15
|
@options = options
|
16
16
|
end
|
17
17
|
|
18
|
+
DEFAULT_FARADAY_CONFIGURATOR = proc do |faraday|
|
19
|
+
faraday.use Faraday::Adapter::NetHttpPersistent
|
20
|
+
end
|
21
|
+
|
18
22
|
def connect
|
19
|
-
@requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request), @options.fetch(:
|
23
|
+
@requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request), @options.fetch(:faraday_configurator, DEFAULT_FARADAY_CONFIGURATOR))
|
20
24
|
end
|
21
25
|
|
22
26
|
ROW_REST = %w(row REST)
|
@@ -101,12 +105,12 @@ module Neo4j
|
|
101
105
|
include Adaptors::HasUri
|
102
106
|
default_url('http://neo4:neo4j@localhost:7474')
|
103
107
|
validate_uri { |uri| uri.is_a?(URI::HTTP) }
|
104
|
-
def initialize(url, user_agent_string, instrument_proc,
|
108
|
+
def initialize(url, user_agent_string, instrument_proc, faraday_configurator)
|
105
109
|
self.url = url
|
106
110
|
@user = user
|
107
111
|
@password = password
|
108
112
|
@user_agent_string = user_agent_string
|
109
|
-
@faraday = wrap_connection_failed! { faraday_connection(
|
113
|
+
@faraday = wrap_connection_failed! { faraday_connection(faraday_configurator) }
|
110
114
|
@instrument_proc = instrument_proc
|
111
115
|
end
|
112
116
|
|
@@ -122,11 +126,7 @@ module Neo4j
|
|
122
126
|
url = url_from_path(path)
|
123
127
|
@instrument_proc.call(method, url, request_body) do
|
124
128
|
wrap_connection_failed! do
|
125
|
-
@faraday.run_request(method, url, request_body, REQUEST_HEADERS)
|
126
|
-
# Temporary
|
127
|
-
# req.options.timeout = 5
|
128
|
-
# req.options.open_timeout = 5
|
129
|
-
end
|
129
|
+
@faraday.run_request(method, url, request_body, REQUEST_HEADERS)
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
@@ -143,21 +143,19 @@ module Neo4j
|
|
143
143
|
|
144
144
|
private
|
145
145
|
|
146
|
-
def faraday_connection(
|
146
|
+
def faraday_connection(configurator)
|
147
147
|
require 'faraday'
|
148
148
|
require 'faraday_middleware/multi_json'
|
149
149
|
|
150
|
-
Faraday.new(url
|
151
|
-
|
152
|
-
c.request :multi_json
|
150
|
+
Faraday.new(url) do |faraday|
|
151
|
+
faraday.request :multi_json
|
153
152
|
|
154
|
-
|
155
|
-
c.use Faraday::Adapter::NetHttpPersistent
|
153
|
+
faraday.response :multi_json, symbolize_keys: true, content_type: 'application/json'
|
156
154
|
|
157
|
-
|
155
|
+
faraday.headers['Content-Type'] = 'application/json'
|
156
|
+
faraday.headers['User-Agent'] = @user_agent_string
|
158
157
|
|
159
|
-
|
160
|
-
c.headers['User-Agent'] = @user_agent_string
|
158
|
+
configurator.call(faraday)
|
161
159
|
end
|
162
160
|
end
|
163
161
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Chris Grigg, Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|