neography 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/Gemfile.lock +16 -17
- data/README.rdoc +13 -1
- data/lib/neography/node_traverser.rb +1 -1
- data/lib/neography/property.rb +2 -4
- data/lib/neography/relationship.rb +2 -2
- data/lib/neography/tasks.rb +1 -1
- data/lib/neography/version.rb +1 -1
- data/neography.gemspec +2 -2
- data/spec/integration/node_spec.rb +17 -0
- data/spec/integration/rest_batch_spec.rb +80 -0
- data/spec/integration/rest_gremlin_fail_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +12 -15
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neography (0.0.
|
5
|
-
httparty (
|
4
|
+
neography (0.0.17)
|
5
|
+
httparty (= 0.7.8)
|
6
6
|
json
|
7
7
|
os
|
8
8
|
rubyzip
|
@@ -11,24 +11,23 @@ GEM
|
|
11
11
|
remote: http://rubygems.org/
|
12
12
|
specs:
|
13
13
|
crack (0.1.8)
|
14
|
-
diff-lcs (1.1.
|
14
|
+
diff-lcs (1.1.3)
|
15
15
|
httparty (0.7.8)
|
16
16
|
crack (= 0.1.8)
|
17
|
-
json (1.6.
|
17
|
+
json (1.6.4)
|
18
|
+
json (1.6.4-java)
|
18
19
|
net-http-spy (0.2.1)
|
19
|
-
os (0.9.
|
20
|
+
os (0.9.5)
|
20
21
|
rake (0.8.7)
|
21
|
-
rspec (2.0
|
22
|
-
rspec-core (~> 2.0
|
23
|
-
rspec-expectations (~> 2.0
|
24
|
-
rspec-mocks (~> 2.0
|
25
|
-
rspec-core (2.
|
26
|
-
rspec-expectations (2.0
|
27
|
-
diff-lcs (
|
28
|
-
rspec-mocks (2.0
|
29
|
-
|
30
|
-
rspec-expectations (~> 2.0.1)
|
31
|
-
rubyzip (0.9.4)
|
22
|
+
rspec (2.7.0)
|
23
|
+
rspec-core (~> 2.7.0)
|
24
|
+
rspec-expectations (~> 2.7.0)
|
25
|
+
rspec-mocks (~> 2.7.0)
|
26
|
+
rspec-core (2.7.1)
|
27
|
+
rspec-expectations (2.7.0)
|
28
|
+
diff-lcs (~> 1.1.2)
|
29
|
+
rspec-mocks (2.7.0)
|
30
|
+
rubyzip (0.9.5)
|
32
31
|
|
33
32
|
PLATFORMS
|
34
33
|
java
|
@@ -38,4 +37,4 @@ DEPENDENCIES
|
|
38
37
|
neography!
|
39
38
|
net-http-spy (= 0.2.1)
|
40
39
|
rake (~> 0.8.7)
|
41
|
-
rspec
|
40
|
+
rspec
|
data/README.rdoc
CHANGED
@@ -44,7 +44,7 @@ Just add gem 'neography' to your Gemfile and run bundle install.
|
|
44
44
|
The following tasks will be available to you:
|
45
45
|
|
46
46
|
rake neo4j:install # Install Neo4j to the neo4j directory under your project
|
47
|
-
rake neo4j:install[community,1.6.
|
47
|
+
rake neo4j:install[community,1.6.M02] # Install Neo4j Community edition, version 1.6.M02
|
48
48
|
rake neo4j:install[advanced,1.5] # Install Neo4j Advanced edition, version 1.5
|
49
49
|
rake neo4j:install[enterprise,1.5] # Install Neo4j Enterprise edition, version 1.5
|
50
50
|
rake neo4j:start # Start Neo4j
|
@@ -284,11 +284,23 @@ Phase 2 way of doing these:
|
|
284
284
|
|
285
285
|
=== To Do
|
286
286
|
|
287
|
+
* Batch functions
|
287
288
|
* Phase 2 Index functionality
|
288
289
|
* More Tests
|
289
290
|
* More Examples
|
290
291
|
* Mixins ?
|
291
292
|
|
293
|
+
=== Contributing
|
294
|
+
|
295
|
+
{<img src="https://secure.travis-ci.org/maxdemarzi/neography.png" />}[http://travis-ci.org/maxdemarzi/neography]
|
296
|
+
|
297
|
+
Please create a {new issue}[https://github.com/maxdemarzi/neography/issues] if you run into any bugs.
|
298
|
+
Contribute patches via pull requests.
|
299
|
+
|
300
|
+
=== Help
|
301
|
+
|
302
|
+
If you are just starting out, or need help send me an e-mail at maxdemazi@gmail.com.
|
303
|
+
|
292
304
|
=== Licenses
|
293
305
|
|
294
306
|
* Neography - MIT, see the LICENSE file http://github.com/maxdemarzi/neography/tree/master/LICENSE.
|
@@ -116,7 +116,7 @@ module Neography
|
|
116
116
|
options["return filter"] = @filter unless @filter.nil?
|
117
117
|
options["depth"] = @depth unless @depth.nil?
|
118
118
|
|
119
|
-
if @relationships[0]["type"].
|
119
|
+
if @relationships[0]["type"].empty?
|
120
120
|
rels = @from.neo_server.get_node_relationships(@from, @relationships[0]["direction"])
|
121
121
|
case @relationships[0]["direction"]
|
122
122
|
when "in"
|
data/lib/neography/property.rb
CHANGED
@@ -12,10 +12,8 @@ module Neography
|
|
12
12
|
if value.nil?
|
13
13
|
if self.is_a? Neography::Node
|
14
14
|
neo_server.remove_node_properties(self.neo_id, [key])
|
15
|
-
@table[key] = nil
|
16
15
|
else
|
17
16
|
neo_server.remove_relationship_properties(self.neo_id, [key])
|
18
|
-
@table[key] = nil
|
19
17
|
end
|
20
18
|
else
|
21
19
|
if self.is_a? Neography::Node
|
@@ -23,10 +21,9 @@ module Neography
|
|
23
21
|
else
|
24
22
|
neo_server.set_relationship_properties(self.neo_id, {k => value})
|
25
23
|
end
|
26
|
-
|
27
24
|
new_ostruct_member(k) unless self.respond_to?(key)
|
28
|
-
|
29
25
|
end
|
26
|
+
@table[key] = value
|
30
27
|
end
|
31
28
|
|
32
29
|
|
@@ -40,6 +37,7 @@ module Neography
|
|
40
37
|
self[name.to_sym] = x
|
41
38
|
end
|
42
39
|
end
|
40
|
+
name
|
43
41
|
end
|
44
42
|
|
45
43
|
|
@@ -25,8 +25,8 @@ module Neography
|
|
25
25
|
rel = db.get_relationship(rel)
|
26
26
|
unless rel.nil?
|
27
27
|
rel = Neography::Relationship.new(rel)
|
28
|
-
rel.start_node = Neography::Node.load(rel.start_node)
|
29
|
-
rel.end_node = Neography::Node.load(rel.end_node)
|
28
|
+
rel.start_node = Neography::Node.load(rel.start_node, db)
|
29
|
+
rel.end_node = Neography::Node.load(rel.end_node, db)
|
30
30
|
end
|
31
31
|
rel
|
32
32
|
end
|
data/lib/neography/tasks.rb
CHANGED
@@ -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.6.
|
7
|
+
args.with_defaults(:edition => "community", :version => "1.6.M02")
|
8
8
|
puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}"
|
9
9
|
|
10
10
|
if OS::Underlying.windows?
|
data/lib/neography/version.rb
CHANGED
data/neography.gemspec
CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_development_dependency "rspec"
|
22
|
+
s.add_development_dependency "rspec"
|
23
23
|
s.add_development_dependency "net-http-spy", "0.2.1"
|
24
24
|
s.add_development_dependency "rake", "~> 0.8.7"
|
25
|
-
s.add_dependency "httparty", "
|
25
|
+
s.add_dependency "httparty", "0.7.8"
|
26
26
|
s.add_dependency "json"
|
27
27
|
s.add_dependency "os"
|
28
28
|
s.add_dependency "rubyzip"
|
@@ -148,6 +148,23 @@ describe Neography::Node do
|
|
148
148
|
existing_node.eyes.should == "brown"
|
149
149
|
existing_node.hair.should == "black"
|
150
150
|
end
|
151
|
+
|
152
|
+
it "can pass issue 18" do
|
153
|
+
n = Neography::Node.create("name" => "Test")
|
154
|
+
n.prop = 1
|
155
|
+
n.prop.should == 1
|
156
|
+
n.prop = 1
|
157
|
+
n.prop.should == 1
|
158
|
+
n[:prop].should == 1
|
159
|
+
n[:prop2] = 2
|
160
|
+
n[:prop2].should == 2
|
161
|
+
n[:prop2] = 2
|
162
|
+
n[:prop2].should == 2
|
163
|
+
n.name
|
164
|
+
n.name = "New Name"
|
165
|
+
n.name.should == "New Name"
|
166
|
+
end
|
167
|
+
|
151
168
|
end
|
152
169
|
|
153
170
|
describe "get node properties" do
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Neography::Rest do
|
4
|
+
before(:each) do
|
5
|
+
@neo = Neography::Rest.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "simple batch" do
|
9
|
+
it "can get a single node" do
|
10
|
+
pending
|
11
|
+
end
|
12
|
+
|
13
|
+
it "can get multiple nodes" do
|
14
|
+
pending
|
15
|
+
end
|
16
|
+
|
17
|
+
it "can create a single node" do
|
18
|
+
pending
|
19
|
+
end
|
20
|
+
|
21
|
+
it "can create multiple nodes" do
|
22
|
+
pending
|
23
|
+
end
|
24
|
+
|
25
|
+
it "can update a single node" do
|
26
|
+
pending
|
27
|
+
end
|
28
|
+
|
29
|
+
it "can update multiple nodes" do
|
30
|
+
pending
|
31
|
+
end
|
32
|
+
|
33
|
+
it "can get a single relationship" do
|
34
|
+
pending
|
35
|
+
end
|
36
|
+
|
37
|
+
it "can get multiple relationships" do
|
38
|
+
pending
|
39
|
+
end
|
40
|
+
|
41
|
+
it "can create a single relationship" do
|
42
|
+
pending
|
43
|
+
end
|
44
|
+
|
45
|
+
it "can create multiple relationships" do
|
46
|
+
pending
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can update a single relationship" do
|
50
|
+
pending
|
51
|
+
end
|
52
|
+
|
53
|
+
it "can update multiple relationships" do
|
54
|
+
pending
|
55
|
+
end
|
56
|
+
|
57
|
+
it "can add a node to an index" do
|
58
|
+
pending
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "referenced batch" do
|
63
|
+
it "can create a relationship from two newly created nodes" do
|
64
|
+
pending
|
65
|
+
end
|
66
|
+
|
67
|
+
it "can create a relationship from an existing node and a newly created node" do
|
68
|
+
pending
|
69
|
+
end
|
70
|
+
|
71
|
+
it "can add a newly created node to an index" do
|
72
|
+
pending
|
73
|
+
end
|
74
|
+
|
75
|
+
it "can add a newly created relationship to an index" do
|
76
|
+
pending
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
@@ -25,7 +25,7 @@ describe Neography::Rest do
|
|
25
25
|
|
26
26
|
|
27
27
|
describe "break gremlin" do
|
28
|
-
it "can can't handle node and relationship indexes with the same name" do
|
28
|
+
it "can can't handle node and relationship indexes with the same name", :break_gremlin => true do
|
29
29
|
new_node1 = @neo.create_node
|
30
30
|
new_node2 = @neo.create_node
|
31
31
|
new_relationship = @neo.create_relationship("friends", new_node1, new_node2)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neography
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 18
|
10
|
+
version: 0.0.18
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Max De Marzi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-03 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|
@@ -23,16 +23,12 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 3
|
29
29
|
segments:
|
30
|
-
- 2
|
31
|
-
- 0
|
32
30
|
- 0
|
33
|
-
|
34
|
-
- 22
|
35
|
-
version: 2.0.0.beta.22
|
31
|
+
version: "0"
|
36
32
|
type: :development
|
37
33
|
version_requirements: *id001
|
38
34
|
- !ruby/object:Gem::Dependency
|
@@ -73,14 +69,14 @@ dependencies:
|
|
73
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
74
70
|
none: false
|
75
71
|
requirements:
|
76
|
-
- -
|
72
|
+
- - "="
|
77
73
|
- !ruby/object:Gem::Version
|
78
|
-
hash:
|
74
|
+
hash: 19
|
79
75
|
segments:
|
80
76
|
- 0
|
81
77
|
- 7
|
82
|
-
-
|
83
|
-
version: 0.7.
|
78
|
+
- 8
|
79
|
+
version: 0.7.8
|
84
80
|
type: :runtime
|
85
81
|
version_requirements: *id004
|
86
82
|
- !ruby/object:Gem::Dependency
|
@@ -175,6 +171,7 @@ files:
|
|
175
171
|
- spec/integration/node_relationship_spec.rb
|
176
172
|
- spec/integration/node_spec.rb
|
177
173
|
- spec/integration/relationship_spec.rb
|
174
|
+
- spec/integration/rest_batch_spec.rb
|
178
175
|
- spec/integration/rest_bulk_spec.rb
|
179
176
|
- spec/integration/rest_experimental_spec.rb
|
180
177
|
- spec/integration/rest_gremlin_fail_spec.rb
|