neography 1.3.11 → 1.3.12

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: 4089edb953cf8a75450a374587509e36a7ebc2cb
4
- data.tar.gz: 23729f4789ae38f437570cc3cb40bd81a07159e1
3
+ metadata.gz: 6bf0876954df6a4d1e5e0d272c354975b363ed3f
4
+ data.tar.gz: 502ff012fd51906ed4732b264b9ef10b7af24dd7
5
5
  SHA512:
6
- metadata.gz: 838825f354af0d739a24aac78a89afa1a9c95d733460ba7a59ab18fd27e182cc445b736686bffcbdbb69e035b1c4a39e47ee3139d6164795099d2a3e3a0744f3
7
- data.tar.gz: a656969ff18920af8302a87ac33b7f89e130d7e813ae2c091edbaf0c6799d667001cba24c0b972e81af07a02e280b5e32fc24b3d9a4e23c5b325e158141f38c6
6
+ metadata.gz: 0179f2f9bc413e3de26ddc205b1428e25381134dc774cd4945a7c85c8191cbe7ee70b9c39e2b5dbac8654f6b75f2a8b6b34639cffb02a0194d347fdc50436a9f
7
+ data.tar.gz: bc9129d0a86f6c52958c6f29d751563c9e329c9bd92ab00ae06fb2675a0115bd089266b9b7127359cdbce8fdd3d9caab4d7f2bbc1ad49aa9d13fb1f5f0890efa
data/ChangeLog CHANGED
@@ -1,3 +1,25 @@
1
+ v1.3.11
2
+ =======
3
+ 49e310d Bump to 1.3.11
4
+ 26ec8a0 adding to_s to errors
5
+ 712400e fix config tests for proxy addition
6
+ 475c675 add proxy to config for httpclient calls
7
+ d9e9e89 it's too much output, reverting this change
8
+
9
+ v1.3.10
10
+ =======
11
+ 3e2a2cc Bump to 1.3.10
12
+ f7ad164 add the request to the error
13
+
14
+ v1.3.9
15
+ ======
16
+ 273fbf4 Bump to 1.3.9
17
+ 7a77fc4 adding constraints to fix #143
18
+ 9d2fee7 add DeadlockDetectedException to fix #145
19
+ d5df0c4 Avoid waiting for a WWW-Authenticate under HTTP Basic auth
20
+ 4177e6a Add :remove_node_property to batch operations
21
+ f6b64c0 updating changelog
22
+
1
23
  v1.3.8
2
24
  ======
3
25
  3343c5e Bump to 1.3.8
@@ -21,15 +21,15 @@ module Neography
21
21
 
22
22
  def rel(dir, type)
23
23
  rel = Neography::RelationshipTraverser.new(self, type, dir)
24
- rel = rel.first unless rel.nil?
24
+ rel = rel.first unless rel.empty?
25
25
  rel
26
26
  end
27
27
 
28
28
  def rel?(dir=nil, type=nil)
29
29
  if DIRECTIONS.include?(dir.to_s)
30
- !self.neo_server.get_node_relationships(self, dir, type).nil?
30
+ !self.neo_server.get_node_relationships(self, dir, type).empty?
31
31
  else
32
- !self.neo_server.get_node_relationships(self, type, dir).nil?
32
+ !self.neo_server.get_node_relationships(self, type, dir).empty?
33
33
  end
34
34
  end
35
35
 
@@ -158,14 +158,15 @@ module Neography
158
158
 
159
159
  # RelationshipIndexes
160
160
 
161
- def create_unique_relationship(index, key, value, type, from, to)
161
+ def create_unique_relationship(index, key, value, type, from, to, props = nil)
162
162
  post RelationshipIndexes.unique_path(:index => index) do
163
163
  {
164
164
  :key => key,
165
165
  :value => value,
166
166
  :type => type,
167
167
  :start => build_node_uri(from),
168
- :end => build_node_uri(to)
168
+ :end => build_node_uri(to),
169
+ :properties => props
169
170
  }
170
171
  end
171
172
  end
@@ -33,7 +33,7 @@ module Neography
33
33
  node_relationships = @connection.get(type_path(:id => get_id(id), :direction => direction, :types => Array(types).join('&'))) || []
34
34
  end
35
35
 
36
- return nil if node_relationships.empty?
36
+ return [] if node_relationships.empty?
37
37
  node_relationships
38
38
  end
39
39
 
@@ -37,10 +37,7 @@ module Neography
37
37
  :headers => json_content_type
38
38
  }
39
39
 
40
- node_relationships = @connection.post(base_path(:id => get_id(id)), options) || []
41
-
42
- return nil if node_relationships.empty?
43
- node_relationships
40
+ @connection.post(base_path(:id => get_id(id)), options) || []
44
41
  end
45
42
 
46
43
  end
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "1.3.11"
2
+ VERSION = "1.3.13"
3
3
  end
@@ -331,7 +331,7 @@ describe Neography::NodeRelationship do
331
331
  it "#rel returns nil if there is no relationship" do
332
332
  a = Neography::Node.create
333
333
  b = Neography::Node.create
334
- a.rel(:outgoing, :friend).should be_nil
334
+ a.rel(:outgoing, :friend).should be_empty
335
335
  end
336
336
 
337
337
  it "#rel should only return one relationship even if there are more" do
@@ -16,13 +16,13 @@ describe Neography::Rest do
16
16
  existing_relationships[0]["self"].should == new_relationship["self"]
17
17
  end
18
18
 
19
- it "returns nil if it tries to get a relationship that does not exist" do
19
+ it "returns empty array if it tries to get a relationship that does not exist" do
20
20
  new_node1 = @neo.create_node
21
21
  new_node2 = @neo.create_node
22
22
  new_node3 = @neo.create_node
23
23
  new_relationship = @neo.create_relationship("friends", new_node1, new_node2)
24
24
  existing_relationship = @neo.get_node_relationships_to(new_node1, new_node3)
25
- existing_relationship.should be_nil
25
+ existing_relationship.should be_empty
26
26
  end
27
27
  end
28
28
 
@@ -130,7 +130,7 @@ describe Neography::Rest do
130
130
  new_node1 = @neo.create_node
131
131
  new_node2 = @neo.create_node
132
132
  relationships = @neo.get_node_relationships_to(new_node1, new_node2)
133
- relationships.should be_nil
133
+ relationships.should be_empty
134
134
  end
135
135
  end
136
136
 
@@ -219,7 +219,7 @@ describe Neography::Rest do
219
219
  new_relationship = @neo.create_relationship("friends", new_node1, new_node2, {"since" => '10-1-2010', "met" => "college"})
220
220
  @neo.delete_relationship(new_relationship)
221
221
  relationships = @neo.get_node_relationships(new_node1)
222
- relationships.should be_nil
222
+ relationships.should be_empty
223
223
  end
224
224
 
225
225
  it "raises error if it tries to delete a relationship that does not exist" do
@@ -347,7 +347,7 @@ describe Neography::Rest do
347
347
  it "returns nil if there are no relationships" do
348
348
  new_node1 = @neo.create_node
349
349
  relationships = @neo.get_node_relationships(new_node1)
350
- relationships.should be_nil
350
+ relationships.should be_empty
351
351
  end
352
352
  end
353
353
 
@@ -159,13 +159,13 @@ module Neography
159
159
 
160
160
  it "creates unique nodes" do
161
161
  expected_body = [
162
- { "id" => 0, "method" => "POST", "to" => "/index/relationship/index1?unique", "body" => { "key" => "key1", "value" => "value1", "type" => "type1", "start" => "/node/node1", "end" => "/node/node2" } },
163
- { "id" => 1, "method" => "POST", "to" => "/index/relationship/index2?unique", "body" => { "key" => "key2", "value" => "value2", "type" => "type2", "start" => "{0}", "end" => "{1}" } }
162
+ { "id" => 0, "method" => "POST", "to" => "/index/relationship/index1?unique", "body" => { "key" => "key1", "value" => "value1", "type" => "type1", "start" => "/node/node1", "end" => "/node/node2", "properties" => "properties" } },
163
+ { "id" => 1, "method" => "POST", "to" => "/index/relationship/index2?unique", "body" => { "key" => "key2", "value" => "value2", "type" => "type2", "start" => "{0}", "end" => "{1}", "properties" => "properties" } }
164
164
  ]
165
165
 
166
166
  connection.should_receive(:post).with("/batch", json_match(:body, expected_body))
167
- subject.execute [:create_unique_relationship, "index1", "key1", "value1", "type1", "node1", "node2" ],
168
- [:create_unique_relationship, "index2", "key2", "value2", "type2", "{0}", "{1}" ]
167
+ subject.execute [:create_unique_relationship, "index1", "key1", "value1", "type1", "node1", "node2","properties" ],
168
+ [:create_unique_relationship, "index2", "key2", "value2", "type2", "{0}", "{1}", "properties" ]
169
169
  end
170
170
 
171
171
  it "adds relationships to an index" do
@@ -43,13 +43,13 @@ module Neography
43
43
  subject.get("42", :in, ["foo", "bar"])
44
44
  end
45
45
 
46
- it "returns nil if no relationships were found" do
47
- connection.stub(:get).and_return(nil)
48
- subject.get("42", :in).should be_nil
46
+ it "returns empty array if no relationships were found" do
47
+ connection.stub(:get).and_return([])
48
+ subject.get("42", :in).should be_empty
49
49
  end
50
50
 
51
- it "returns nil if no relationships were found by type" do
52
- connection.stub(:get).and_return(nil)
51
+ it "returns empty array if no relationships were found by type" do
52
+ connection.stub(:get).and_return([])
53
53
  subject.get("42", :in, "foo")
54
54
  end
55
55
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neography
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
4
+ version: 1.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max De Marzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  version: '0'
292
292
  requirements: []
293
293
  rubyforge_project: neography
294
- rubygems_version: 2.0.3
294
+ rubygems_version: 2.2.2
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: ruby wrapper to Neo4j Rest API