neo4j-core 7.0.0.alpha.3 → 7.0.0.alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: befbd7791bec91114c4caa5ea26b15a5e6e1acd0
|
4
|
+
data.tar.gz: 2a2685bfa367c45fb5c778105789da69d6faa742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a54152396e166a7ae7a327d90b7ab37691d9ddbe538762c983f1edeb78bb9714db755c36cbcee4c747c4d53406455b666c7937144ea9939bbc552e0a4feb0737
|
7
|
+
data.tar.gz: 5a32754520b47dd004511a2e4db91916fafe7250d8c4cd1d0463721a756107e480c12a570747f05071bc94ee2859d369c9dfdc682f177972729885e2cdd7c230
|
@@ -17,6 +17,8 @@ module Neo4j
|
|
17
17
|
|
18
18
|
def connect
|
19
19
|
@requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request))
|
20
|
+
rescue Faraday::ConnectionFailed => e
|
21
|
+
raise CypherSession::ConnectionFailedError, "#{e.class}: #{e.message}"
|
20
22
|
end
|
21
23
|
|
22
24
|
ROW_REST = %w(row REST)
|
data/lib/neo4j-core/query.rb
CHANGED
@@ -16,6 +16,7 @@ module Neo4j
|
|
16
16
|
include Neo4j::Core::QueryFindInBatches
|
17
17
|
DEFINED_CLAUSES = {}
|
18
18
|
|
19
|
+
|
19
20
|
attr_accessor :clauses
|
20
21
|
|
21
22
|
class Parameters
|
@@ -217,7 +218,7 @@ module Neo4j
|
|
217
218
|
# Query.new.match('(q: Person {id: {id}})').params(id: 12)
|
218
219
|
#
|
219
220
|
def params(args)
|
220
|
-
copy.tap { |new_query| new_query.instance_variable_get('@params').add_params(args) }
|
221
|
+
copy.tap { |new_query| new_query.instance_variable_get('@params'.freeze).add_params(args) }
|
221
222
|
end
|
222
223
|
|
223
224
|
def unwrapped
|
@@ -397,9 +398,9 @@ module Neo4j
|
|
397
398
|
def copy
|
398
399
|
dup.tap do |query|
|
399
400
|
to_cypher
|
400
|
-
query.instance_variable_set('@params', @params.copy)
|
401
|
-
query.instance_variable_set('@partitioned_clauses', nil)
|
402
|
-
query.instance_variable_set('@response', nil)
|
401
|
+
query.instance_variable_set('@params'.freeze, @params.copy)
|
402
|
+
query.instance_variable_set('@partitioned_clauses'.freeze, nil)
|
403
|
+
query.instance_variable_set('@response'.freeze, nil)
|
403
404
|
end
|
404
405
|
end
|
405
406
|
|
@@ -425,7 +426,7 @@ module Neo4j
|
|
425
426
|
def build_deeper_query(clause_class, args = {}, options = {})
|
426
427
|
copy.tap do |new_query|
|
427
428
|
new_query.add_clauses [nil] if [nil, WithClause].include?(clause_class)
|
428
|
-
new_query.add_clauses clause_class.from_args(args, new_query.instance_variable_get('@params'), options) if clause_class
|
429
|
+
new_query.add_clauses clause_class.from_args(args, new_query.instance_variable_get('@params'.freeze), options) if clause_class
|
429
430
|
end
|
430
431
|
end
|
431
432
|
|
@@ -13,6 +13,7 @@ module Neo4j
|
|
13
13
|
UNDERSCORE = '_'
|
14
14
|
COMMA_SPACE = ', '
|
15
15
|
AND = ' AND '
|
16
|
+
PRETTY_NEW_LINE = "\n "
|
16
17
|
|
17
18
|
attr_accessor :params, :arg
|
18
19
|
attr_reader :options, :param_vars_added
|
@@ -148,11 +149,12 @@ module Neo4j
|
|
148
149
|
end
|
149
150
|
|
150
151
|
def clause_string(clauses, pretty)
|
151
|
-
join_string = clause_join +
|
152
|
+
join_string = pretty ? clause_join + PRETTY_NEW_LINE : clause_join
|
152
153
|
|
153
154
|
strings = clause_strings(clauses)
|
154
|
-
|
155
|
-
|
155
|
+
stripped_string = strings.join(join_string)
|
156
|
+
stripped_string.strip!
|
157
|
+
(pretty && strings.size > 1) ? PRETTY_NEW_LINE + stripped_string : stripped_string
|
156
158
|
end
|
157
159
|
|
158
160
|
def clause_join
|
data/lib/neo4j-core/version.rb
CHANGED
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.0.alpha.
|
4
|
+
version: 7.0.0.alpha.4
|
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: 2016-08-
|
11
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|