neo4j-core 5.1.6 → 5.1.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: 7cf22ec9b38a45fc2f98e1c0f2a1c6590187233c
4
- data.tar.gz: e5728703afe4dd48465091dcbbf1f5529e67fa59
3
+ metadata.gz: 270806b67718b4b05e99c73d1b1d2118fefe6dce
4
+ data.tar.gz: 878b8d073dd7a1fbce2139524a92f195286325f4
5
5
  SHA512:
6
- metadata.gz: 1b0f071af7269ad71c46a095bb1a77ff43bc707ceb36af82c61e40ca23c332b1eee23910fbba74ee2f2050bfd5f1827981b26e9202d708c9dd536c8abf44707c
7
- data.tar.gz: 3dbb4b3c9113a35a719cff75f1236e9be03a397c52f1041a74a2d3ad9672ff0d7426c62c07425fe38511cf9a6788fcb7474b813fc6983e28748fd61539d92ae5
6
+ metadata.gz: d4f9e836e2a5352c48621ef7bc0bfe40f6ec6cab15fcc7b32a003e719a11211d78e35c247ea2e51fc1c50926babe3215285a054541e511483ab9d72bfdae2707
7
+ data.tar.gz: fea94937e02b32ffdd8bf6a5bbf8bee6f9e7ac6b56b1cab031ec9c5c918a03bcca21df1b2e87e5edb4b5f7c837fbca30e99b088d6981dd82352f9fc2717411fd
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '5.1.6'
3
+ VERSION = '5.1.7'
4
4
  end
5
5
  end
@@ -38,9 +38,7 @@ module Neo4j
38
38
  end
39
39
 
40
40
  def each
41
- @response.each_data_row do |row|
42
- yield struct_rows(row)
43
- end
41
+ @response.each_data_row { |row| yield struct_rows(row) }
44
42
  end
45
43
 
46
44
  def struct_rows(row)
@@ -165,7 +163,7 @@ module Neo4j
165
163
  data[:id] = if data[:metadata] && data[:metadata][:id]
166
164
  data[:metadata][:id]
167
165
  else
168
- self.class.id_from_url(data[:self])
166
+ data[:self].split('/')[-1].to_i
169
167
  end
170
168
  data
171
169
  end
@@ -194,11 +192,7 @@ module Neo4j
194
192
  end
195
193
 
196
194
  def each_data_row
197
- if @uncommited
198
- data.each { |r| yield r[:row] }
199
- else
200
- data.each { |r| yield r }
201
- end
195
+ data.each { |r| yield (@uncommited ? r[:row] : r) }
202
196
  end
203
197
 
204
198
  def set_data(response)
@@ -235,10 +229,8 @@ module Neo4j
235
229
 
236
230
  def self.create_with_no_tx(response)
237
231
  case response.status
238
- when 200
239
- new(response).set_data(response.body)
240
- when 400
241
- new(response).set_error(response.body)
232
+ when 200 then new(response).set_data(response.body)
233
+ when 400 then new(response).set_error(response.body)
242
234
  else
243
235
  fail "Unknown response code #{response.status} for #{response.env[:url]}"
244
236
  end
@@ -267,17 +259,9 @@ module Neo4j
267
259
  rest_data
268
260
  end
269
261
 
270
- class << self
271
- def id_from_url(url)
272
- url.split('/')[-1].to_i
273
- end
274
- end
275
-
276
262
  private
277
263
 
278
- attr_reader :row_index
279
-
280
- attr_reader :result_index
264
+ attr_reader :row_index, :result_index
281
265
 
282
266
  def mapped_rest_data
283
267
  data = response.body[:results][0][:data][result_index][:rest][row_index]
@@ -286,4 +270,3 @@ module Neo4j
286
270
  end
287
271
  end
288
272
  end
289
-
data/neo4j-core.gemspec CHANGED
@@ -33,7 +33,7 @@ Neo4j-core provides classes and methods to work with the graph database Neo4j.
33
33
  s.add_dependency('activesupport') # For ActiveSupport::Notifications
34
34
  s.add_dependency('multi_json')
35
35
  s.add_dependency('faraday_middleware-multi_json')
36
- s.add_dependency('neo4j-rake_tasks', '~> 0.2.0')
36
+ s.add_dependency('neo4j-rake_tasks', '~> 0.3.0')
37
37
 
38
38
  s.add_development_dependency('pry')
39
39
  s.add_development_dependency('yard')
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: 5.1.6
4
+ version: 5.1.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: 2015-09-29 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.2.0
145
+ version: 0.3.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.2.0
152
+ version: 0.3.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pry
155
155
  requirement: !ruby/object:Gem::Requirement