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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fedf11c93ff329de09c8c6e529ffd4612fb743d6
4
- data.tar.gz: 786710564e9b2a4c21807e9492d73b5cd7933156
3
+ metadata.gz: cb4dacf1138b2e418df07df7885e85d41ace5c55
4
+ data.tar.gz: 407cfef5e4b397aacf458a85150ed1f724aedbb5
5
5
  SHA512:
6
- metadata.gz: b36a2e013ecf99bc50334181ffc03dc22ede8c2a8abcacf47b4f05398ab533dc261e3be1e5aff9566afdc930ef3c6668fb088a800965ce13b18fa0e5385b9c92
7
- data.tar.gz: c1876201d6fe0291f3d1236eca33fbb60bbbdce74d9b61f14696e01d0f37911a013521b907dde3ae794fe6485eb60a84c5af55ef7615ee124668f0d33776bdc3
6
+ metadata.gz: acb10b10c18eae46d48db353556d648982b25bd620060b1645d1bd00da4d82e7a88c875889bb54c118ebb4ef430abb33df3fa685e197436eefe422b9d9a16080
7
+ data.tar.gz: a69ee3d2fbca7083cc086a89cd7666099e6cbd09f5fc47ea5bb6d5135d82cbb27b0d1626f2ff1382552709cc5bba289bb2781cbf837de311e0471619b1338507
@@ -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
- def neo4j_session
9
- Neo4j::Session.open(:server_db, options[:neo4j_url], basic_auth: {username: options[:neo4j_username], password: options[:neo4j_password]})
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
- if response.body[:errors].size > 0
45
- error_string = response.body[:errors].map do |error|
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
@@ -3,7 +3,7 @@ $:.unshift lib unless $:.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "neo4apis"
6
- s.version = '0.8.0'
6
+ s.version = '0.8.1'
7
7
  s.required_ruby_version = ">= 1.9.1"
8
8
 
9
9
  s.authors = "Brian Underwood"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4apis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood