pho 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/CHANGES +17 -0
  2. data/Rakefile +10 -2
  3. data/bin/talis_store +37 -92
  4. data/doc/rdoc/classes/Pho.html +11 -0
  5. data/doc/rdoc/classes/Pho/CommandLine.html +508 -0
  6. data/doc/rdoc/classes/Pho/DatatypeProperty.html +15 -15
  7. data/doc/rdoc/classes/Pho/Enrichment.html +1 -1
  8. data/doc/rdoc/classes/Pho/Enrichment/{ResourceEnricher.html → StoreEnricher.html} +158 -58
  9. data/doc/rdoc/classes/Pho/Etags.html +36 -36
  10. data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
  11. data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
  12. data/doc/rdoc/classes/Pho/FieldPredicateMap.html +94 -94
  13. data/doc/rdoc/classes/Pho/FieldWeighting.html +14 -14
  14. data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +126 -91
  15. data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +68 -62
  16. data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +22 -57
  17. data/doc/rdoc/classes/Pho/Job.html +68 -67
  18. data/doc/rdoc/classes/Pho/Jobs.html +62 -62
  19. data/doc/rdoc/classes/Pho/QueryProfile.html +64 -64
  20. data/doc/rdoc/classes/Pho/RDF.html +120 -0
  21. data/doc/rdoc/classes/Pho/RDF/Parser.html +277 -0
  22. data/doc/rdoc/classes/Pho/ResourceHash.html +1 -1
  23. data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +48 -46
  24. data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +15 -14
  25. data/doc/rdoc/classes/Pho/Snapshot.html +36 -36
  26. data/doc/rdoc/classes/Pho/Sparql.html +50 -0
  27. data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +147 -68
  28. data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +195 -114
  29. data/doc/rdoc/classes/Pho/Status.html +26 -26
  30. data/doc/rdoc/classes/Pho/Store.html +271 -264
  31. data/doc/rdoc/classes/Pho/StoreSparqlClient.html +183 -0
  32. data/doc/rdoc/classes/Pho/Update.html +1 -0
  33. data/doc/rdoc/classes/Pho/Update/Changeset.html +69 -68
  34. data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +24 -24
  35. data/doc/rdoc/classes/Pho/Update/Changesets.html +15 -14
  36. data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +18 -18
  37. data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +24 -24
  38. data/doc/rdoc/classes/Pho/Update/Statement.html +28 -27
  39. data/doc/rdoc/classes/String.html +1 -1
  40. data/doc/rdoc/created.rid +1 -1
  41. data/doc/rdoc/files/CHANGES.html +53 -1
  42. data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
  43. data/doc/rdoc/files/lib/pho/command_line_rb.html +101 -0
  44. data/doc/rdoc/files/lib/pho/converter_rb.html +1 -1
  45. data/doc/rdoc/files/lib/pho/enrichment_rb.html +1 -1
  46. data/doc/rdoc/files/lib/pho/file_management_rb.html +1 -1
  47. data/doc/rdoc/files/lib/pho/file_manager_rb.html +1 -1
  48. data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
  49. data/doc/rdoc/files/lib/pho/rdf_rb.html +108 -0
  50. data/doc/rdoc/files/lib/pho/sparql_rb.html +1 -1
  51. data/doc/rdoc/files/lib/pho/store_rb.html +8 -1
  52. data/doc/rdoc/files/lib/pho_rb.html +4 -2
  53. data/doc/rdoc/fr_class_index.html +6 -1
  54. data/doc/rdoc/fr_file_index.html +2 -0
  55. data/doc/rdoc/fr_method_index.html +192 -172
  56. data/examples/calais/bio.txt +7 -0
  57. data/examples/calais/dump.rb +17 -0
  58. data/examples/calais/enlighten.rb +23 -0
  59. data/examples/calais/output.rdf +25 -0
  60. data/examples/sinatra/viewer.rb +20 -0
  61. data/lib/pho.rb +4 -1
  62. data/lib/pho/changeset.rb +17 -1
  63. data/lib/pho/command_line.rb +166 -0
  64. data/lib/pho/converter.rb +8 -3
  65. data/lib/pho/enrichment.rb +93 -28
  66. data/lib/pho/file_management.rb +32 -19
  67. data/lib/pho/file_manager.rb +22 -26
  68. data/lib/pho/rdf.rb +74 -0
  69. data/lib/pho/rdf_collection.rb +2 -17
  70. data/lib/pho/sparql.rb +150 -38
  71. data/lib/pho/store.rb +28 -2
  72. data/tests/tc_contentbox.rb +41 -0
  73. data/tests/tc_enrichment.rb +41 -4
  74. data/tests/tc_file_manager.rb +97 -7
  75. data/tests/tc_rdf_collection.rb +25 -13
  76. data/tests/tc_rdf_parser.rb +37 -0
  77. data/tests/tc_sparql.rb +72 -2
  78. data/tests/tc_sparql_helper.rb +16 -0
  79. data/tests/ts_pho.rb +2 -1
  80. metadata +20 -3
@@ -93,8 +93,8 @@ href="QueryProfile.html">QueryProfile</a>
93
93
  <h3 class="section-bar">Methods</h3>
94
94
 
95
95
  <div class="name-list">
96
- <a href="#M000170">new</a>&nbsp;&nbsp;
97
- <a href="#M000171">to_rdf</a>&nbsp;&nbsp;
96
+ <a href="#M000190">new</a>&nbsp;&nbsp;
97
+ <a href="#M000191">to_rdf</a>&nbsp;&nbsp;
98
98
  </div>
99
99
  </div>
100
100
 
@@ -148,19 +148,19 @@ The weighting applied to the field
148
148
  <div id="methods">
149
149
  <h3 class="section-bar">Public Class methods</h3>
150
150
 
151
- <div id="method-M000170" class="method-detail">
152
- <a name="M000170"></a>
151
+ <div id="method-M000190" class="method-detail">
152
+ <a name="M000190"></a>
153
153
 
154
154
  <div class="method-heading">
155
- <a href="#M000170" class="method-signature">
155
+ <a href="#M000190" class="method-signature">
156
156
  <span class="method-name">new</span><span class="method-args">(uri, name, weight)</span>
157
157
  </a>
158
158
  </div>
159
159
 
160
160
  <div class="method-description">
161
161
  <p><a class="source-toggle" href="#"
162
- onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
163
- <div class="method-source-code" id="M000170-source">
162
+ onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
163
+ <div class="method-source-code" id="M000190-source">
164
164
  <pre>
165
165
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 15</span>
166
166
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">weight</span>)
@@ -175,19 +175,19 @@ The weighting applied to the field
175
175
 
176
176
  <h3 class="section-bar">Public Instance methods</h3>
177
177
 
178
- <div id="method-M000171" class="method-detail">
179
- <a name="M000171"></a>
178
+ <div id="method-M000191" class="method-detail">
179
+ <a name="M000191"></a>
180
180
 
181
181
  <div class="method-heading">
182
- <a href="#M000171" class="method-signature">
182
+ <a href="#M000191" class="method-signature">
183
183
  <span class="method-name">to_rdf</span><span class="method-args">(ns=true)</span>
184
184
  </a>
185
185
  </div>
186
186
 
187
187
  <div class="method-description">
188
188
  <p>
189
- Convert this object into an RDF representation. Generates a simple
190
- rdf:Description, optionally including namespaces
189
+ Convert this object into an <a href="RDF.html">RDF</a> representation.
190
+ Generates a simple rdf:Description, optionally including namespaces
191
191
  </p>
192
192
  <table>
193
193
  <tr><td valign="top">ns:</td><td>include namespace declarations
@@ -195,8 +195,8 @@ rdf:Description, optionally including namespaces
195
195
  </td></tr>
196
196
  </table>
197
197
  <p><a class="source-toggle" href="#"
198
- onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
199
- <div class="method-source-code" id="M000171-source">
198
+ onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
199
+ <div class="method-source-code" id="M000191-source">
200
200
  <pre>
201
201
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 23</span>
202
202
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>(<span class="ruby-identifier">ns</span>=<span class="ruby-keyword kw">true</span>)
@@ -80,7 +80,7 @@
80
80
 
81
81
  <div id="description">
82
82
  <p>
83
- TODO: move files into hidden directory TODO: add directory traversal
83
+ TODO: move files into hidden directory
84
84
  </p>
85
85
 
86
86
  </div>
@@ -92,15 +92,16 @@ TODO: move files into hidden directory TODO: add directory traversal
92
92
  <h3 class="section-bar">Methods</h3>
93
93
 
94
94
  <div class="name-list">
95
- <a href="#M000029">failures</a>&nbsp;&nbsp;
96
- <a href="#M000032">get_fail_file_for</a>&nbsp;&nbsp;
97
- <a href="#M000033">get_ok_file_for</a>&nbsp;&nbsp;
98
- <a href="#M000025">new</a>&nbsp;&nbsp;
99
- <a href="#M000028">reset</a>&nbsp;&nbsp;
100
- <a href="#M000027">retry_failures</a>&nbsp;&nbsp;
101
- <a href="#M000026">store</a>&nbsp;&nbsp;
102
- <a href="#M000030">successes</a>&nbsp;&nbsp;
103
- <a href="#M000031">summary</a>&nbsp;&nbsp;
95
+ <a href="#M000031">failures</a>&nbsp;&nbsp;
96
+ <a href="#M000034">get_fail_file_for</a>&nbsp;&nbsp;
97
+ <a href="#M000035">get_ok_file_for</a>&nbsp;&nbsp;
98
+ <a href="#M000026">new</a>&nbsp;&nbsp;
99
+ <a href="#M000030">new_files</a>&nbsp;&nbsp;
100
+ <a href="#M000029">reset</a>&nbsp;&nbsp;
101
+ <a href="#M000028">retry_failures</a>&nbsp;&nbsp;
102
+ <a href="#M000027">store</a>&nbsp;&nbsp;
103
+ <a href="#M000032">successes</a>&nbsp;&nbsp;
104
+ <a href="#M000033">summary</a>&nbsp;&nbsp;
104
105
  </div>
105
106
  </div>
106
107
 
@@ -158,21 +159,21 @@ TODO: move files into hidden directory TODO: add directory traversal
158
159
  <div id="methods">
159
160
  <h3 class="section-bar">Public Class methods</h3>
160
161
 
161
- <div id="method-M000025" class="method-detail">
162
- <a name="M000025"></a>
162
+ <div id="method-M000026" class="method-detail">
163
+ <a name="M000026"></a>
163
164
 
164
165
  <div class="method-heading">
165
- <a href="#M000025" class="method-signature">
166
+ <a href="#M000026" class="method-signature">
166
167
  <span class="method-name">new</span><span class="method-args">(store, dir, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
167
168
  </a>
168
169
  </div>
169
170
 
170
171
  <div class="method-description">
171
172
  <p><a class="source-toggle" href="#"
172
- onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
173
- <div class="method-source-code" id="M000025-source">
173
+ onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
174
+ <div class="method-source-code" id="M000026-source">
174
175
  <pre>
175
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 15</span>
176
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 14</span>
176
177
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">ok_suffix</span>=<span class="ruby-constant">OK</span>, <span class="ruby-identifier">fail_suffix</span>=<span class="ruby-constant">FAIL</span>, <span class="ruby-identifier">sleep</span>=<span class="ruby-value">1</span>)
177
178
  <span class="ruby-ivar">@store</span> = <span class="ruby-identifier">store</span>
178
179
  <span class="ruby-ivar">@dir</span> = <span class="ruby-identifier">dir</span>
@@ -187,27 +188,27 @@ TODO: move files into hidden directory TODO: add directory traversal
187
188
 
188
189
  <h3 class="section-bar">Public Instance methods</h3>
189
190
 
190
- <div id="method-M000029" class="method-detail">
191
- <a name="M000029"></a>
191
+ <div id="method-M000031" class="method-detail">
192
+ <a name="M000031"></a>
192
193
 
193
194
  <div class="method-heading">
194
- <a href="#M000029" class="method-signature">
195
- <span class="method-name">failures</span><span class="method-args">()</span>
195
+ <a href="#M000031" class="method-signature">
196
+ <span class="method-name">failures</span><span class="method-args">(recursive=false)</span>
196
197
  </a>
197
198
  </div>
198
199
 
199
200
  <div class="method-description">
200
201
  <p>
201
- List <a href="AbstractFileManager.html#M000029">failures</a>
202
+ List <a href="AbstractFileManager.html#M000031">failures</a>
202
203
  </p>
203
204
  <p><a class="source-toggle" href="#"
204
- onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
205
- <div class="method-source-code" id="M000029-source">
205
+ onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
206
+ <div class="method-source-code" id="M000031-source">
206
207
  <pre>
207
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 55</span>
208
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failures</span>()
208
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 68</span>
209
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failures</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
209
210
  <span class="ruby-identifier">fails</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
210
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-value str">&quot;*&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
211
+ <span class="ruby-identifier">list</span>(<span class="ruby-identifier">recursive</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
211
212
  <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span>
212
213
  <span class="ruby-identifier">fails</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>( <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>) )
213
214
  <span class="ruby-keyword kw">end</span>
@@ -219,76 +220,110 @@ List <a href="AbstractFileManager.html#M000029">failures</a>
219
220
  </div>
220
221
  </div>
221
222
 
222
- <div id="method-M000032" class="method-detail">
223
- <a name="M000032"></a>
223
+ <div id="method-M000034" class="method-detail">
224
+ <a name="M000034"></a>
224
225
 
225
226
  <div class="method-heading">
226
- <a href="#M000032" class="method-signature">
227
+ <a href="#M000034" class="method-signature">
227
228
  <span class="method-name">get_fail_file_for</span><span class="method-args">(filename)</span>
228
229
  </a>
229
230
  </div>
230
231
 
231
232
  <div class="method-description">
232
233
  <p><a class="source-toggle" href="#"
233
- onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
234
- <div class="method-source-code" id="M000032-source">
234
+ onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
235
+ <div class="method-source-code" id="M000034-source">
235
236
  <pre>
236
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 87</span>
237
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 100</span>
237
238
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>)
238
239
  <span class="ruby-identifier">ext</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">filename</span>)
239
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{ext}/</span>, <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span>)
240
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{ext}$/</span>, <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span>)
240
241
  <span class="ruby-keyword kw">end</span>
241
242
  </pre>
242
243
  </div>
243
244
  </div>
244
245
  </div>
245
246
 
246
- <div id="method-M000033" class="method-detail">
247
- <a name="M000033"></a>
247
+ <div id="method-M000035" class="method-detail">
248
+ <a name="M000035"></a>
248
249
 
249
250
  <div class="method-heading">
250
- <a href="#M000033" class="method-signature">
251
+ <a href="#M000035" class="method-signature">
251
252
  <span class="method-name">get_ok_file_for</span><span class="method-args">(filename)</span>
252
253
  </a>
253
254
  </div>
254
255
 
255
256
  <div class="method-description">
256
257
  <p><a class="source-toggle" href="#"
257
- onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
258
- <div class="method-source-code" id="M000033-source">
258
+ onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
259
+ <div class="method-source-code" id="M000035-source">
259
260
  <pre>
260
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 92</span>
261
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 105</span>
261
262
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">filename</span>)
262
263
  <span class="ruby-identifier">ext</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">filename</span>)
263
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{ext}/</span>, <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span>)
264
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{ext}$/</span>, <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span>)
264
265
  <span class="ruby-keyword kw">end</span>
265
266
  </pre>
266
267
  </div>
267
268
  </div>
268
269
  </div>
269
270
 
270
- <div id="method-M000028" class="method-detail">
271
- <a name="M000028"></a>
271
+ <div id="method-M000030" class="method-detail">
272
+ <a name="M000030"></a>
272
273
 
273
274
  <div class="method-heading">
274
- <a href="#M000028" class="method-signature">
275
- <span class="method-name">reset</span><span class="method-args">(reset_store=false)</span>
275
+ <a href="#M000030" class="method-signature">
276
+ <span class="method-name">new_files</span><span class="method-args">(recursive=false)</span>
276
277
  </a>
277
278
  </div>
278
279
 
279
280
  <div class="method-description">
280
281
  <p>
281
- Reset the directory to clear out any previous statuses <a
282
- href="../Store.html">Store</a> can also be <a
283
- href="AbstractFileManager.html#M000028">reset</a> at the same time: use
284
- with care!
282
+ List any <a href="AbstractFileManager.html#M000026">new</a> files in the
283
+ directory
285
284
  </p>
286
285
  <p><a class="source-toggle" href="#"
287
- onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
288
- <div class="method-source-code" id="M000028-source">
286
+ onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
287
+ <div class="method-source-code" id="M000030-source">
288
+ <pre>
289
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 53</span>
290
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_files</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
291
+ <span class="ruby-identifier">newfiles</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
292
+ <span class="ruby-identifier">list</span>(<span class="ruby-identifier">recursive</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
293
+
294
+ <span class="ruby-identifier">ok_file</span> = <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>)
295
+ <span class="ruby-identifier">fail_file</span> = <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>)
296
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">ok_file</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">fail_file</span>) )
297
+ <span class="ruby-identifier">newfiles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
298
+ <span class="ruby-keyword kw">end</span>
299
+
300
+ <span class="ruby-keyword kw">end</span>
301
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newfiles</span>
302
+ <span class="ruby-keyword kw">end</span>
303
+ </pre>
304
+ </div>
305
+ </div>
306
+ </div>
307
+
308
+ <div id="method-M000029" class="method-detail">
309
+ <a name="M000029"></a>
310
+
311
+ <div class="method-heading">
312
+ <a href="#M000029" class="method-signature">
313
+ <span class="method-name">reset</span><span class="method-args">()</span>
314
+ </a>
315
+ </div>
316
+
317
+ <div class="method-description">
318
+ <p>
319
+ Reset the directory to clear out any previous statuses
320
+ </p>
321
+ <p><a class="source-toggle" href="#"
322
+ onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
323
+ <div class="method-source-code" id="M000029-source">
289
324
  <pre>
290
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 45</span>
291
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>(<span class="ruby-identifier">reset_store</span>=<span class="ruby-keyword kw">false</span>)
325
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 43</span>
326
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>()
292
327
  <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">&quot;*.#{@fail_suffix}&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
293
328
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
294
329
  <span class="ruby-keyword kw">end</span>
@@ -301,11 +336,11 @@ with care!
301
336
  </div>
302
337
  </div>
303
338
 
304
- <div id="method-M000027" class="method-detail">
305
- <a name="M000027"></a>
339
+ <div id="method-M000028" class="method-detail">
340
+ <a name="M000028"></a>
306
341
 
307
342
  <div class="method-heading">
308
- <a href="#M000027" class="method-signature">
343
+ <a href="#M000028" class="method-signature">
309
344
  <span class="method-name">retry_failures</span><span class="method-args">()</span>
310
345
  </a>
311
346
  </div>
@@ -315,10 +350,10 @@ with care!
315
350
  Retry anything known to have failed
316
351
  </p>
317
352
  <p><a class="source-toggle" href="#"
318
- onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
319
- <div class="method-source-code" id="M000027-source">
353
+ onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
354
+ <div class="method-source-code" id="M000028-source">
320
355
  <pre>
321
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 33</span>
356
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 32</span>
322
357
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retry_failures</span>()
323
358
  <span class="ruby-identifier">retries</span> = <span class="ruby-identifier">failures</span>()
324
359
  <span class="ruby-identifier">retries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
@@ -333,12 +368,12 @@ Retry anything known to have failed
333
368
  </div>
334
369
  </div>
335
370
 
336
- <div id="method-M000026" class="method-detail">
337
- <a name="M000026"></a>
371
+ <div id="method-M000027" class="method-detail">
372
+ <a name="M000027"></a>
338
373
 
339
374
  <div class="method-heading">
340
- <a href="#M000026" class="method-signature">
341
- <span class="method-name">store</span><span class="method-args">()</span>
375
+ <a href="#M000027" class="method-signature">
376
+ <span class="method-name">store</span><span class="method-args">(recursive=false)</span>
342
377
  </a>
343
378
  </div>
344
379
 
@@ -348,43 +383,43 @@ Retry anything known to have failed
348
383
  directory
349
384
  </p>
350
385
  <p><a class="source-toggle" href="#"
351
- onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
352
- <div class="method-source-code" id="M000026-source">
386
+ onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
387
+ <div class="method-source-code" id="M000027-source">
353
388
  <pre>
354
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 24</span>
355
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>()
356
- <span class="ruby-identifier">files_to_store</span> = <span class="ruby-identifier">new_files</span>()
389
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 23</span>
390
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
391
+ <span class="ruby-identifier">files_to_store</span> = <span class="ruby-identifier">new_files</span>(<span class="ruby-identifier">recursive</span>)
357
392
  <span class="ruby-identifier">files_to_store</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
358
393
  <span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
359
394
  <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
360
- <span class="ruby-keyword kw">end</span>
395
+ <span class="ruby-keyword kw">end</span>
361
396
  <span class="ruby-keyword kw">end</span>
362
397
  </pre>
363
398
  </div>
364
399
  </div>
365
400
  </div>
366
401
 
367
- <div id="method-M000030" class="method-detail">
368
- <a name="M000030"></a>
402
+ <div id="method-M000032" class="method-detail">
403
+ <a name="M000032"></a>
369
404
 
370
405
  <div class="method-heading">
371
- <a href="#M000030" class="method-signature">
372
- <span class="method-name">successes</span><span class="method-args">()</span>
406
+ <a href="#M000032" class="method-signature">
407
+ <span class="method-name">successes</span><span class="method-args">(recursive=false)</span>
373
408
  </a>
374
409
  </div>
375
410
 
376
411
  <div class="method-description">
377
412
  <p>
378
- List <a href="AbstractFileManager.html#M000030">successes</a>
413
+ List <a href="AbstractFileManager.html#M000032">successes</a>
379
414
  </p>
380
415
  <p><a class="source-toggle" href="#"
381
- onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
382
- <div class="method-source-code" id="M000030-source">
416
+ onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
417
+ <div class="method-source-code" id="M000032-source">
383
418
  <pre>
384
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 66</span>
385
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successes</span>()
419
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 79</span>
420
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successes</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
386
421
  <span class="ruby-identifier">successes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
387
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-value str">&quot;*&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
422
+ <span class="ruby-identifier">list</span>(<span class="ruby-identifier">recursive</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
388
423
  <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span>
389
424
  <span class="ruby-identifier">successes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>( <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>) )
390
425
  <span class="ruby-keyword kw">end</span>
@@ -396,31 +431,31 @@ List <a href="AbstractFileManager.html#M000030">successes</a>
396
431
  </div>
397
432
  </div>
398
433
 
399
- <div id="method-M000031" class="method-detail">
400
- <a name="M000031"></a>
434
+ <div id="method-M000033" class="method-detail">
435
+ <a name="M000033"></a>
401
436
 
402
437
  <div class="method-heading">
403
- <a href="#M000031" class="method-signature">
404
- <span class="method-name">summary</span><span class="method-args">()</span>
438
+ <a href="#M000033" class="method-signature">
439
+ <span class="method-name">summary</span><span class="method-args">(recursive=false)</span>
405
440
  </a>
406
441
  </div>
407
442
 
408
443
  <div class="method-description">
409
444
  <p>
410
- Summarize the state of the collection to the provied IO object Creates a
445
+ Summarize the state of the collection to the provided IO object Creates a
411
446
  simple report
412
447
  </p>
413
448
  <p><a class="source-toggle" href="#"
414
- onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
415
- <div class="method-source-code" id="M000031-source">
449
+ onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
450
+ <div class="method-source-code" id="M000033-source">
416
451
  <pre>
417
- <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 78</span>
418
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summary</span>()
419
- <span class="ruby-identifier">failures</span> = <span class="ruby-identifier">failures</span>()
420
- <span class="ruby-identifier">successes</span> = <span class="ruby-identifier">successes</span>()
421
- <span class="ruby-identifier">newfiles</span> = <span class="ruby-identifier">new_files</span>()
452
+ <span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 91</span>
453
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summary</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
454
+ <span class="ruby-identifier">failures</span> = <span class="ruby-identifier">failures</span>(<span class="ruby-identifier">recursive</span>)
455
+ <span class="ruby-identifier">successes</span> = <span class="ruby-identifier">successes</span>(<span class="ruby-identifier">recursive</span>)
456
+ <span class="ruby-identifier">newfiles</span> = <span class="ruby-identifier">new_files</span>(<span class="ruby-identifier">recursive</span>)
422
457
  <span class="ruby-identifier">total</span> = <span class="ruby-identifier">failures</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">successes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">newfiles</span>.<span class="ruby-identifier">size</span>
423
- <span class="ruby-identifier">summary</span> = <span class="ruby-node">&quot;#{@dir} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new&quot;</span>
458
+ <span class="ruby-identifier">summary</span> = <span class="ruby-node">&quot;#{@dir} #{recursive ? &quot; and sub-directories&quot; : &quot;&quot;} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new&quot;</span>
424
459
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">summary</span>
425
460
  <span class="ruby-keyword kw">end</span>
426
461
  </pre>