neography 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
- script: "bundle exec rake neo4j:install['enterprise','1.8.1'] neo4j:start spec --trace"
1
+ script: "bundle exec rake neo4j:install['enterprise','1.8.2'] neo4j:start spec --trace"
2
2
  language: ruby
3
3
  rvm:
4
4
  - 1.9.3
@@ -105,9 +105,15 @@ module Neography
105
105
  end
106
106
 
107
107
  def handle_4xx_500_response(code, body)
108
- parsed_body = JSON.parse(body)
109
- message = parsed_body["message"]
110
- stacktrace = parsed_body["stacktrace"]
108
+ if body.nil? or body == ""
109
+ parsed_body = {}
110
+ message = "No error message returned from server."
111
+ stacktrace = ""
112
+ else
113
+ parsed_body = JSON.parse(body)
114
+ message = parsed_body["message"]
115
+ stacktrace = parsed_body["stacktrace"]
116
+ end
111
117
 
112
118
  @logger.error "#{code} error: #{body}" if @log_enabled
113
119
 
@@ -14,7 +14,8 @@ module Neography
14
14
  @relationships << {"type" => type.to_s, "direction" => dir.to_s }
15
15
  end unless types.nil?
16
16
  @get = ["node","rel"]
17
- @loaded = Array.new
17
+ @loaded_nodes = Array.new
18
+ @loaded_rels = Array.new
18
19
  end
19
20
 
20
21
  def nodes
@@ -62,15 +63,15 @@ module Neography
62
63
 
63
64
  if @get.include?("node")
64
65
  path["nodes"].each_with_index do |n, i|
65
- @loaded[n.split('/').last.to_i] = Neography::Node.load(n) if @loaded.at(n.split('/').last.to_i).nil?
66
- paths[i * 2] = @loaded[n.split('/').last.to_i]
66
+ @loaded_nodes[n.split('/').last.to_i] = Neography::Node.load(n) if @loaded_nodes.at(n.split('/').last.to_i).nil?
67
+ paths[i * 2] = @loaded_nodes[n.split('/').last.to_i]
67
68
  end
68
69
  end
69
70
 
70
71
  if @get.include?("rel")
71
72
  path["relationships"].each_with_index do |r, i|
72
- @loaded[r.split('/').last.to_i] = Neography::Relationship.load(r) if @loaded.at(r.split('/').last.to_i).nil?
73
- paths[i * 2 + 1] = @loaded[r.split('/').last.to_i]
73
+ @loaded_rels[r.split('/').last.to_i] = Neography::Relationship.load(r) if @loaded_rels.at(r.split('/').last.to_i).nil?
74
+ paths[i * 2 + 1] = @loaded_rels[r.split('/').last.to_i]
74
75
  end
75
76
  end
76
77
 
@@ -4,7 +4,7 @@ require 'os'
4
4
  namespace :neo4j do
5
5
  desc "Install Neo4j"
6
6
  task :install, :edition, :version do |t, args|
7
- args.with_defaults(:edition => "community", :version => "1.8.1")
7
+ args.with_defaults(:edition => "community", :version => "1.8.2")
8
8
  puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"
9
9
 
10
10
  if OS::Underlying.windows?
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -167,6 +167,16 @@ describe Neography::Rest do
167
167
  new_index = @neo.get_relationship_index("test_relationship_index", key, value)
168
168
  new_index.should be_nil
169
169
  end
170
+
171
+ it "throws an error when there is an empty string in the value when removing a node" do
172
+ new_node = @neo.create_node
173
+ key = generate_text(6)
174
+ value = generate_text
175
+ @neo.add_node_to_index("test_node_index", key, value, new_node)
176
+ new_index = @neo.get_node_index("test_node_index", key, value)
177
+ new_index.should_not be_nil
178
+ expect { @neo.remove_node_from_index("test_node_index", key, "", new_node) }.to raise_error Neography::NeographyError
179
+ end
170
180
  end
171
181
 
172
182
  describe "get index" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neography
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-24 00:00:00.000000000 Z
12
+ date: 2013-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec