redgraph 0.1.1 → 0.2.1
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 +4 -4
- data/.github/workflows/main.yml +8 -0
- data/CHANGELOG.md +26 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +22 -1
- data/README.md +109 -15
- data/lib/redgraph.rb +16 -0
- data/lib/redgraph/edge.rb +17 -4
- data/lib/redgraph/graph.rb +44 -86
- data/lib/redgraph/graph/edge_methods.rb +105 -0
- data/lib/redgraph/graph/node_methods.rb +123 -0
- data/lib/redgraph/node.rb +11 -3
- data/lib/redgraph/node_model.rb +99 -0
- data/lib/redgraph/node_model/class_methods.rb +83 -0
- data/lib/redgraph/node_model/graph_manipulation.rb +24 -0
- data/lib/redgraph/node_model/persistence.rb +56 -0
- data/lib/redgraph/query_response.rb +91 -5
- data/lib/redgraph/util.rb +21 -0
- data/lib/redgraph/version.rb +1 -1
- data/redgraph.gemspec +2 -1
- data/test/graph_edge_methods_test.rb +100 -0
- data/test/graph_manipulation_test.rb +59 -0
- data/test/graph_node_methods_test.rb +112 -0
- data/test/graph_queries_test.rb +21 -66
- data/test/graph_test.rb +26 -0
- data/test/node_model_class_methods_test.rb +93 -0
- data/test/node_model_labels_test.rb +57 -0
- data/test/node_model_persistence_test.rb +70 -0
- data/test/node_model_test.rb +136 -0
- data/test/test_helper.rb +21 -0
- metadata +30 -3
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
if ENV['COVERAGE']
|
4
|
+
require 'simplecov'
|
5
|
+
|
6
|
+
SimpleCov.start do
|
7
|
+
enable_coverage :branch
|
8
|
+
add_filter %r{^/test/}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
3
12
|
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
4
13
|
require "redgraph"
|
5
14
|
|
@@ -10,3 +19,15 @@ unless $REDIS_URL = ENV['TEST_REDIS_URL']
|
|
10
19
|
puts "To run the tests you need to define the TEST_REDIS_URL environment variable"
|
11
20
|
exit(1)
|
12
21
|
end
|
22
|
+
|
23
|
+
module TestHelpers
|
24
|
+
private
|
25
|
+
|
26
|
+
def quick_add_node(label:, properties:)
|
27
|
+
@graph.add_node(Redgraph::Node.new(label: label, properties: properties))
|
28
|
+
end
|
29
|
+
|
30
|
+
def quick_add_edge(type:, src:, dest:, properties:)
|
31
|
+
@graph.add_edge(Redgraph::Edge.new(type: type, src: src, dest: dest, properties: properties))
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redgraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Zaccagnini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.0.0
|
27
41
|
description:
|
28
42
|
email:
|
29
43
|
- hi@pzac.net
|
@@ -44,14 +58,27 @@ files:
|
|
44
58
|
- lib/redgraph.rb
|
45
59
|
- lib/redgraph/edge.rb
|
46
60
|
- lib/redgraph/graph.rb
|
61
|
+
- lib/redgraph/graph/edge_methods.rb
|
62
|
+
- lib/redgraph/graph/node_methods.rb
|
47
63
|
- lib/redgraph/node.rb
|
64
|
+
- lib/redgraph/node_model.rb
|
65
|
+
- lib/redgraph/node_model/class_methods.rb
|
66
|
+
- lib/redgraph/node_model/graph_manipulation.rb
|
67
|
+
- lib/redgraph/node_model/persistence.rb
|
48
68
|
- lib/redgraph/query_response.rb
|
69
|
+
- lib/redgraph/util.rb
|
49
70
|
- lib/redgraph/version.rb
|
50
71
|
- redgraph.gemspec
|
51
72
|
- test/graph_connection_test.rb
|
73
|
+
- test/graph_edge_methods_test.rb
|
52
74
|
- test/graph_manipulation_test.rb
|
75
|
+
- test/graph_node_methods_test.rb
|
53
76
|
- test/graph_queries_test.rb
|
54
77
|
- test/graph_test.rb
|
78
|
+
- test/node_model_class_methods_test.rb
|
79
|
+
- test/node_model_labels_test.rb
|
80
|
+
- test/node_model_persistence_test.rb
|
81
|
+
- test/node_model_test.rb
|
55
82
|
- test/redgraph_test.rb
|
56
83
|
- test/test_helper.rb
|
57
84
|
homepage: https://github.com/pzac/redgraph
|
@@ -60,7 +87,7 @@ licenses:
|
|
60
87
|
metadata:
|
61
88
|
homepage_uri: https://github.com/pzac/redgraph
|
62
89
|
source_code_uri: https://github.com/pzac/redgraph
|
63
|
-
changelog_uri: https://github.com/pzac/redgraph/CHANGELOG.md
|
90
|
+
changelog_uri: https://github.com/pzac/redgraph/blob/master/CHANGELOG.md
|
64
91
|
post_install_message:
|
65
92
|
rdoc_options: []
|
66
93
|
require_paths:
|