red_grape 0.0.10 → 0.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.
- data/bin/redgrape +1 -1
- data/bin/trellis +1 -1
- data/lib/red_grape.rb +1 -1
- data/test/test_on_the_nature_of_pipes.rb +1 -1
- data/test/test_traversal_patterns.rb +7 -7
- metadata +3 -3
data/bin/redgrape
CHANGED
data/bin/trellis
CHANGED
data/lib/red_grape.rb
CHANGED
@@ -65,7 +65,7 @@ class OnTheNatureOfPipesTest < Test::Unit::TestCase
|
|
65
65
|
def test_if_then_else
|
66
66
|
#assert_equal ['vadas', ['ripple', 'lop']],
|
67
67
|
assert_equal ['vadas', 'ripple', 'lop'],
|
68
|
-
@graph.v(1).out('knows').if_then_else(
|
68
|
+
@graph.v(1).out('knows').if_then_else(_{it.age < 30}, _{it.name}, _{it.out('created').name}).take.to_a
|
69
69
|
end
|
70
70
|
|
71
71
|
def test_back
|
@@ -53,7 +53,7 @@ class TraversalPatternsTest < Test::Unit::TestCase
|
|
53
53
|
|
54
54
|
assert_equal(
|
55
55
|
[["marko", 0.5, "vadas"], ["marko", 1.0, "josh"], ["marko", 0.4, "lop"]].to_s,
|
56
|
-
v1.outE.inV.path(
|
56
|
+
v1.outE.inV.path(_{it.name}, _{it.weight}, _{it.name}).take.to_s
|
57
57
|
)
|
58
58
|
end
|
59
59
|
|
@@ -88,22 +88,22 @@ class TraversalPatternsTest < Test::Unit::TestCase
|
|
88
88
|
|
89
89
|
#assert_equal(
|
90
90
|
# 70307,
|
91
|
-
# v89.out.loop(1,
|
91
|
+
# v89.out.loop(1, _{it.loops < 4}).take.size
|
92
92
|
#) #=> OK
|
93
93
|
|
94
94
|
#assert_equal(
|
95
95
|
# 71972,
|
96
|
-
# v89.out.loop(1,
|
96
|
+
# v89.out.loop(1, _{it.loops < 4}, _{true}).take.size
|
97
97
|
#) #=> 70307
|
98
98
|
|
99
99
|
#assert_equal(
|
100
100
|
# 582,
|
101
|
-
# v89.out.loop(1,
|
101
|
+
# v89.out.loop(1, _{it.loops < 4}, _{it.object.id == '89'}).take.size
|
102
102
|
#) #=> 564
|
103
103
|
end
|
104
104
|
|
105
105
|
# https://github.com/tinkerpop/gremlin/wiki/Split-Merge-Pattern
|
106
|
-
def
|
106
|
+
def test_split_merge_pattern
|
107
107
|
v1 = @g1.vertex 1
|
108
108
|
|
109
109
|
#assert_equal(
|
@@ -122,10 +122,10 @@ class TraversalPatternsTest < Test::Unit::TestCase
|
|
122
122
|
@g2 ||= RedGrape.load_graph 'data/graph-example-2.xml'
|
123
123
|
assert_equal(
|
124
124
|
{'cover'=>313, 'original'=>184},
|
125
|
-
@g2.V.has_not('song_type', nil).group_count(
|
125
|
+
@g2.V.has_not('song_type', nil).group_count(_{it.song_type}).cap.take
|
126
126
|
)
|
127
127
|
|
128
|
-
ret = @g2.V.has_not('song_type', nil).group_by(
|
128
|
+
ret = @g2.V.has_not('song_type', nil).group_by(_{it.song_type}, _{it}).cap.take
|
129
129
|
assert_equal 2, ret.keys.size
|
130
130
|
assert_equal 313, ret.values[0].size
|
131
131
|
assert ret.values[0].all?{|e| e.is_a? RedGrape::Vertex}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red_grape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-06-18 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70365490452460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70365490452460
|
25
25
|
description: RedGrape is an in-memory graph database written in ruby. I made this
|
26
26
|
in order to learn how graph databases work so that please do not use this for any
|
27
27
|
serious purpose.
|