pho 0.5 → 0.6
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/CHANGES +17 -0
- data/Rakefile +10 -2
- data/bin/talis_store +37 -92
- data/doc/rdoc/classes/Pho.html +11 -0
- data/doc/rdoc/classes/Pho/CommandLine.html +508 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +15 -15
- data/doc/rdoc/classes/Pho/Enrichment.html +1 -1
- data/doc/rdoc/classes/Pho/Enrichment/{ResourceEnricher.html → StoreEnricher.html} +158 -58
- data/doc/rdoc/classes/Pho/Etags.html +36 -36
- data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
- data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +94 -94
- data/doc/rdoc/classes/Pho/FieldWeighting.html +14 -14
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +126 -91
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +68 -62
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +22 -57
- data/doc/rdoc/classes/Pho/Job.html +68 -67
- data/doc/rdoc/classes/Pho/Jobs.html +62 -62
- data/doc/rdoc/classes/Pho/QueryProfile.html +64 -64
- data/doc/rdoc/classes/Pho/RDF.html +120 -0
- data/doc/rdoc/classes/Pho/RDF/Parser.html +277 -0
- data/doc/rdoc/classes/Pho/ResourceHash.html +1 -1
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +48 -46
- data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +15 -14
- data/doc/rdoc/classes/Pho/Snapshot.html +36 -36
- data/doc/rdoc/classes/Pho/Sparql.html +50 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +147 -68
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +195 -114
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +271 -264
- data/doc/rdoc/classes/Pho/StoreSparqlClient.html +183 -0
- data/doc/rdoc/classes/Pho/Update.html +1 -0
- data/doc/rdoc/classes/Pho/Update/Changeset.html +69 -68
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +24 -24
- data/doc/rdoc/classes/Pho/Update/Changesets.html +15 -14
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +18 -18
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +24 -24
- data/doc/rdoc/classes/Pho/Update/Statement.html +28 -27
- data/doc/rdoc/classes/String.html +1 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +53 -1
- data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/command_line_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/converter_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/file_management_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/rdf_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/sparql_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/store_rb.html +8 -1
- data/doc/rdoc/files/lib/pho_rb.html +4 -2
- data/doc/rdoc/fr_class_index.html +6 -1
- data/doc/rdoc/fr_file_index.html +2 -0
- data/doc/rdoc/fr_method_index.html +192 -172
- data/examples/calais/bio.txt +7 -0
- data/examples/calais/dump.rb +17 -0
- data/examples/calais/enlighten.rb +23 -0
- data/examples/calais/output.rdf +25 -0
- data/examples/sinatra/viewer.rb +20 -0
- data/lib/pho.rb +4 -1
- data/lib/pho/changeset.rb +17 -1
- data/lib/pho/command_line.rb +166 -0
- data/lib/pho/converter.rb +8 -3
- data/lib/pho/enrichment.rb +93 -28
- data/lib/pho/file_management.rb +32 -19
- data/lib/pho/file_manager.rb +22 -26
- data/lib/pho/rdf.rb +74 -0
- data/lib/pho/rdf_collection.rb +2 -17
- data/lib/pho/sparql.rb +150 -38
- data/lib/pho/store.rb +28 -2
- data/tests/tc_contentbox.rb +41 -0
- data/tests/tc_enrichment.rb +41 -4
- data/tests/tc_file_manager.rb +97 -7
- data/tests/tc_rdf_collection.rb +25 -13
- data/tests/tc_rdf_parser.rb +37 -0
- data/tests/tc_sparql.rb +72 -2
- data/tests/tc_sparql_helper.rb +16 -0
- data/tests/ts_pho.rb +2 -1
- 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="#
|
|
97
|
-
<a href="#
|
|
96
|
+
<a href="#M000190">new</a>
|
|
97
|
+
<a href="#M000191">to_rdf</a>
|
|
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-
|
|
152
|
-
<a name="
|
|
151
|
+
<div id="method-M000190" class="method-detail">
|
|
152
|
+
<a name="M000190"></a>
|
|
153
153
|
|
|
154
154
|
<div class="method-heading">
|
|
155
|
-
<a href="#
|
|
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('
|
|
163
|
-
<div class="method-source-code" id="
|
|
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-
|
|
179
|
-
<a name="
|
|
178
|
+
<div id="method-M000191" class="method-detail">
|
|
179
|
+
<a name="M000191"></a>
|
|
180
180
|
|
|
181
181
|
<div class="method-heading">
|
|
182
|
-
<a href="#
|
|
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.
|
|
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('
|
|
199
|
-
<div class="method-source-code" id="
|
|
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
|
|
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="#
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
98
|
-
<a href="#
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
101
|
-
<a href="#
|
|
102
|
-
<a href="#
|
|
103
|
-
<a href="#
|
|
95
|
+
<a href="#M000031">failures</a>
|
|
96
|
+
<a href="#M000034">get_fail_file_for</a>
|
|
97
|
+
<a href="#M000035">get_ok_file_for</a>
|
|
98
|
+
<a href="#M000026">new</a>
|
|
99
|
+
<a href="#M000030">new_files</a>
|
|
100
|
+
<a href="#M000029">reset</a>
|
|
101
|
+
<a href="#M000028">retry_failures</a>
|
|
102
|
+
<a href="#M000027">store</a>
|
|
103
|
+
<a href="#M000032">successes</a>
|
|
104
|
+
<a href="#M000033">summary</a>
|
|
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-
|
|
162
|
-
<a name="
|
|
162
|
+
<div id="method-M000026" class="method-detail">
|
|
163
|
+
<a name="M000026"></a>
|
|
163
164
|
|
|
164
165
|
<div class="method-heading">
|
|
165
|
-
<a href="#
|
|
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('
|
|
173
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
191
|
-
<a name="
|
|
191
|
+
<div id="method-M000031" class="method-detail">
|
|
192
|
+
<a name="M000031"></a>
|
|
192
193
|
|
|
193
194
|
<div class="method-heading">
|
|
194
|
-
<a href="#
|
|
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#
|
|
202
|
+
List <a href="AbstractFileManager.html#M000031">failures</a>
|
|
202
203
|
</p>
|
|
203
204
|
<p><a class="source-toggle" href="#"
|
|
204
|
-
onclick="toggleCode('
|
|
205
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
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">".#{@fail_suffix}"</span> <span class="ruby-operator">&&</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">".#{@ok_suffix}"</span>
|
|
212
213
|
<span class="ruby-identifier">fails</span> <span class="ruby-operator"><<</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-
|
|
223
|
-
<a name="
|
|
223
|
+
<div id="method-M000034" class="method-detail">
|
|
224
|
+
<a name="M000034"></a>
|
|
224
225
|
|
|
225
226
|
<div class="method-heading">
|
|
226
|
-
<a href="#
|
|
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('
|
|
234
|
-
<div class="method-source-code" id="
|
|
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
|
|
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}
|
|
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">".#{@fail_suffix}"</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-
|
|
247
|
-
<a name="
|
|
247
|
+
<div id="method-M000035" class="method-detail">
|
|
248
|
+
<a name="M000035"></a>
|
|
248
249
|
|
|
249
250
|
<div class="method-heading">
|
|
250
|
-
<a href="#
|
|
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('
|
|
258
|
-
<div class="method-source-code" id="
|
|
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
|
|
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}
|
|
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">".#{@ok_suffix}"</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-
|
|
271
|
-
<a name="
|
|
271
|
+
<div id="method-M000030" class="method-detail">
|
|
272
|
+
<a name="M000030"></a>
|
|
272
273
|
|
|
273
274
|
<div class="method-heading">
|
|
274
|
-
<a href="#
|
|
275
|
-
<span class="method-name">
|
|
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
|
-
|
|
282
|
-
|
|
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('
|
|
288
|
-
<div class="method-source-code" id="
|
|
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"><<</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
|
|
291
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</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">"*.#{@fail_suffix}"</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-
|
|
305
|
-
<a name="
|
|
339
|
+
<div id="method-M000028" class="method-detail">
|
|
340
|
+
<a name="M000028"></a>
|
|
306
341
|
|
|
307
342
|
<div class="method-heading">
|
|
308
|
-
<a href="#
|
|
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('
|
|
319
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
337
|
-
<a name="
|
|
371
|
+
<div id="method-M000027" class="method-detail">
|
|
372
|
+
<a name="M000027"></a>
|
|
338
373
|
|
|
339
374
|
<div class="method-heading">
|
|
340
|
-
<a href="#
|
|
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('
|
|
352
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
368
|
-
<a name="
|
|
402
|
+
<div id="method-M000032" class="method-detail">
|
|
403
|
+
<a name="M000032"></a>
|
|
369
404
|
|
|
370
405
|
<div class="method-heading">
|
|
371
|
-
<a href="#
|
|
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#
|
|
413
|
+
List <a href="AbstractFileManager.html#M000032">successes</a>
|
|
379
414
|
</p>
|
|
380
415
|
<p><a class="source-toggle" href="#"
|
|
381
|
-
onclick="toggleCode('
|
|
382
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
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">".#{@fail_suffix}"</span> <span class="ruby-operator">&&</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">".#{@ok_suffix}"</span>
|
|
389
424
|
<span class="ruby-identifier">successes</span> <span class="ruby-operator"><<</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-
|
|
400
|
-
<a name="
|
|
434
|
+
<div id="method-M000033" class="method-detail">
|
|
435
|
+
<a name="M000033"></a>
|
|
401
436
|
|
|
402
437
|
<div class="method-heading">
|
|
403
|
-
<a href="#
|
|
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
|
|
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('
|
|
415
|
-
<div class="method-source-code" id="
|
|
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
|
|
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">"#{@dir} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new"</span>
|
|
458
|
+
<span class="ruby-identifier">summary</span> = <span class="ruby-node">"#{@dir} #{recursive ? " and sub-directories" : ""} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new"</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>
|