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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df59e523326d0f32d5c85d5148cc1c2029013789
4
- data.tar.gz: 45e9e52b039ccc859dbb0ca5dc5c0f72e0205eff
3
+ metadata.gz: 2a65542a2290f562de9a0328eb11b8454c4be9ed
4
+ data.tar.gz: de9c7c86c59696baa6fe4e76c9dd867e49d6dbbd
5
5
  SHA512:
6
- metadata.gz: a1263e57c3f4c8a0adf910a9f937b3bf6adecd98e2855ca9dcc46a0086e69779b96706bf306ee666c87ae4c04e5070e94eeb4b732ef21e1149f3d1a0c8ee27bc
7
- data.tar.gz: a615b1178d22709928932acb07a9bb2b330de3ecd2f9ce1189b0dac152cddf5ed23831c2f6e5eed7a5b2fe09b7491d7ff377067da9f19dd7e264c255ee31ad9f
6
+ metadata.gz: a4b7c2a873274d91e72c2a15533652524cb7ba765dc3a189f2d8031161fa8fdad4a0b47d39efb3c3cf7010691a2b25a69e233b81de8fb0daf95d6e83a6ef23b4
7
+ data.tar.gz: b50573ced241fa10e647fa893d64c252cf274e697f100eba87f7c465aba138a76ae5eb4006d0d83a4e60d58efc4397dfbcd7facf0d47c4c8876039ef7cd957a5
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '7.0.7'
3
+ VERSION = '7.0.8'
4
4
  end
5
5
  end
@@ -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(:faraday_options, {}))
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, faraday_options = {})
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(faraday_options) }
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) do |req|
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(options = {})
146
+ def faraday_connection(configurator)
147
147
  require 'faraday'
148
148
  require 'faraday_middleware/multi_json'
149
149
 
150
- Faraday.new(url, options) do |c|
151
- c.request :basic_auth, username_config(options), password_config(options)
152
- c.request :multi_json
150
+ Faraday.new(url) do |faraday|
151
+ faraday.request :multi_json
153
152
 
154
- c.response :multi_json, symbolize_keys: true, content_type: 'application/json'
155
- c.use Faraday::Adapter::NetHttpPersistent
153
+ faraday.response :multi_json, symbolize_keys: true, content_type: 'application/json'
156
154
 
157
- # c.response :logger, ::Logger.new(STDOUT), bodies: true
155
+ faraday.headers['Content-Type'] = 'application/json'
156
+ faraday.headers['User-Agent'] = @user_agent_string
158
157
 
159
- c.headers['Content-Type'] = 'application/json'
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.7
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-15 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday