pacer 0.9.1.1-java → 1.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/.autotest +4 -1
  2. data/.gitignore +4 -0
  3. data/.rspec +1 -1
  4. data/Gemfile-dev +33 -0
  5. data/Gemfile-release +4 -0
  6. data/README.md +27 -9
  7. data/Rakefile +26 -8
  8. data/bin/autotest +1 -1
  9. data/lib/pacer/blueprints/multi_graph.rb +7 -19
  10. data/lib/pacer/blueprints/ruby_graph.rb +77 -52
  11. data/lib/pacer/blueprints/tg.rb +6 -93
  12. data/lib/pacer/blueprints.rb +0 -1
  13. data/lib/pacer/core/graph/edges_route.rb +10 -12
  14. data/lib/pacer/core/graph/element_route.rb +14 -21
  15. data/lib/pacer/core/graph/graph_index_route.rb +12 -8
  16. data/lib/pacer/core/graph/graph_route.rb +2 -5
  17. data/lib/pacer/core/graph/mixed_route.rb +3 -5
  18. data/lib/pacer/core/graph/vertices_route.rb +26 -27
  19. data/lib/pacer/core/route.rb +35 -66
  20. data/lib/pacer/exceptions.rb +13 -6
  21. data/lib/pacer/extensions/block_filter_element.rb +0 -5
  22. data/lib/pacer/filter/collection_filter.rb +9 -2
  23. data/lib/pacer/filter/empty_filter.rb +12 -3
  24. data/lib/pacer/filter/future_filter.rb +5 -5
  25. data/lib/pacer/filter/loop_filter.rb +7 -13
  26. data/lib/pacer/filter/object_filter.rb +10 -16
  27. data/lib/pacer/filter/property_filter/filters.rb +134 -93
  28. data/lib/pacer/filter/property_filter.rb +22 -19
  29. data/lib/pacer/filter/where_filter/node_visitor.rb +47 -26
  30. data/lib/pacer/filter/where_filter.rb +24 -3
  31. data/lib/pacer/function_resolver.rb +7 -2
  32. data/lib/pacer/graph/graph_ml.rb +39 -0
  33. data/lib/pacer/graph/graph_transactions_mixin.rb +107 -175
  34. data/lib/pacer/graph/pacer_graph.rb +438 -0
  35. data/lib/pacer/graph/simple_encoder.rb +20 -0
  36. data/lib/pacer/graph/yaml_encoder.rb +81 -0
  37. data/lib/pacer/graph.rb +8 -10
  38. data/lib/pacer/pipe/blackbox_pipeline.rb +11 -4
  39. data/lib/pacer/pipe/block_filter_pipe.rb +5 -22
  40. data/lib/pacer/pipe/cross_product_transform_pipe.rb +5 -7
  41. data/lib/pacer/pipe/edges_pipe.rb +22 -0
  42. data/lib/pacer/pipe/enumerable_pipe.rb +3 -9
  43. data/lib/pacer/pipe/expandable_pipe.rb +2 -14
  44. data/lib/pacer/pipe/id_collection_filter_pipe.rb +2 -8
  45. data/lib/pacer/pipe/is_empty_pipe.rb +5 -12
  46. data/lib/pacer/pipe/is_unique_pipe.rb +3 -13
  47. data/lib/pacer/pipe/label_collection_filter_pipe.rb +1 -7
  48. data/lib/pacer/pipe/label_prefix_pipe.rb +0 -6
  49. data/lib/pacer/pipe/loop_pipe.rb +27 -25
  50. data/lib/pacer/pipe/never_pipe.rb +1 -1
  51. data/lib/pacer/pipe/path_wrapping_pipe.rb +40 -0
  52. data/lib/pacer/pipe/process_pipe.rb +2 -20
  53. data/lib/pacer/pipe/property_comparison_pipe.rb +0 -6
  54. data/lib/pacer/pipe/ruby_pipe.rb +10 -3
  55. data/lib/pacer/pipe/simple_visitor_pipe.rb +12 -11
  56. data/lib/pacer/pipe/stream_sort_pipe.rb +1 -7
  57. data/lib/pacer/pipe/stream_uniq_pipe.rb +0 -6
  58. data/lib/pacer/pipe/type_filter_pipe.rb +1 -7
  59. data/lib/pacer/pipe/unary_transform_pipe.rb +6 -8
  60. data/lib/pacer/pipe/unwrapping_pipe.rb +13 -0
  61. data/lib/pacer/pipe/vertices_pipe.rb +22 -0
  62. data/lib/pacer/pipe/visitor_pipe.rb +3 -7
  63. data/lib/pacer/pipe/wrapping_pipe.rb +37 -0
  64. data/lib/pacer/pipes.rb +17 -12
  65. data/lib/pacer/route/mixin/bulk_operations.rb +8 -9
  66. data/lib/pacer/route/mixin/route_operations.rb +17 -11
  67. data/lib/pacer/route/mixins.rb +0 -1
  68. data/lib/pacer/route.rb +198 -121
  69. data/lib/pacer/side_effect/aggregate.rb +22 -2
  70. data/lib/pacer/side_effect/as.rb +73 -0
  71. data/lib/pacer/side_effect/group_count.rb +0 -3
  72. data/lib/pacer/side_effect/is_unique.rb +7 -6
  73. data/lib/pacer/side_effect.rb +1 -1
  74. data/lib/pacer/support/enumerable.rb +14 -12
  75. data/lib/pacer/support/nil_class.rb +5 -0
  76. data/lib/pacer/support/proc.rb +2 -2
  77. data/lib/pacer/support.rb +1 -1
  78. data/lib/pacer/transform/cap.rb +1 -1
  79. data/lib/pacer/transform/has_count_cap.rb +1 -1
  80. data/lib/pacer/transform/join.rb +20 -16
  81. data/lib/pacer/transform/map.rb +6 -2
  82. data/lib/pacer/transform/path.rb +44 -20
  83. data/lib/pacer/transform/sort_section.rb +58 -51
  84. data/lib/pacer/utils/tsort.rb +7 -2
  85. data/lib/pacer/utils.rb +0 -1
  86. data/lib/pacer/version.rb +4 -3
  87. data/lib/pacer/visitors/section.rb +42 -0
  88. data/lib/pacer/visitors/visits_section.rb +32 -0
  89. data/lib/pacer/visitors.rb +7 -0
  90. data/lib/pacer/wrappers/edge_wrapper.rb +164 -11
  91. data/lib/pacer/wrappers/element_wrapper.rb +133 -8
  92. data/lib/pacer/wrappers/index_wrapper.rb +47 -0
  93. data/lib/pacer/wrappers/vertex_wrapper.rb +175 -12
  94. data/lib/pacer/wrappers/wrapper_selector.rb +40 -0
  95. data/lib/pacer/wrappers/wrapping_pipe_function.rb +90 -0
  96. data/lib/pacer/wrappers.rb +3 -1
  97. data/lib/pacer-1.0.0-standalone.jar +0 -0
  98. data/lib/pacer.rb +13 -47
  99. data/pacer.gemspec +0 -8
  100. data/pom.xml +10 -3
  101. data/spec/pacer/blueprints/dex_spec.rb +12 -26
  102. data/spec/pacer/blueprints/neo4j_spec.rb +14 -28
  103. data/spec/pacer/blueprints/tg_spec.rb +6 -54
  104. data/spec/pacer/core/graph/edges_route_spec.rb +1 -1
  105. data/spec/pacer/core/graph/element_route_spec.rb +2 -2
  106. data/spec/pacer/core/graph/graph_route_spec.rb +2 -2
  107. data/spec/pacer/core/graph/vertices_route_spec.rb +10 -3
  108. data/spec/pacer/core/route_spec.rb +35 -58
  109. data/spec/pacer/filter/empty_filter_spec.rb +5 -6
  110. data/spec/pacer/filter/future_filter_spec.rb +8 -8
  111. data/spec/pacer/filter/loop_filter_spec.rb +120 -6
  112. data/spec/pacer/filter/object_filter_spec.rb +15 -0
  113. data/spec/pacer/filter/property_filter/filters_spec.rb +169 -0
  114. data/spec/pacer/filter/property_filter_spec.rb +15 -12
  115. data/spec/pacer/filter/uniq_filter_spec.rb +1 -1
  116. data/spec/pacer/filter/where_filter_spec.rb +55 -7
  117. data/spec/pacer/graph/{graph_mixin_spec.rb → pacer_graph_spec.rb} +114 -185
  118. data/spec/pacer/route/mixin/base_spec.rb +36 -35
  119. data/spec/pacer/route/mixin/route_operations_spec.rb +4 -46
  120. data/spec/pacer/side_effect/as_spec.rb +34 -0
  121. data/spec/pacer/support/enumerable_spec.rb +6 -6
  122. data/spec/pacer/transform/join_spec.rb +7 -5
  123. data/spec/pacer/transform/map_spec.rb +55 -0
  124. data/spec/pacer/transform/path_spec.rb +30 -15
  125. data/spec/pacer/transform/process_spec.rb +42 -0
  126. data/spec/pacer/transform/sort_section_spec.rb +82 -0
  127. data/spec/pacer/wrapper/edge_wrapper_spec.rb +122 -2
  128. data/spec/pacer/wrapper/element_wrapper_spec.rb +289 -3
  129. data/spec/pacer/wrapper/vertex_wrapper_spec.rb +289 -2
  130. data/spec/spec_helper.rb +16 -7
  131. data/spec/support/graph_runner.rb +80 -29
  132. data/tags +1165 -0
  133. metadata +46 -107
  134. data/.rvmrc +0 -0
  135. data/lib/pacer/blueprints/extensions.rb +0 -77
  136. data/lib/pacer/graph/edge_mixin.rb +0 -127
  137. data/lib/pacer/graph/element_mixin.rb +0 -202
  138. data/lib/pacer/graph/graph_indices_mixin.rb +0 -93
  139. data/lib/pacer/graph/graph_mixin.rb +0 -361
  140. data/lib/pacer/graph/index_mixin.rb +0 -30
  141. data/lib/pacer/graph/vertex_mixin.rb +0 -119
  142. data/lib/pacer/pipe/map_pipe.rb +0 -36
  143. data/lib/pacer/pipe/variable_store_iterator_wrapper.rb +0 -26
  144. data/lib/pacer/route/mixin/variable_route_module.rb +0 -26
  145. data/lib/pacer/side_effect/section.rb +0 -25
  146. data/lib/pacer/support/iterator_mixins.rb +0 -110
  147. data/lib/pacer/wrappers/new_element.rb +0 -106
  148. data/lib/pacer-0.9.1.1-standalone.jar +0 -0
  149. data/spec/pacer/graph/edge_mixin_spec.rb +0 -116
  150. data/spec/pacer/graph/element_mixin_spec.rb +0 -297
  151. data/spec/pacer/graph/index_mixin_spec.rb +0 -0
  152. data/spec/pacer/graph/vertex_mixin_spec.rb +0 -192
metadata CHANGED
@@ -1,104 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pacer
3
3
  version: !ruby/object:Gem::Version
4
+ version: 1.0.0
4
5
  prerelease:
5
- version: 0.9.1.1
6
6
  platform: java
7
7
  authors:
8
8
  - Darrick Wiebe
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-15 00:00:00.000000000Z
12
+ date: 2012-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fastercsv
16
- version_requirements: &2056 !ruby/object:Gem::Requirement
16
+ version_requirements: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.5.4
21
21
  none: false
22
- requirement: *2056
23
- prerelease: false
24
- type: :runtime
25
- - !ruby/object:Gem::Dependency
26
- name: rspec
27
- version_requirements: &2074 !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ~>
30
- - !ruby/object:Gem::Version
31
- version: 2.7.0
32
- none: false
33
- requirement: *2074
34
- prerelease: false
35
- type: :development
36
- - !ruby/object:Gem::Dependency
37
- name: rr
38
- version_requirements: &2092 !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ~>
41
- - !ruby/object:Gem::Version
42
- version: '1.0'
43
- none: false
44
- requirement: *2092
45
- prerelease: false
46
- type: :development
47
- - !ruby/object:Gem::Dependency
48
- name: rcov
49
- version_requirements: &2108 !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- none: false
55
- requirement: *2108
56
- prerelease: false
57
- type: :development
58
- - !ruby/object:Gem::Dependency
59
- name: yard
60
- version_requirements: &2124 !ruby/object:Gem::Requirement
22
+ requirement: !ruby/object:Gem::Requirement
61
23
  requirements:
62
24
  - - ! '>='
63
25
  - !ruby/object:Gem::Version
64
- version: '0'
65
- none: false
66
- requirement: *2124
67
- prerelease: false
68
- type: :development
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- version_requirements: &2140 !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ! '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- none: false
77
- requirement: *2140
78
- prerelease: false
79
- type: :development
80
- - !ruby/object:Gem::Dependency
81
- name: pacer-neo4j
82
- version_requirements: &2156 !ruby/object:Gem::Requirement
83
- requirements:
84
- - - =
85
- - !ruby/object:Gem::Version
86
- version: 1.0.7.1
87
- none: false
88
- requirement: *2156
89
- prerelease: false
90
- type: :development
91
- - !ruby/object:Gem::Dependency
92
- name: autotest
93
- version_requirements: &2172 !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ! '>='
96
- - !ruby/object:Gem::Version
97
- version: '0'
26
+ version: 1.5.4
98
27
  none: false
99
- requirement: *2172
100
28
  prerelease: false
101
- type: :development
29
+ type: :runtime
102
30
  description: Pacer defines routes through a graph and then traverses them very quickly.
103
31
  email: darrick@innatesoftware.com
104
32
  executables: []
@@ -109,9 +37,10 @@ files:
109
37
  - .document
110
38
  - .gitignore
111
39
  - .rspec
112
- - .rvmrc
113
40
  - CONTRIBUTORS
114
41
  - Gemfile
42
+ - Gemfile-dev
43
+ - Gemfile-release
115
44
  - LICENSE.txt
116
45
  - README.md
117
46
  - Rakefile
@@ -125,7 +54,6 @@ files:
125
54
  - bin/yardoc
126
55
  - lib/pacer.rb
127
56
  - lib/pacer/blueprints.rb
128
- - lib/pacer/blueprints/extensions.rb
129
57
  - lib/pacer/blueprints/multi_graph.rb
130
58
  - lib/pacer/blueprints/ruby_graph.rb
131
59
  - lib/pacer/blueprints/tg.rb
@@ -160,17 +88,16 @@ files:
160
88
  - lib/pacer/filter/where_filter/node_visitor.rb
161
89
  - lib/pacer/function_resolver.rb
162
90
  - lib/pacer/graph.rb
163
- - lib/pacer/graph/edge_mixin.rb
164
- - lib/pacer/graph/element_mixin.rb
165
- - lib/pacer/graph/graph_indices_mixin.rb
166
- - lib/pacer/graph/graph_mixin.rb
91
+ - lib/pacer/graph/graph_ml.rb
167
92
  - lib/pacer/graph/graph_transactions_mixin.rb
168
- - lib/pacer/graph/index_mixin.rb
169
- - lib/pacer/graph/vertex_mixin.rb
93
+ - lib/pacer/graph/pacer_graph.rb
94
+ - lib/pacer/graph/simple_encoder.rb
95
+ - lib/pacer/graph/yaml_encoder.rb
170
96
  - lib/pacer/pipe/blackbox_pipeline.rb
171
97
  - lib/pacer/pipe/block_filter_pipe.rb
172
98
  - lib/pacer/pipe/collection_filter_pipe.rb
173
99
  - lib/pacer/pipe/cross_product_transform_pipe.rb
100
+ - lib/pacer/pipe/edges_pipe.rb
174
101
  - lib/pacer/pipe/enumerable_pipe.rb
175
102
  - lib/pacer/pipe/expandable_pipe.rb
176
103
  - lib/pacer/pipe/id_collection_filter_pipe.rb
@@ -179,8 +106,8 @@ files:
179
106
  - lib/pacer/pipe/label_collection_filter_pipe.rb
180
107
  - lib/pacer/pipe/label_prefix_pipe.rb
181
108
  - lib/pacer/pipe/loop_pipe.rb
182
- - lib/pacer/pipe/map_pipe.rb
183
109
  - lib/pacer/pipe/never_pipe.rb
110
+ - lib/pacer/pipe/path_wrapping_pipe.rb
184
111
  - lib/pacer/pipe/process_pipe.rb
185
112
  - lib/pacer/pipe/property_comparison_pipe.rb
186
113
  - lib/pacer/pipe/ruby_pipe.rb
@@ -189,28 +116,29 @@ files:
189
116
  - lib/pacer/pipe/stream_uniq_pipe.rb
190
117
  - lib/pacer/pipe/type_filter_pipe.rb
191
118
  - lib/pacer/pipe/unary_transform_pipe.rb
192
- - lib/pacer/pipe/variable_store_iterator_wrapper.rb
119
+ - lib/pacer/pipe/unwrapping_pipe.rb
120
+ - lib/pacer/pipe/vertices_pipe.rb
193
121
  - lib/pacer/pipe/visitor_pipe.rb
122
+ - lib/pacer/pipe/wrapping_pipe.rb
194
123
  - lib/pacer/pipes.rb
195
124
  - lib/pacer/route.rb
196
125
  - lib/pacer/route/mixin/bulk_operations.rb
197
126
  - lib/pacer/route/mixin/route_operations.rb
198
- - lib/pacer/route/mixin/variable_route_module.rb
199
127
  - lib/pacer/route/mixins.rb
200
128
  - lib/pacer/routes.rb
201
129
  - lib/pacer/side_effect.rb
202
130
  - lib/pacer/side_effect/aggregate.rb
131
+ - lib/pacer/side_effect/as.rb
203
132
  - lib/pacer/side_effect/counted.rb
204
133
  - lib/pacer/side_effect/group_count.rb
205
134
  - lib/pacer/side_effect/is_unique.rb
206
- - lib/pacer/side_effect/section.rb
207
135
  - lib/pacer/side_effect/visitor.rb
208
136
  - lib/pacer/support.rb
209
137
  - lib/pacer/support/array_list.rb
210
138
  - lib/pacer/support/enumerable.rb
211
139
  - lib/pacer/support/hash.rb
212
- - lib/pacer/support/iterator_mixins.rb
213
140
  - lib/pacer/support/native_exception.rb
141
+ - lib/pacer/support/nil_class.rb
214
142
  - lib/pacer/support/proc.rb
215
143
  - lib/pacer/transform.rb
216
144
  - lib/pacer/transform/cap.rb
@@ -230,11 +158,16 @@ files:
230
158
  - lib/pacer/utils/tsort.rb
231
159
  - lib/pacer/utils/y_files.rb
232
160
  - lib/pacer/version.rb
161
+ - lib/pacer/visitors.rb
162
+ - lib/pacer/visitors/section.rb
163
+ - lib/pacer/visitors/visits_section.rb
233
164
  - lib/pacer/wrappers.rb
234
165
  - lib/pacer/wrappers/edge_wrapper.rb
235
166
  - lib/pacer/wrappers/element_wrapper.rb
236
- - lib/pacer/wrappers/new_element.rb
167
+ - lib/pacer/wrappers/index_wrapper.rb
237
168
  - lib/pacer/wrappers/vertex_wrapper.rb
169
+ - lib/pacer/wrappers/wrapper_selector.rb
170
+ - lib/pacer/wrappers/wrapping_pipe_function.rb
238
171
  - pacer.gemspec
239
172
  - pom.xml
240
173
  - pom/standalone.xml
@@ -255,15 +188,13 @@ files:
255
188
  - spec/pacer/filter/empty_filter_spec.rb
256
189
  - spec/pacer/filter/future_filter_spec.rb
257
190
  - spec/pacer/filter/loop_filter_spec.rb
191
+ - spec/pacer/filter/object_filter_spec.rb
192
+ - spec/pacer/filter/property_filter/filters_spec.rb
258
193
  - spec/pacer/filter/property_filter_spec.rb
259
194
  - spec/pacer/filter/random_filter_spec.rb
260
195
  - spec/pacer/filter/uniq_filter_spec.rb
261
196
  - spec/pacer/filter/where_filter_spec.rb
262
- - spec/pacer/graph/edge_mixin_spec.rb
263
- - spec/pacer/graph/element_mixin_spec.rb
264
- - spec/pacer/graph/graph_mixin_spec.rb
265
- - spec/pacer/graph/index_mixin_spec.rb
266
- - spec/pacer/graph/vertex_mixin_spec.rb
197
+ - spec/pacer/graph/pacer_graph_spec.rb
267
198
  - spec/pacer/pipe/block_filter_pipe_spec.rb
268
199
  - spec/pacer/pipe/labels_filter_pipe_spec.rb
269
200
  - spec/pacer/pipe/ruby_pipe_spec.rb
@@ -271,10 +202,14 @@ files:
271
202
  - spec/pacer/route/mixin/base_spec.rb
272
203
  - spec/pacer/route/mixin/bulk_operations_spec.rb
273
204
  - spec/pacer/route/mixin/route_operations_spec.rb
205
+ - spec/pacer/side_effect/as_spec.rb
274
206
  - spec/pacer/support/array_list_spec.rb
275
207
  - spec/pacer/support/enumerable_spec.rb
276
208
  - spec/pacer/transform/join_spec.rb
209
+ - spec/pacer/transform/map_spec.rb
277
210
  - spec/pacer/transform/path_spec.rb
211
+ - spec/pacer/transform/process_spec.rb
212
+ - spec/pacer/transform/sort_section_spec.rb
278
213
  - spec/pacer/utils/tsort_spec.rb
279
214
  - spec/pacer/wrapper/edge_wrapper_spec.rb
280
215
  - spec/pacer/wrapper/element_wrapper_spec.rb
@@ -287,7 +222,8 @@ files:
287
222
  - spec/support/use_transactions.rb
288
223
  - spec/tackle/simple_mixin.rb
289
224
  - spec/tackle/tinkerpop_graph_mixins.rb
290
- - lib/pacer-0.9.1.1-standalone.jar
225
+ - tags
226
+ - lib/pacer-1.0.0-standalone.jar
291
227
  homepage: http://github.com/pangloss/pacer
292
228
  licenses:
293
229
  - MIT
@@ -299,17 +235,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
299
235
  requirements:
300
236
  - - ! '>='
301
237
  - !ruby/object:Gem::Version
302
- version: '0'
238
+ version: !binary |-
239
+ MA==
303
240
  none: false
304
241
  required_rubygems_version: !ruby/object:Gem::Requirement
305
242
  requirements:
306
243
  - - ! '>='
307
244
  - !ruby/object:Gem::Version
308
- version: '0'
245
+ version: !binary |-
246
+ MA==
309
247
  none: false
310
248
  requirements: []
311
249
  rubyforge_project:
312
- rubygems_version: 1.8.15
250
+ rubygems_version: 1.8.24
313
251
  signing_key:
314
252
  specification_version: 3
315
253
  summary: A very efficient and easy to use graph traversal engine.
@@ -328,15 +266,13 @@ test_files:
328
266
  - spec/pacer/filter/empty_filter_spec.rb
329
267
  - spec/pacer/filter/future_filter_spec.rb
330
268
  - spec/pacer/filter/loop_filter_spec.rb
269
+ - spec/pacer/filter/object_filter_spec.rb
270
+ - spec/pacer/filter/property_filter/filters_spec.rb
331
271
  - spec/pacer/filter/property_filter_spec.rb
332
272
  - spec/pacer/filter/random_filter_spec.rb
333
273
  - spec/pacer/filter/uniq_filter_spec.rb
334
274
  - spec/pacer/filter/where_filter_spec.rb
335
- - spec/pacer/graph/edge_mixin_spec.rb
336
- - spec/pacer/graph/element_mixin_spec.rb
337
- - spec/pacer/graph/graph_mixin_spec.rb
338
- - spec/pacer/graph/index_mixin_spec.rb
339
- - spec/pacer/graph/vertex_mixin_spec.rb
275
+ - spec/pacer/graph/pacer_graph_spec.rb
340
276
  - spec/pacer/pipe/block_filter_pipe_spec.rb
341
277
  - spec/pacer/pipe/labels_filter_pipe_spec.rb
342
278
  - spec/pacer/pipe/ruby_pipe_spec.rb
@@ -344,10 +280,14 @@ test_files:
344
280
  - spec/pacer/route/mixin/base_spec.rb
345
281
  - spec/pacer/route/mixin/bulk_operations_spec.rb
346
282
  - spec/pacer/route/mixin/route_operations_spec.rb
283
+ - spec/pacer/side_effect/as_spec.rb
347
284
  - spec/pacer/support/array_list_spec.rb
348
285
  - spec/pacer/support/enumerable_spec.rb
349
286
  - spec/pacer/transform/join_spec.rb
287
+ - spec/pacer/transform/map_spec.rb
350
288
  - spec/pacer/transform/path_spec.rb
289
+ - spec/pacer/transform/process_spec.rb
290
+ - spec/pacer/transform/sort_section_spec.rb
351
291
  - spec/pacer/utils/tsort_spec.rb
352
292
  - spec/pacer/wrapper/edge_wrapper_spec.rb
353
293
  - spec/pacer/wrapper/element_wrapper_spec.rb
@@ -361,4 +301,3 @@ test_files:
361
301
  - spec/tackle/simple_mixin.rb
362
302
  - spec/tackle/tinkerpop_graph_mixins.rb
363
303
  has_rdoc:
364
- ...
data/.rvmrc DELETED
File without changes
@@ -1,77 +0,0 @@
1
- module Pacer
2
- # NOTE these extensions modules can only be included in classes that don't include the
3
- # default Java method aliases generated when importing Java classes into JRuby. In those
4
- # classes the methods must be copied and pasted in order to overwrite the aliased methods.
5
- module GraphExtensions
6
- def self.included(target)
7
- target.class_eval do
8
- include GraphMixin
9
- include GraphIndicesMixin if target.ancestors.include? com.tinkerpop.blueprints.pgm.IndexableGraph
10
- include GraphTransactionsStub
11
- include ManagedTransactionsMixin
12
- include Pacer::Core::Route
13
- include Pacer::Core::Graph::GraphRoute
14
- include Pacer::Core::Graph::GraphIndexRoute if target.ancestors.include? com.tinkerpop.blueprints.pgm.IndexableGraph
15
- end
16
- end
17
-
18
- # Override to return an enumeration-friendly array of vertices.
19
- def get_vertices
20
- getVertices.iterator.to_route(:graph => self, :element_type => :vertex)
21
- end
22
-
23
- # Override to return an enumeration-friendly array of edges.
24
- def get_edges
25
- getEdges.iterator.to_route(:graph => self, :element_type => :edge)
26
- end
27
-
28
- def ==(other)
29
- other.class == self.class and other.object_id == self.object_id
30
- end
31
-
32
- end
33
-
34
- module VertexExtensions
35
- def self.included(target)
36
- target.class_eval do
37
- include Pacer::Core::Graph::VerticesRoute
38
- include ElementMixin
39
- include VertexMixin
40
- end
41
- end
42
- end
43
-
44
- module EdgeExtensions
45
- def self.included(target)
46
- target.class_eval do
47
- include Pacer::Core::Graph::EdgesRoute
48
- include ElementMixin
49
- include EdgeMixin
50
- end
51
- end
52
-
53
- def in_vertex(extensions = nil)
54
- v = inVertex
55
- v.graph = graph
56
- if extensions.is_a? Enumerable
57
- v.add_extensions extensions
58
- elsif extensions
59
- v.add_extensions [extensions]
60
- else
61
- v
62
- end
63
- end
64
-
65
- def out_vertex(extensions = nil)
66
- v = outVertex
67
- v.graph = graph
68
- if extensions.is_a? Enumerable
69
- v.add_extensions extensions
70
- elsif extensions
71
- v.add_extensions [extensions]
72
- else
73
- v
74
- end
75
- end
76
- end
77
- end
@@ -1,127 +0,0 @@
1
- module Pacer
2
- # This module is mixed into the raw Blueprints Edge class from any
3
- # graph implementation.
4
- #
5
- # Adds more convenient/rubyish methods and adds support for extensions
6
- # to some methods where needed.
7
- module EdgeMixin
8
- # Add extensions to this edge.
9
- #
10
- # If any extension has a Edge module within it, this edge will
11
- # be extended with the extension's Edge module.
12
- #
13
- # @see Core::Route#add_extension
14
- #
15
- # @param [[extensions]] exts the extensions to add
16
- # @return [Pacer::Wrappers::EdgeWrapper] this edge wrapped up and including
17
- # the extensions
18
- def add_extensions(exts)
19
- if exts.any?
20
- Wrappers::EdgeWrapper.wrap(self, exts)
21
- else
22
- self
23
- end
24
- end
25
-
26
- # The incoming vertex for this edge.
27
- # @return [Pacer::VertexMixin]
28
- def in_vertex(extensions = nil)
29
- v = getInVertex
30
- v.graph = graph
31
- if extensions
32
- v.add_extensions extensions
33
- else
34
- v
35
- end
36
- end
37
-
38
- def label
39
- getLabel
40
- end
41
-
42
- # The outgoing vertex for this edge.
43
- # @return [Pacer::VertexMixin]
44
- def out_vertex(extensions = nil)
45
- v = getOutVertex
46
- v.graph = graph
47
- if extensions
48
- v.add_extensions extensions
49
- else
50
- v
51
- end
52
- end
53
-
54
- # Returns a human-readable representation of the edge using the
55
- # standard ruby console representation of an instantiated object.
56
- # @return [String]
57
- def inspect
58
- "#<E[#{element_id}]:#{display_name}>"
59
- end
60
-
61
- # Returns the display name of the edge.
62
- # @return [String]
63
- def display_name
64
- if graph and graph.edge_name
65
- graph.edge_name.call self
66
- else
67
- "#{ out_vertex.element_id }-#{ getLabel }-#{ in_vertex.element_id }"
68
- end
69
- end
70
-
71
- # Deletes the edge from its graph.
72
- def delete!
73
- graph.removeEdge element
74
- end
75
-
76
- # Clones this edge into the target graph.
77
- #
78
- # This differs from the {#copy_into} in that it tries to set
79
- # the new element_id the same as the original element_id.
80
- #
81
- # @param [Pacer::GraphMixin] target_graph
82
- # @param [Hash] opts
83
- # @option opts :create_vertices [true] Create the vertices
84
- # associated to this edge if they don't already exist.
85
- # @yield [e] Optional block yields the edge after it has been created.
86
- # @return [Pacer::EdgeMixin] the new edge
87
- #
88
- # @raise [StandardError] If this the associated vertices don't exist and :create_vertices is not set
89
- def clone_into(target_graph, opts = {})
90
- e_idx = target_graph.index_name("tmp:e:#{graph.to_s}", :edge, :create => true)
91
- e = target_graph.edge(element_id) || e_idx.get('id', element_id).first
92
- unless e
93
- v_idx = target_graph.index_name("tmp:v:#{graph.to_s}", :vertex, :create => true)
94
- iv = target_graph.vertex(in_vertex.element_id) || v_idx.get('id', in_vertex.element_id).first
95
- ov = target_graph.vertex(out_vertex.element_id) || v_idx.get('id', out_vertex.element_id).first
96
- if opts[:create_vertices]
97
- iv ||= in_vertex.clone_into target_graph
98
- ov ||= out_vertex.clone_into target_graph
99
- end
100
- raise 'vertices not found' if not iv or not ov
101
- e = target_graph.create_edge(element_id, iv, ov, label, properties)
102
- e_idx.put('id', element_id, e)
103
- yield e if block_given?
104
- end
105
- e
106
- end
107
-
108
- # Copies this edge into the target graph with the next available
109
- # edge id.
110
- #
111
- # @param [Pacer::GraphMixin] target_graph
112
- # @yield [e] Optional block yields the edge after it has been created.
113
- # @return [Pacer::EdgeMixin] the new edge
114
- #
115
- # @raise [StandardError] If this the associated vertices don't exist
116
- def copy_into(target_graph)
117
- v_idx = target_graph.index_name("tmp:v:#{graph.to_s}", :vertex, :create => true)
118
- iv = v_idx.get('id', in_vertex.element_id).first || target_graph.vertex(in_vertex.element_id)
119
- ov = v_idx.get('id', out_vertex.element_id).first || target_graph.vertex(out_vertex.element_id)
120
-
121
- raise 'vertices not found' if not iv or not ov
122
- e = target_graph.create_edge nil, iv, ov, label, properties
123
- yield e if block_given?
124
- e
125
- end
126
- end
127
- end