neo4j-core 7.0.6 → 7.0.7

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: 012959b6a5ad5db3f1fc8197b65ca216e3b54f26
4
- data.tar.gz: f96ec3337ee5fa9eb103966e497552c1c3f56e89
3
+ metadata.gz: df59e523326d0f32d5c85d5148cc1c2029013789
4
+ data.tar.gz: 45e9e52b039ccc859dbb0ca5dc5c0f72e0205eff
5
5
  SHA512:
6
- metadata.gz: 744b6920e214b0abbd55385a41c5eb28f3e1754793e01180754f9dba9e8f5b2183596c94779d152b97be4f80d60435a6807c3a1b457c7f383dd462c5652a5af9
7
- data.tar.gz: bf9de1588905f3b62064004ce66ddec878faf0c02862391383561b5833ed12c59f5989effa37bce6a7c92a07c5baa86de534cc95b2c077b3ef5e0ac77c88725e
6
+ metadata.gz: a1263e57c3f4c8a0adf910a9f937b3bf6adecd98e2855ca9dcc46a0086e69779b96706bf306ee666c87ae4c04e5070e94eeb4b732ef21e1149f3d1a0c8ee27bc
7
+ data.tar.gz: a615b1178d22709928932acb07a9bb2b330de3ecd2f9ce1189b0dac152cddf5ed23831c2f6e5eed7a5b2fe09b7491d7ff377067da9f19dd7e264c255ee31ad9f
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '7.0.6'
3
+ VERSION = '7.0.7'
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ module Neo4j
20
20
 
21
21
  # Sets the property of this node.
22
22
  # Property keys are always strings. Valid property value types are the primitives:
23
- # (<tt>String</tt>, <tt>Fixnum</tt>, <tt>Float</tt>, <tt>FalseClass</tt>, <tt>TrueClass</tt>)
23
+ # (<tt>String</tt>, <tt>Integer</tt>, <tt>Float</tt>, <tt>FalseClass</tt>, <tt>TrueClass</tt>)
24
24
  # or an array of those primitives.
25
25
  #
26
26
  # ==== Gotchas
@@ -28,7 +28,7 @@ module Neo4j
28
28
  # * You can *not* delete or add one item in the array (e.g. person.phones.delete('123')) but instead you must create a new array instead.
29
29
  #
30
30
  # @param [String, Symbol] k of the property to set
31
- # @param [String,Fixnum,Float,true,false, Array] v to set
31
+ # @param [String,Integer,Float,true,false, Array] v to set
32
32
  def []=(k, v)
33
33
  to_java_property(k, v)
34
34
  end
@@ -95,7 +95,7 @@ module Neo4j
95
95
  :double
96
96
  when FalseClass, TrueClass
97
97
  :boolean
98
- when Fixnum
98
+ when Integer
99
99
  :long
100
100
  else
101
101
  fail "Not allowed to store array with value #{value.inspect} type #{value.class}"
@@ -16,7 +16,7 @@ module Neo4j
16
16
  end
17
17
 
18
18
  def connect
19
- @requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request))
19
+ @requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request), @options.fetch(:faraday_options, {}))
20
20
  end
21
21
 
22
22
  ROW_REST = %w(row REST)
@@ -101,13 +101,12 @@ module Neo4j
101
101
  include Adaptors::HasUri
102
102
  default_url('http://neo4:neo4j@localhost:7474')
103
103
  validate_uri { |uri| uri.is_a?(URI::HTTP) }
104
-
105
- def initialize(url, user_agent_string, instrument_proc)
104
+ def initialize(url, user_agent_string, instrument_proc, faraday_options = {})
106
105
  self.url = url
107
106
  @user = user
108
107
  @password = password
109
108
  @user_agent_string = user_agent_string
110
- @faraday = wrap_connection_failed! { faraday_connection }
109
+ @faraday = wrap_connection_failed! { faraday_connection(faraday_options) }
111
110
  @instrument_proc = instrument_proc
112
111
  end
113
112
 
@@ -144,12 +143,12 @@ module Neo4j
144
143
 
145
144
  private
146
145
 
147
- def faraday_connection
146
+ def faraday_connection(options = {})
148
147
  require 'faraday'
149
148
  require 'faraday_middleware/multi_json'
150
149
 
151
- Faraday.new(url) do |c|
152
- c.request :basic_auth, user, password
150
+ Faraday.new(url, options) do |c|
151
+ c.request :basic_auth, username_config(options), password_config(options)
153
152
  c.request :multi_json
154
153
 
155
154
  c.response :multi_json, symbolize_keys: true, content_type: 'application/json'
@@ -162,6 +161,14 @@ module Neo4j
162
161
  end
163
162
  end
164
163
 
164
+ def password_config(options)
165
+ options.fetch(:basic_auth, {}).fetch(:password, @password)
166
+ end
167
+
168
+ def username_config(options)
169
+ options.fetch(:basic_auth, {}).fetch(:username, @user)
170
+ end
171
+
165
172
  def request_body(body)
166
173
  return body if body.is_a?(String)
167
174
 
@@ -5,12 +5,12 @@ module Neo4j
5
5
  end
6
6
 
7
7
  # the valid values on a property, and arrays of those.
8
- VALID_PROPERTY_VALUE_CLASSES = Set.new([Array, NilClass, String, Float, TrueClass, FalseClass, Fixnum])
8
+ VALID_PROPERTY_VALUE_CLASSES = Set.new([Array, NilClass, String, Float, TrueClass, FalseClass, Integer])
9
9
 
10
10
  # @param [Object] value the value we want to check if it's a valid neo4j property value
11
11
  # @return [True, False] A false means it can't be persisted.
12
12
  def valid_property?(value)
13
- VALID_PROPERTY_VALUE_CLASSES.include?(value.class)
13
+ VALID_PROPERTY_VALUE_CLASSES.any? { |c| value.is_a?(c) }
14
14
  end
15
15
 
16
16
  def validate_property!(value)
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.6
4
+ version: 7.0.7
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-10 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday