neography 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/CONTRIBUTORS CHANGED
@@ -3,4 +3,5 @@ Maintainer:
3
3
 
4
4
  Contributors:
5
5
  * Peter Neubauer
6
- * Ian Dees
6
+ * Ian Dees
7
+ * Phuong CAO
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neography (0.0.11)
4
+ neography (0.0.12)
5
5
  httparty (~> 0.7.3)
6
6
  json
7
7
 
@@ -34,8 +34,6 @@ PLATFORMS
34
34
 
35
35
  DEPENDENCIES
36
36
  fakeweb (~> 1.3.0)
37
- httparty (~> 0.7.3)
38
- json
39
37
  neography!
40
38
  net-http-spy (~> 0.2.1)
41
39
  rake (~> 0.8.7)
@@ -54,7 +54,7 @@ module Neography
54
54
  end
55
55
 
56
56
  def get_root
57
- get('/')
57
+ get("/node/#{get_id(get('/')["reference_node"])}")
58
58
  end
59
59
 
60
60
  def create_node(*args)
@@ -373,6 +373,8 @@ module Neography
373
373
 
374
374
  def get_id(id)
375
375
  case id
376
+ when Array
377
+ get_id(id.first)
376
378
  when Hash
377
379
  id["self"].split('/').last
378
380
  when String
@@ -1,3 +1,3 @@
1
1
  module Neography
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -4,7 +4,7 @@ describe Neography do
4
4
  describe "ref_node" do
5
5
  it "can get the reference node" do
6
6
  root_node = Neography.ref_node
7
- root_node.should have_key("reference_node")
7
+ root_node.should have_key("self")
8
8
  end
9
9
  end
10
10
  end
@@ -250,6 +250,25 @@ describe Neography::Rest do
250
250
  @neo.remove_relationship_from_index("test_index", key, value, new_relationship)
251
251
  end
252
252
 
253
+ it "can find use the results of a node index" do
254
+ new_node1 = @neo.create_node
255
+ new_node2 = @neo.create_node
256
+ key = generate_text(6)
257
+ value1 = generate_text
258
+ value2 = generate_text
259
+ @neo.add_node_to_index("test_index", key, value1, new_node1)
260
+ @neo.add_node_to_index("test_index", key, value2, new_node2)
261
+ existing_node1 = @neo.get_node_index("test_index", key, value1)
262
+ existing_node2 = @neo.get_node_index("test_index", key, value2)
263
+ new_relationship = @neo.create_relationship("friends", existing_node1, existing_node2)
264
+ new_relationship["start"].should_not be_nil
265
+ new_relationship["start"].should == new_node1["self"]
266
+ new_relationship["end"].should_not be_nil
267
+ new_relationship["end"].should == new_node2["self"]
268
+ @neo.remove_node_from_index("test_index", new_node1)
269
+ @neo.remove_node_from_index("test_index", new_node2)
270
+ end
271
+
253
272
  end
254
273
 
255
274
 
@@ -8,7 +8,8 @@ describe Neography::Rest do
8
8
  describe "get_root" do
9
9
  it "can get the root node" do
10
10
  root_node = @neo.get_root
11
- root_node.should have_key("reference_node")
11
+ root_node.should have_key("self")
12
+ root_node["self"].split('/').last.should == "0"
12
13
  end
13
14
  end
14
15
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neography
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 12
10
- version: 0.0.12
4
+ prerelease:
5
+ version: 0.0.13
11
6
  platform: ruby
12
7
  authors:
13
8
  - Max De Marzi
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-03-11 00:00:00 -08:00
13
+ date: 2011-04-15 00:00:00 -07:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
@@ -26,13 +21,6 @@ dependencies:
26
21
  requirements:
27
22
  - - ~>
28
23
  - !ruby/object:Gem::Version
29
- hash: 62196431
30
- segments:
31
- - 2
32
- - 0
33
- - 0
34
- - beta
35
- - 22
36
24
  version: 2.0.0.beta.22
37
25
  type: :development
38
26
  version_requirements: *id001
@@ -44,11 +32,6 @@ dependencies:
44
32
  requirements:
45
33
  - - ~>
46
34
  - !ruby/object:Gem::Version
47
- hash: 21
48
- segments:
49
- - 0
50
- - 2
51
- - 1
52
35
  version: 0.2.1
53
36
  type: :development
54
37
  version_requirements: *id002
@@ -60,11 +43,6 @@ dependencies:
60
43
  requirements:
61
44
  - - ~>
62
45
  - !ruby/object:Gem::Version
63
- hash: 27
64
- segments:
65
- - 1
66
- - 3
67
- - 0
68
46
  version: 1.3.0
69
47
  type: :development
70
48
  version_requirements: *id003
@@ -76,11 +54,6 @@ dependencies:
76
54
  requirements:
77
55
  - - ~>
78
56
  - !ruby/object:Gem::Version
79
- hash: 49
80
- segments:
81
- - 0
82
- - 8
83
- - 7
84
57
  version: 0.8.7
85
58
  type: :development
86
59
  version_requirements: *id004
@@ -92,11 +65,6 @@ dependencies:
92
65
  requirements:
93
66
  - - ~>
94
67
  - !ruby/object:Gem::Version
95
- hash: 5
96
- segments:
97
- - 0
98
- - 7
99
- - 3
100
68
  version: 0.7.3
101
69
  type: :runtime
102
70
  version_requirements: *id005
@@ -108,9 +76,6 @@ dependencies:
108
76
  requirements:
109
77
  - - ">="
110
78
  - !ruby/object:Gem::Version
111
- hash: 3
112
- segments:
113
- - 0
114
79
  version: "0"
115
80
  type: :runtime
116
81
  version_requirements: *id006
@@ -183,23 +148,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
148
  requirements:
184
149
  - - ">="
185
150
  - !ruby/object:Gem::Version
186
- hash: 3
187
- segments:
188
- - 0
189
151
  version: "0"
190
152
  required_rubygems_version: !ruby/object:Gem::Requirement
191
153
  none: false
192
154
  requirements:
193
155
  - - ">="
194
156
  - !ruby/object:Gem::Version
195
- hash: 3
196
- segments:
197
- - 0
198
157
  version: "0"
199
158
  requirements: []
200
159
 
201
160
  rubyforge_project: neography
202
- rubygems_version: 1.3.7
161
+ rubygems_version: 1.5.2
203
162
  signing_key:
204
163
  specification_version: 3
205
164
  summary: ruby wrapper to Neo4j Rest API