neography 1.0.10 → 1.0.11

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.
Files changed (37) hide show
  1. data/.travis.yml +1 -1
  2. data/README.md +1 -0
  3. data/lib/neography/connection.rb +45 -34
  4. data/lib/neography/node.rb +1 -1
  5. data/lib/neography/path_traverser.rb +9 -4
  6. data/lib/neography/property_container.rb +16 -4
  7. data/lib/neography/rest.rb +86 -2
  8. data/lib/neography/rest/batch.rb +4 -12
  9. data/lib/neography/rest/cypher.rb +12 -3
  10. data/lib/neography/rest/helpers.rb +12 -0
  11. data/lib/neography/rest/node_labels.rb +60 -0
  12. data/lib/neography/rest/node_relationships.rb +0 -11
  13. data/lib/neography/rest/other_node_relationships.rb +1 -12
  14. data/lib/neography/rest/relationship_types.rb +18 -0
  15. data/lib/neography/rest/schema_indexes.rb +34 -0
  16. data/lib/neography/rest/transactions.rb +83 -0
  17. data/lib/neography/tasks.rb +1 -1
  18. data/lib/neography/version.rb +1 -1
  19. data/spec/integration/node_spec.rb +13 -0
  20. data/spec/integration/rest_batch_spec.rb +11 -15
  21. data/spec/integration/rest_batch_streaming_spec.rb +2 -2
  22. data/spec/integration/rest_gremlin_fail_spec.rb +4 -4
  23. data/spec/integration/rest_header_spec.rb +1 -1
  24. data/spec/integration/rest_labels_spec.rb +131 -0
  25. data/spec/integration/rest_plugin_spec.rb +32 -3
  26. data/spec/integration/rest_relationship_types_spec.rb +18 -0
  27. data/spec/integration/rest_schema_index_spec.rb +32 -0
  28. data/spec/integration/rest_transaction_spec.rb +100 -0
  29. data/spec/spec_helper.rb +8 -1
  30. data/spec/unit/connection_spec.rb +1 -1
  31. data/spec/unit/node_spec.rb +1 -1
  32. data/spec/unit/rest/batch_spec.rb +21 -21
  33. data/spec/unit/rest/labels_spec.rb +73 -0
  34. data/spec/unit/rest/relationship_types_spec.rb +16 -0
  35. data/spec/unit/rest/schema_index_spec.rb +31 -0
  36. data/spec/unit/rest/transactions_spec.rb +44 -0
  37. metadata +22 -2
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module Neography
4
+ class Rest
5
+ describe RelationshipTypes do
6
+
7
+ let(:connection) { stub(:configuration => "http://configuration") }
8
+ subject { RelationshipTypes.new(connection) }
9
+
10
+ it "lists all relationship types" do
11
+ connection.should_receive(:get).with("/relationship/types")
12
+ subject.list
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ module Neography
4
+ class Rest
5
+ describe SchemaIndexes do
6
+
7
+ let(:connection) { stub(:configuration => "http://configuration") }
8
+ subject { SchemaIndexes.new(connection) }
9
+
10
+ it "create schema indexes" do
11
+ options = {
12
+ :body => '{"property_keys":["name"]}',
13
+ :headers => json_content_type
14
+ }
15
+ connection.should_receive(:post).with("/schema/index/person", options)
16
+ subject.create("person", ["name"])
17
+ end
18
+
19
+ it "get schema indexes" do
20
+ connection.should_receive(:get).with("/schema/index/person")
21
+ subject.list("person")
22
+ end
23
+
24
+ it "delete schema indexes" do
25
+ connection.should_receive(:delete).with("/schema/index/person/name")
26
+ subject.drop("person","name")
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+
3
+ module Neography
4
+ class Rest
5
+ describe Transactions do
6
+
7
+ let(:connection) { stub(:configuration => "http://configuration") }
8
+ subject { Transactions.new(connection) }
9
+
10
+ it "can create new transactions" do
11
+ options = {
12
+ :body => '{"statements":[]}',
13
+ :headers => json_content_type
14
+ }
15
+ connection.should_receive(:post).with("/transaction", options)
16
+ subject.begin
17
+ end
18
+
19
+ it "can add to transactions" do
20
+ options = {
21
+ :body => '{"statements":[]}',
22
+ :headers => json_content_type
23
+ }
24
+ connection.should_receive(:post).with("/transaction/1", options)
25
+ subject.add(1, [])
26
+ end
27
+
28
+ it "can commit transactions" do
29
+ options = {
30
+ :body => '{"statements":[]}',
31
+ :headers => json_content_type
32
+ }
33
+ connection.should_receive(:post).with("/transaction/1/commit", options)
34
+ subject.commit(1, [])
35
+ end
36
+
37
+ it "can rollback transactions" do
38
+ connection.should_receive(:delete).with("/transaction/1")
39
+ subject.rollback(1)
40
+ end
41
+
42
+ end
43
+ end
44
+ 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.10
4
+ version: 1.0.11
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-05-13 00:00:00.000000000 Z
12
+ date: 2013-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -222,6 +222,7 @@ files:
222
222
  - lib/neography/rest/indexes.rb
223
223
  - lib/neography/rest/node_auto_indexes.rb
224
224
  - lib/neography/rest/node_indexes.rb
225
+ - lib/neography/rest/node_labels.rb
225
226
  - lib/neography/rest/node_paths.rb
226
227
  - lib/neography/rest/node_properties.rb
227
228
  - lib/neography/rest/node_relationships.rb
@@ -233,7 +234,10 @@ files:
233
234
  - lib/neography/rest/relationship_auto_indexes.rb
234
235
  - lib/neography/rest/relationship_indexes.rb
235
236
  - lib/neography/rest/relationship_properties.rb
237
+ - lib/neography/rest/relationship_types.rb
236
238
  - lib/neography/rest/relationships.rb
239
+ - lib/neography/rest/schema_indexes.rb
240
+ - lib/neography/rest/transactions.rb
237
241
  - lib/neography/tasks.rb
238
242
  - lib/neography/version.rb
239
243
  - neography.gemspec
@@ -253,11 +257,15 @@ files:
253
257
  - spec/integration/rest_gremlin_fail_spec.rb
254
258
  - spec/integration/rest_header_spec.rb
255
259
  - spec/integration/rest_index_spec.rb
260
+ - spec/integration/rest_labels_spec.rb
256
261
  - spec/integration/rest_node_spec.rb
257
262
  - spec/integration/rest_other_node_relationship_spec.rb
258
263
  - spec/integration/rest_path_spec.rb
259
264
  - spec/integration/rest_plugin_spec.rb
260
265
  - spec/integration/rest_relationship_spec.rb
266
+ - spec/integration/rest_relationship_types_spec.rb
267
+ - spec/integration/rest_schema_index_spec.rb
268
+ - spec/integration/rest_transaction_spec.rb
261
269
  - spec/integration/rest_traverse_spec.rb
262
270
  - spec/matchers.rb
263
271
  - spec/neography_spec.rb
@@ -272,6 +280,7 @@ files:
272
280
  - spec/unit/rest/cypher_spec.rb
273
281
  - spec/unit/rest/extensions_spec.rb
274
282
  - spec/unit/rest/gremlin_spec.rb
283
+ - spec/unit/rest/labels_spec.rb
275
284
  - spec/unit/rest/node_auto_indexes_spec.rb
276
285
  - spec/unit/rest/node_indexes_spec.rb
277
286
  - spec/unit/rest/node_paths_spec.rb
@@ -283,7 +292,10 @@ files:
283
292
  - spec/unit/rest/relationship_auto_indexes_spec.rb
284
293
  - spec/unit/rest/relationship_indexes_spec.rb
285
294
  - spec/unit/rest/relationship_properties_spec.rb
295
+ - spec/unit/rest/relationship_types_spec.rb
286
296
  - spec/unit/rest/relationships_spec.rb
297
+ - spec/unit/rest/schema_index_spec.rb
298
+ - spec/unit/rest/transactions_spec.rb
287
299
  homepage: http://rubygems.org/gems/neography
288
300
  licenses: []
289
301
  post_install_message:
@@ -325,11 +337,15 @@ test_files:
325
337
  - spec/integration/rest_gremlin_fail_spec.rb
326
338
  - spec/integration/rest_header_spec.rb
327
339
  - spec/integration/rest_index_spec.rb
340
+ - spec/integration/rest_labels_spec.rb
328
341
  - spec/integration/rest_node_spec.rb
329
342
  - spec/integration/rest_other_node_relationship_spec.rb
330
343
  - spec/integration/rest_path_spec.rb
331
344
  - spec/integration/rest_plugin_spec.rb
332
345
  - spec/integration/rest_relationship_spec.rb
346
+ - spec/integration/rest_relationship_types_spec.rb
347
+ - spec/integration/rest_schema_index_spec.rb
348
+ - spec/integration/rest_transaction_spec.rb
333
349
  - spec/integration/rest_traverse_spec.rb
334
350
  - spec/matchers.rb
335
351
  - spec/neography_spec.rb
@@ -344,6 +360,7 @@ test_files:
344
360
  - spec/unit/rest/cypher_spec.rb
345
361
  - spec/unit/rest/extensions_spec.rb
346
362
  - spec/unit/rest/gremlin_spec.rb
363
+ - spec/unit/rest/labels_spec.rb
347
364
  - spec/unit/rest/node_auto_indexes_spec.rb
348
365
  - spec/unit/rest/node_indexes_spec.rb
349
366
  - spec/unit/rest/node_paths_spec.rb
@@ -355,4 +372,7 @@ test_files:
355
372
  - spec/unit/rest/relationship_auto_indexes_spec.rb
356
373
  - spec/unit/rest/relationship_indexes_spec.rb
357
374
  - spec/unit/rest/relationship_properties_spec.rb
375
+ - spec/unit/rest/relationship_types_spec.rb
358
376
  - spec/unit/rest/relationships_spec.rb
377
+ - spec/unit/rest/schema_index_spec.rb
378
+ - spec/unit/rest/transactions_spec.rb