neo4apis 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo4apis/cli/base.rb +4 -2
- data/lib/neo4apis/query_buffer.rb +5 -2
- data/neo4apis.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb4dacf1138b2e418df07df7885e85d41ace5c55
|
4
|
+
data.tar.gz: 407cfef5e4b397aacf458a85150ed1f724aedbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acb10b10c18eae46d48db353556d648982b25bd620060b1645d1bd00da4d82e7a88c875889bb54c118ebb4ef430abb33df3fa685e197436eefe422b9d9a16080
|
7
|
+
data.tar.gz: a69ee3d2fbca7083cc086a89cd7666099e6cbd09f5fc47ea5bb6d5135d82cbb27b0d1626f2ff1382552709cc5bba289bb2781cbf837de311e0471619b1338507
|
data/lib/neo4apis/cli/base.rb
CHANGED
@@ -5,8 +5,10 @@ module Neo4Apis
|
|
5
5
|
class_option :neo4j_username, type: :string
|
6
6
|
class_option :neo4j_password, type: :string
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
no_commands do
|
9
|
+
def specified_neo4j_session
|
10
|
+
Neo4j::Session.open(:server_db, options[:neo4j_url], basic_auth: {username: options[:neo4j_username], password: options[:neo4j_password]})
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
@@ -41,8 +41,11 @@ module Neo4Apis
|
|
41
41
|
if response.status != 200
|
42
42
|
fail "ERROR: response status #{response.status}:\n#{response.body}"
|
43
43
|
else
|
44
|
-
|
45
|
-
|
44
|
+
response_data = response.body.is_a?(String) ? JSON.parse(response.body) : response.body
|
45
|
+
response_errors = response_data[:errors] || response_data['errors']
|
46
|
+
|
47
|
+
if response_errors.size > 0
|
48
|
+
error_string = response_errors.map do |error|
|
46
49
|
[error['code'], error['message']].join("\n")
|
47
50
|
end.join("\n\n")
|
48
51
|
|
data/neo4apis.gemspec
CHANGED