neography 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/neography/connection.rb +1 -0
- data/lib/neography/errors.rb +3 -0
- data/lib/neography/rest.rb +12 -0
- data/lib/neography/version.rb +1 -1
- data/spec/integration/rest_plugin_spec.rb +18 -2
- metadata +2 -2
data/lib/neography/connection.rb
CHANGED
@@ -122,6 +122,7 @@ module Neography
|
|
122
122
|
when /NoSuchPropertyException/ ; raise NoSuchPropertyException.new(message, code, stacktrace)
|
123
123
|
when /RelationshipNotFoundException/ ; raise RelationshipNotFoundException.new(message, code, stacktrace)
|
124
124
|
when /NotFoundException/ ; raise NotFoundException.new(message, code, stacktrace)
|
125
|
+
when /UniquePathNotUniqueException/ ; raise UniquePathNotUniqueException.new(message, code, stacktrace)
|
125
126
|
else
|
126
127
|
raise NeographyError.new(message, code, stacktrace)
|
127
128
|
end
|
data/lib/neography/errors.rb
CHANGED
data/lib/neography/rest.rb
CHANGED
@@ -20,6 +20,7 @@ require 'neography/rest/relationship_indexes'
|
|
20
20
|
require 'neography/rest/relationship_auto_indexes'
|
21
21
|
require 'neography/rest/cypher'
|
22
22
|
require 'neography/rest/gremlin'
|
23
|
+
require 'neography/rest/extensions'
|
23
24
|
require 'neography/rest/batch'
|
24
25
|
require 'neography/rest/clean'
|
25
26
|
|
@@ -56,6 +57,7 @@ module Neography
|
|
56
57
|
|
57
58
|
@cypher = Cypher.new(@connection)
|
58
59
|
@gremlin = Gremlin.new(@connection)
|
60
|
+
@extensions = Extensions.new(@connection)
|
59
61
|
@batch = Batch.new(@connection)
|
60
62
|
@clean = Clean.new(@connection)
|
61
63
|
end
|
@@ -334,6 +336,16 @@ module Neography
|
|
334
336
|
@gremlin.execute(script, params)
|
335
337
|
end
|
336
338
|
|
339
|
+
# unmanaged extensions
|
340
|
+
|
341
|
+
def post_extension(path, params = {})
|
342
|
+
@extensions.post(path, params)
|
343
|
+
end
|
344
|
+
|
345
|
+
def get_extension(path)
|
346
|
+
@extensions.get(path)
|
347
|
+
end
|
348
|
+
|
337
349
|
# batch
|
338
350
|
|
339
351
|
def batch(*args)
|
data/lib/neography/version.rb
CHANGED
@@ -64,12 +64,12 @@ describe Neography::Rest do
|
|
64
64
|
|
65
65
|
it "can delete everything but start node" do
|
66
66
|
@neo.execute_query("START n=node(*) MATCH n-[r?]-() WHERE ID(n) <> 0 DELETE n,r")
|
67
|
-
expect {
|
67
|
+
expect {
|
68
68
|
@neo.execute_query("start n=node({id}) return n", {:id => 1})
|
69
69
|
}.to raise_error(Neography::BadInputException)
|
70
70
|
root_node = @neo.execute_query("start n=node({id}) return n", {:id => 0})
|
71
71
|
root_node.should_not be_nil
|
72
|
-
end
|
72
|
+
end
|
73
73
|
|
74
74
|
it "throws an error for an invalid query" do
|
75
75
|
expect {
|
@@ -77,6 +77,22 @@ describe Neography::Rest do
|
|
77
77
|
}.to raise_error(Neography::SyntaxException)
|
78
78
|
end
|
79
79
|
|
80
|
+
it "throws an error for not unique paths in unique path creation" do
|
81
|
+
node1 = @neo.create_node
|
82
|
+
node2 = @neo.create_node
|
83
|
+
|
84
|
+
id1 = node1["self"].split('/').last.to_i
|
85
|
+
id2 = node2["self"].split('/').last.to_i
|
86
|
+
|
87
|
+
# create two 'FOO' relationships
|
88
|
+
@neo.execute_query("START a=node({id1}), b=node({id2}) CREATE a-[r:FOO]->b RETURN r", { :id1 => id1, :id2 => id2 })
|
89
|
+
@neo.execute_query("START a=node({id1}), b=node({id2}) CREATE a-[r:FOO]->b RETURN r", { :id1 => id1, :id2 => id2 })
|
90
|
+
|
91
|
+
expect {
|
92
|
+
@neo.execute_query("START a=node({id1}), b=node({id2}) CREATE UNIQUE a-[r:FOO]->b RETURN r", { :id1 => id1, :id2 => id2 })
|
93
|
+
}.to raise_error(Neography::UniquePathNotUniqueException)
|
94
|
+
end
|
95
|
+
|
80
96
|
end
|
81
97
|
|
82
98
|
end
|
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.
|
4
|
+
version: 1.0.4
|
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:
|
12
|
+
date: 2013-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|