neo4j-core 7.2.0 → 7.2.1

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: e7a349a32447c684e13fa3712b4b6c886229e956
4
- data.tar.gz: a0a5c7964efbee681b46b5c4f7d44f6b93f78e42
3
+ metadata.gz: be2d54e5bc9a7200e01917194f23aca52e0a3efb
4
+ data.tar.gz: 82de21d7bac5f16158e7a99c233892e6877dc7b0
5
5
  SHA512:
6
- metadata.gz: ba6151f2678bb163439b21846d0377fd1126397f9f7e01f6052cced6e7a900d55d25e46fbe834e93b9502d27f723ed650a5b6fdf73390febf2628bd3ed523ca3
7
- data.tar.gz: c3b4a9c49985e8793c356a170c94b6d18ac6902533ee54f40587d2c04b0176654e6f8370efb66c9f6bb079c206ab840041bfd26cb3c20fc9b4b80f8f6938c823
6
+ metadata.gz: ec1fe857c5e0f1eedf4d3c29f937132307be4873c872314943f677b6b229a246e22d6f9f8e687088cc89d385f9c3b247f455e824f58457667ad7ad87639ecd37
7
+ data.tar.gz: 9fc8fa402f323111510a77ed34cbe79f0eb6a5ad3b0d7851b2713c4d1a77a70f2a159eead8e00ff4c9acc1572da2277f4e222e3273a6f50f4373d3fd2a64e4f1
data/Gemfile CHANGED
@@ -18,10 +18,10 @@ group 'development' do
18
18
  end
19
19
 
20
20
  group 'test' do
21
+ gem 'activesupport', '~> 4.0'
21
22
  gem 'coveralls', require: false
22
- gem 'simplecov-html', require: false
23
+ gem 'dotenv'
23
24
  gem 'rspec', '~> 3.0'
24
25
  gem 'rspec-its'
25
- gem 'dotenv'
26
- gem 'activesupport', '~> 4.0'
26
+ gem 'simplecov-html', require: false
27
27
  end
data/bin/rake CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  #
4
5
  # This file was generated by Bundler.
5
6
  #
@@ -159,7 +159,7 @@ module Neo4j
159
159
  # DETACH DELETE clause
160
160
  # @return [Query]
161
161
 
162
- METHODS = %w(start match optional_match call using where create create_unique merge set on_create_set on_match_set remove unwind delete detach_delete with return order skip limit) # rubocop:disable Metrics/LineLength
162
+ METHODS = %w[start match optional_match call using where create create_unique merge set on_create_set on_match_set remove unwind delete detach_delete with return order skip limit] # rubocop:disable Metrics/LineLength
163
163
  BREAK_METHODS = %(with call)
164
164
 
165
165
  CLAUSIFY_CLAUSE = proc { |method| const_get(method.to_s.split('_').map(&:capitalize).join + 'Clause') }
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '7.2.0'
3
+ VERSION = '7.2.1'
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ module Neo4j
4
4
  include Enumerable
5
5
  extend Neo4j::Core::TxMethods
6
6
 
7
- MARSHAL_INSTANCE_VARIABLES = [:@node, :@match]
7
+ MARSHAL_INSTANCE_VARIABLES = %i[@node @match]
8
8
 
9
9
  def initialize(node, match)
10
10
  @node = node
@@ -4,7 +4,7 @@ module Neo4j
4
4
  include Neo4j::Server::Resource
5
5
  include Neo4j::Core::ActiveEntity
6
6
 
7
- MARSHAL_INSTANCE_VARIABLES = [:@props, :@labels, :@neo_id]
7
+ MARSHAL_INSTANCE_VARIABLES = %i[@props @labels @neo_id]
8
8
 
9
9
  def initialize(session, value)
10
10
  @session = session
@@ -4,7 +4,7 @@ module Neo4j
4
4
  include Neo4j::Server::Resource
5
5
  include Neo4j::Core::ActiveEntity
6
6
 
7
- MARSHAL_INSTANCE_VARIABLES = [:@rel_type, :@props, :@start_node_neo_id, :@end_node_neo_id, :@id]
7
+ MARSHAL_INSTANCE_VARIABLES = %i[@rel_type @props @start_node_neo_id @end_node_neo_id @id]
8
8
 
9
9
  def initialize(session, value)
10
10
  @session = session
@@ -80,7 +80,7 @@ module Neo4j
80
80
  end
81
81
 
82
82
  def hash_value_as_object(value, session)
83
- return value unless [:node, :relationship].include?(identify_entity(value))
83
+ return value unless %i[node relationship].include?(identify_entity(value))
84
84
  add_entity_id(value)
85
85
 
86
86
  basic_obj = (node?(value) ? CypherNode : CypherRelationship).new(session, value)
@@ -95,7 +95,7 @@ module Neo4j
95
95
  elsif self_string.include?('relationship')
96
96
  :relationship
97
97
  end
98
- elsif [:nodes, :relationships, :start, :end, :length].all? { |k| data.key?(k) }
98
+ elsif %i[nodes relationships start end length].all? { |k| data.key?(k) }
99
99
  :path
100
100
  end
101
101
  end
@@ -159,7 +159,7 @@ module Neo4j
159
159
  raise_cypher_error if error?
160
160
  end
161
161
 
162
- RETRYABLE_ERROR_STATUSES = %w(DeadlockDetectedException AcquireLockTimeoutException ExternalResourceFailureException UnknownFailureException)
162
+ RETRYABLE_ERROR_STATUSES = %w[DeadlockDetectedException AcquireLockTimeoutException ExternalResourceFailureException UnknownFailureException]
163
163
  def retryable_error?
164
164
  return unless error?
165
165
  RETRYABLE_ERROR_STATUSES.include?(@error_status)
@@ -23,7 +23,7 @@ module Neo4j
23
23
  end.to_s
24
24
  end
25
25
 
26
- ROW_REST = %w(row REST)
26
+ ROW_REST = %w[row REST]
27
27
  def _query(cypher_query, params = nil)
28
28
  fail 'Transaction expired, unable to perform query' if expired?
29
29
  statement = {statement: cypher_query, parameters: params, resultDataContents: ROW_REST}
@@ -15,15 +15,15 @@ module Neo4j
15
15
  Neo4j::Core::CypherSession::Transactions::Base
16
16
  end
17
17
 
18
- %w(
18
+ %w[
19
19
  version
20
- ).each do |method, &_block|
20
+ ].each do |method, &_block|
21
21
  define_method(method) do |*args, &block|
22
22
  @adaptor.send(method, *args, &block)
23
23
  end
24
24
  end
25
25
 
26
- %w(
26
+ %w[
27
27
  query
28
28
  queries
29
29
 
@@ -31,7 +31,7 @@ module Neo4j
31
31
 
32
32
  indexes
33
33
  constraints
34
- ).each do |method, &_block|
34
+ ].each do |method, &_block|
35
35
  define_method(method) do |*args, &block|
36
36
  @adaptor.send(method, self, *args, &block)
37
37
  end
@@ -118,11 +118,11 @@ ERROR
118
118
  end
119
119
  end
120
120
 
121
- [:query_set,
122
- :version,
123
- :indexes,
124
- :constraints,
125
- :connected?].each do |method|
121
+ %i[query_set
122
+ version
123
+ indexes
124
+ constraints
125
+ connected?].each do |method|
126
126
  define_method(method) do |*_args|
127
127
  fail "##{method} method not implemented on adaptor!"
128
128
  end
@@ -172,7 +172,7 @@ ERROR
172
172
  EMPTY = ''
173
173
  NEWLINE_W_SPACES = "\n "
174
174
 
175
- instrument(:query, 'neo4j.core.cypher_query', %w(query)) do |_, _start, _finish, _id, payload|
175
+ instrument(:query, 'neo4j.core.cypher_query', %w[query]) do |_, _start, _finish, _id, payload|
176
176
  query = payload[:query]
177
177
  params_string = (query.parameters && !query.parameters.empty? ? "| #{query.parameters.inspect}" : EMPTY)
178
178
  cypher = query.pretty_cypher ? NEWLINE_W_SPACES + query.pretty_cypher.gsub(/\n/, NEWLINE_W_SPACES) : query.cypher
@@ -84,7 +84,7 @@ module Neo4j
84
84
  Neo4j::Core::CypherSession::Transactions::Bolt
85
85
  end
86
86
 
87
- instrument(:request, 'neo4j.core.bolt.request', %w(url body)) do |_, start, finish, _id, payload|
87
+ instrument(:request, 'neo4j.core.bolt.request', %w[url body]) do |_, start, finish, _id, payload|
88
88
  ms = (finish - start) * 1000
89
89
 
90
90
  " #{ANSI::BLUE}BOLT REQUEST:#{ANSI::CLEAR} #{ANSI::YELLOW}#{ms.round}ms#{ANSI::CLEAR} #{payload[:url]}"
@@ -32,7 +32,7 @@ module Neo4j
32
32
  }
33
33
  # For efficiency. Translates directly from bytes to types
34
34
  MARKER_TYPES.keys.each do |key|
35
- ord = eval("0x#{key}") # rubocop:disable Lint/Eval
35
+ ord = eval("0x#{key}") # rubocop:disable Security/Eval
36
36
  MARKER_TYPES[ord] = MARKER_TYPES.delete(key)
37
37
  end
38
38
 
@@ -47,7 +47,7 @@ module Neo4j
47
47
  headers[type][size] = [byte].pack('C')
48
48
  end
49
49
 
50
- HEADER_PACK_STRINGS = %w(C S L).freeze
50
+ HEADER_PACK_STRINGS = %w[C S L].freeze
51
51
 
52
52
  Structure = Struct.new(:signature, :list)
53
53
 
@@ -213,12 +213,12 @@ module Neo4j
213
213
  }
214
214
 
215
215
  def shift_value_for_type!(type, size, marker)
216
- if [:text, :list, :map, :struct].include?(type)
216
+ if %i[text list map struct].include?(type)
217
217
  offset = marker - HEADER_BASE_BYTES[type]
218
218
  size = shift_stream!(2 << (offset - 1)).reverse.unpack(HEADER_PACK_STRINGS[offset])[0]
219
219
  end
220
220
 
221
- if [:tiny_text, :text, :bytes].include?(type)
221
+ if %i[tiny_text text bytes].include?(type)
222
222
  shift_stream!(size).force_encoding('UTF-8')
223
223
  else
224
224
  send(METHOD_MAP[type], size)
@@ -50,7 +50,7 @@ module Neo4j
50
50
  end
51
51
 
52
52
  included do
53
- %w(scheme user password host port).each do |method|
53
+ %w[scheme user password host port].each do |method|
54
54
  define_method(method) do
55
55
  (@uri && @uri.send(method)) || (self.class.default_uri && self.class.default_uri.send(method))
56
56
  end
@@ -25,7 +25,7 @@ module Neo4j
25
25
  @requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request), @options.fetch(:faraday_configurator, DEFAULT_FARADAY_CONFIGURATOR))
26
26
  end
27
27
 
28
- ROW_REST = %w(row REST)
28
+ ROW_REST = %w[row REST]
29
29
 
30
30
  def query_set(transaction, queries, options = {})
31
31
  setup_queries!(queries, transaction)
@@ -91,7 +91,7 @@ module Neo4j
91
91
  @connection.get(url)
92
92
  end
93
93
 
94
- instrument(:request, 'neo4j.core.http.request', %w(method url body)) do |_, start, finish, _id, payload|
94
+ instrument(:request, 'neo4j.core.http.request', %w[method url body]) do |_, start, finish, _id, payload|
95
95
  ms = (finish - start) * 1000
96
96
  " #{ANSI::BLUE}HTTP REQUEST:#{ANSI::CLEAR} #{ANSI::YELLOW}#{ms.round}ms#{ANSI::CLEAR} #{payload[:method].upcase} #{payload[:url]} (#{payload[:body].size} bytes)"
97
97
  end
@@ -126,7 +126,7 @@ module Neo4j
126
126
  def validate_message_type!(message, type)
127
127
  case message.type
128
128
  when type
129
- return
129
+ nil
130
130
  when :failure
131
131
  data = message.args[0]
132
132
  throw :cypher_bolt_failure, data
@@ -50,8 +50,8 @@ module Neo4j
50
50
  self_string = rest_datum[:self]
51
51
  if self_string
52
52
  type = self_string.split('/')[-2]
53
- type.to_sym if %w(node relationship).include?(type)
54
- elsif [:nodes, :relationships, :start, :end, :length].all? { |k| rest_datum.key?(k) }
53
+ type.to_sym if %w[node relationship].include?(type)
54
+ elsif %i[nodes relationships start end length].all? { |k| rest_datum.key?(k) }
55
55
  :path
56
56
  end
57
57
  end
data/lib/neo4j/node.rb CHANGED
@@ -196,7 +196,7 @@ module Neo4j
196
196
  end
197
197
 
198
198
  def validate_match!(match)
199
- invalid_match_keys = match.keys - [:type, :dir, :between]
199
+ invalid_match_keys = match.keys - %i[type dir between]
200
200
  fail "Invalid match keys: #{invalid_match_keys.inspect}" if !invalid_match_keys.empty?
201
201
 
202
202
  fail "Invalid dir: #{match[:dir]}" if ![nil, :incoming, :outgoing, :both].include?(match[:dir])
data/lib/neo4j/session.rb CHANGED
@@ -105,7 +105,7 @@ module Neo4j
105
105
  validate_session_num!(db_type)
106
106
  name = params[:name]
107
107
  default = params[:default]
108
- [:name, :default].each { |k| params.delete(k) }
108
+ %i[name default].each { |k| params.delete(k) }
109
109
  register(create_session(db_type, endpoint_url, params), name, default)
110
110
  end
111
111
 
@@ -28,7 +28,7 @@ module Neo4j
28
28
  end
29
29
 
30
30
  def inspect
31
- status_string = [:id, :failed?, :active?, :commit_url].map do |method|
31
+ status_string = %i[id failed? active? commit_url].map do |method|
32
32
  "#{method}: #{send(method)}" if respond_to?(method)
33
33
  end.compact.join(', ')
34
34
 
data/neo4j-core.gemspec CHANGED
@@ -19,9 +19,9 @@ Neo4j-core provides classes and methods to work with the graph database Neo4j.
19
19
  EOF
20
20
 
21
21
  s.require_path = 'lib'
22
- s.files = Dir.glob('{bin,lib,config}/**/*') + %w(README.md Gemfile neo4j-core.gemspec)
22
+ s.files = Dir.glob('{bin,lib,config}/**/*') + %w[README.md Gemfile neo4j-core.gemspec]
23
23
  s.has_rdoc = true
24
- s.extra_rdoc_files = %w( README.md )
24
+ s.extra_rdoc_files = %w[README.md]
25
25
  s.rdoc_options = ['--quiet', '--title', 'Neo4j::Core', '--line-numbers', '--main', 'README.rdoc', '--inline-source']
26
26
 
27
27
  s.add_dependency('faraday', '>= 0.9.0')
@@ -37,12 +37,12 @@ Neo4j-core provides classes and methods to work with the graph database Neo4j.
37
37
  s.add_development_dependency('pry')
38
38
  s.add_development_dependency('yard')
39
39
  s.add_development_dependency('simplecov')
40
- s.add_development_dependency('rubocop', '~> 0.39.0')
41
40
 
42
41
  if RUBY_PLATFORM == 'java'
43
42
  s.add_dependency('neo4j-community', '>= 2.1.1')
44
43
  s.add_development_dependency 'ruby-debug'
45
44
  else
45
+ s.add_development_dependency('rubocop', '~> 0.49.1')
46
46
  s.add_development_dependency('guard')
47
47
  s.add_development_dependency('guard-rubocop')
48
48
  end
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.2.0
4
+ version: 7.2.1
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-06-05 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.39.0
187
+ version: 0.49.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.39.0
194
+ version: 0.49.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: guard
197
197
  requirement: !ruby/object:Gem::Requirement