pho 0.7.2 → 0.7.3
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 +5 -0
- data/Rakefile +1 -1
- data/lib/pho/snapshot.rb +6 -1
- data/lib/pho/sparql.rb +4 -1
- data/tests/tc_snapshots.rb +14 -1
- data/tests/tc_sparql_helper.rb +23 -0
- metadata +60 -160
- data/doc/rdoc/classes/Pho/Analyzers.html +0 -310
- data/doc/rdoc/classes/Pho/CommandLine.html +0 -770
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +0 -241
- data/doc/rdoc/classes/Pho/Enrichment/StoreEnricher.html +0 -410
- data/doc/rdoc/classes/Pho/Enrichment.html +0 -119
- data/doc/rdoc/classes/Pho/Etags.html +0 -310
- data/doc/rdoc/classes/Pho/Facet/Results.html +0 -299
- data/doc/rdoc/classes/Pho/Facet/Term.html +0 -177
- data/doc/rdoc/classes/Pho/Facet.html +0 -119
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +0 -668
- data/doc/rdoc/classes/Pho/FieldWeighting.html +0 -230
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +0 -478
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +0 -264
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +0 -259
- data/doc/rdoc/classes/Pho/FileManagement.html +0 -121
- data/doc/rdoc/classes/Pho/Job.html +0 -627
- data/doc/rdoc/classes/Pho/JobUpdate.html +0 -141
- data/doc/rdoc/classes/Pho/Jobs.html +0 -538
- data/doc/rdoc/classes/Pho/Namespaces.html +0 -164
- data/doc/rdoc/classes/Pho/OAI/Record.html +0 -165
- data/doc/rdoc/classes/Pho/OAI/Records.html +0 -331
- data/doc/rdoc/classes/Pho/OAI.html +0 -118
- data/doc/rdoc/classes/Pho/QueryProfile.html +0 -497
- data/doc/rdoc/classes/Pho/RDF/Parser.html +0 -279
- data/doc/rdoc/classes/Pho/RDF.html +0 -120
- data/doc/rdoc/classes/Pho/RDFCollection.html +0 -119
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +0 -325
- data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +0 -241
- data/doc/rdoc/classes/Pho/ResourceHash.html +0 -123
- data/doc/rdoc/classes/Pho/Snapshot.html +0 -397
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +0 -594
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +0 -692
- data/doc/rdoc/classes/Pho/Sparql.html +0 -187
- data/doc/rdoc/classes/Pho/Status.html +0 -296
- data/doc/rdoc/classes/Pho/Store.html +0 -1560
- data/doc/rdoc/classes/Pho/StoreSparqlClient.html +0 -183
- data/doc/rdoc/classes/Pho/Update/Changeset.html +0 -521
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +0 -330
- data/doc/rdoc/classes/Pho/Update/ChangesetHelper.html +0 -159
- data/doc/rdoc/classes/Pho/Update/Changesets.html +0 -205
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +0 -257
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +0 -237
- data/doc/rdoc/classes/Pho/Update/Statement.html +0 -303
- data/doc/rdoc/classes/Pho/Update.html +0 -128
- data/doc/rdoc/classes/Pho.html +0 -283
- data/doc/rdoc/classes/String.html +0 -146
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/CHANGES.html +0 -351
- data/doc/rdoc/files/README.html +0 -191
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/changeset_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/command_line_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/converter_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/etags_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/facet_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/file_management_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/job_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/oai_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/rdf_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/resource_hash_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +0 -109
- data/doc/rdoc/files/lib/pho/sparql_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/status_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/store_rb.html +0 -108
- data/doc/rdoc/files/lib/pho_rb.html +0 -133
- data/doc/rdoc/fr_class_index.html +0 -72
- data/doc/rdoc/fr_file_index.html +0 -49
- data/doc/rdoc/fr_method_index.html +0 -237
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Pho::FileManagement::AbstractFileManager</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Pho::FileManagement::AbstractFileManager</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../../files/lib/pho/file_management_rb.html">
|
|
59
|
-
lib/pho/file_management.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
Object
|
|
69
|
-
</td>
|
|
70
|
-
</tr>
|
|
71
|
-
</table>
|
|
72
|
-
</div>
|
|
73
|
-
<!-- banner header -->
|
|
74
|
-
|
|
75
|
-
<div id="bodyContent">
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div id="contextContent">
|
|
80
|
-
|
|
81
|
-
<div id="description">
|
|
82
|
-
<p>
|
|
83
|
-
TODO: move files into hidden directory
|
|
84
|
-
</p>
|
|
85
|
-
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div id="method-list">
|
|
92
|
-
<h3 class="section-bar">Methods</h3>
|
|
93
|
-
|
|
94
|
-
<div class="name-list">
|
|
95
|
-
<a href="#M000032">failures</a>
|
|
96
|
-
<a href="#M000035">get_fail_file_for</a>
|
|
97
|
-
<a href="#M000036">get_ok_file_for</a>
|
|
98
|
-
<a href="#M000027">new</a>
|
|
99
|
-
<a href="#M000031">new_files</a>
|
|
100
|
-
<a href="#M000030">reset</a>
|
|
101
|
-
<a href="#M000029">retry_failures</a>
|
|
102
|
-
<a href="#M000028">store</a>
|
|
103
|
-
<a href="#M000033">successes</a>
|
|
104
|
-
<a href="#M000034">summary</a>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<!-- if includes -->
|
|
112
|
-
|
|
113
|
-
<div id="section">
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<div id="constants-list">
|
|
117
|
-
<h3 class="section-bar">Constants</h3>
|
|
118
|
-
|
|
119
|
-
<div class="name-list">
|
|
120
|
-
<table summary="Constants">
|
|
121
|
-
<tr class="top-aligned-row context-row">
|
|
122
|
-
<td class="context-item-name">OK</td>
|
|
123
|
-
<td>=</td>
|
|
124
|
-
<td class="context-item-value">"ok".freeze</td>
|
|
125
|
-
</tr>
|
|
126
|
-
<tr class="top-aligned-row context-row">
|
|
127
|
-
<td class="context-item-name">FAIL</td>
|
|
128
|
-
<td>=</td>
|
|
129
|
-
<td class="context-item-value">"fail".freeze</td>
|
|
130
|
-
</tr>
|
|
131
|
-
</table>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<div id="attribute-list">
|
|
138
|
-
<h3 class="section-bar">Attributes</h3>
|
|
139
|
-
|
|
140
|
-
<div class="name-list">
|
|
141
|
-
<table>
|
|
142
|
-
<tr class="top-aligned-row context-row">
|
|
143
|
-
<td class="context-item-name">dir</td>
|
|
144
|
-
<td class="context-item-value"> [R] </td>
|
|
145
|
-
<td class="context-item-desc"></td>
|
|
146
|
-
</tr>
|
|
147
|
-
<tr class="top-aligned-row context-row">
|
|
148
|
-
<td class="context-item-name">store</td>
|
|
149
|
-
<td class="context-item-value"> [R] </td>
|
|
150
|
-
<td class="context-item-desc"></td>
|
|
151
|
-
</tr>
|
|
152
|
-
</table>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<!-- if method_list -->
|
|
159
|
-
<div id="methods">
|
|
160
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
161
|
-
|
|
162
|
-
<div id="method-M000027" class="method-detail">
|
|
163
|
-
<a name="M000027"></a>
|
|
164
|
-
|
|
165
|
-
<div class="method-heading">
|
|
166
|
-
<a href="#M000027" class="method-signature">
|
|
167
|
-
<span class="method-name">new</span><span class="method-args">(store, dir, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
|
|
168
|
-
</a>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<div class="method-description">
|
|
172
|
-
<p><a class="source-toggle" href="#"
|
|
173
|
-
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
|
174
|
-
<div class="method-source-code" id="M000027-source">
|
|
175
|
-
<pre>
|
|
176
|
-
<span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 14</span>
|
|
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>)
|
|
178
|
-
<span class="ruby-ivar">@store</span> = <span class="ruby-identifier">store</span>
|
|
179
|
-
<span class="ruby-ivar">@dir</span> = <span class="ruby-identifier">dir</span>
|
|
180
|
-
<span class="ruby-ivar">@sleep</span> = <span class="ruby-identifier">sleep</span>
|
|
181
|
-
<span class="ruby-ivar">@ok_suffix</span> = <span class="ruby-identifier">ok_suffix</span>
|
|
182
|
-
<span class="ruby-ivar">@fail_suffix</span> = <span class="ruby-identifier">fail_suffix</span>
|
|
183
|
-
<span class="ruby-keyword kw">end</span>
|
|
184
|
-
</pre>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
190
|
-
|
|
191
|
-
<div id="method-M000032" class="method-detail">
|
|
192
|
-
<a name="M000032"></a>
|
|
193
|
-
|
|
194
|
-
<div class="method-heading">
|
|
195
|
-
<a href="#M000032" class="method-signature">
|
|
196
|
-
<span class="method-name">failures</span><span class="method-args">(recursive=false)</span>
|
|
197
|
-
</a>
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
<div class="method-description">
|
|
201
|
-
<p>
|
|
202
|
-
List <a href="AbstractFileManager.html#M000032">failures</a>
|
|
203
|
-
</p>
|
|
204
|
-
<p><a class="source-toggle" href="#"
|
|
205
|
-
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
|
206
|
-
<div class="method-source-code" id="M000032-source">
|
|
207
|
-
<pre>
|
|
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>)
|
|
210
|
-
<span class="ruby-identifier">fails</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</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>
|
|
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>
|
|
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>) )
|
|
214
|
-
<span class="ruby-keyword kw">end</span>
|
|
215
|
-
<span class="ruby-keyword kw">end</span>
|
|
216
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fails</span>
|
|
217
|
-
<span class="ruby-keyword kw">end</span>
|
|
218
|
-
</pre>
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
|
|
223
|
-
<div id="method-M000035" class="method-detail">
|
|
224
|
-
<a name="M000035"></a>
|
|
225
|
-
|
|
226
|
-
<div class="method-heading">
|
|
227
|
-
<a href="#M000035" class="method-signature">
|
|
228
|
-
<span class="method-name">get_fail_file_for</span><span class="method-args">(filename)</span>
|
|
229
|
-
</a>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<div class="method-description">
|
|
233
|
-
<p><a class="source-toggle" href="#"
|
|
234
|
-
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
235
|
-
<div class="method-source-code" id="M000035-source">
|
|
236
|
-
<pre>
|
|
237
|
-
<span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 100</span>
|
|
238
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>)
|
|
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>)
|
|
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>)
|
|
241
|
-
<span class="ruby-keyword kw">end</span>
|
|
242
|
-
</pre>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
<div id="method-M000036" class="method-detail">
|
|
248
|
-
<a name="M000036"></a>
|
|
249
|
-
|
|
250
|
-
<div class="method-heading">
|
|
251
|
-
<a href="#M000036" class="method-signature">
|
|
252
|
-
<span class="method-name">get_ok_file_for</span><span class="method-args">(filename)</span>
|
|
253
|
-
</a>
|
|
254
|
-
</div>
|
|
255
|
-
|
|
256
|
-
<div class="method-description">
|
|
257
|
-
<p><a class="source-toggle" href="#"
|
|
258
|
-
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
259
|
-
<div class="method-source-code" id="M000036-source">
|
|
260
|
-
<pre>
|
|
261
|
-
<span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 105</span>
|
|
262
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">filename</span>)
|
|
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>)
|
|
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>)
|
|
265
|
-
<span class="ruby-keyword kw">end</span>
|
|
266
|
-
</pre>
|
|
267
|
-
</div>
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
|
|
271
|
-
<div id="method-M000031" class="method-detail">
|
|
272
|
-
<a name="M000031"></a>
|
|
273
|
-
|
|
274
|
-
<div class="method-heading">
|
|
275
|
-
<a href="#M000031" class="method-signature">
|
|
276
|
-
<span class="method-name">new_files</span><span class="method-args">(recursive=false)</span>
|
|
277
|
-
</a>
|
|
278
|
-
</div>
|
|
279
|
-
|
|
280
|
-
<div class="method-description">
|
|
281
|
-
<p>
|
|
282
|
-
List any <a href="AbstractFileManager.html#M000027">new</a> files in the
|
|
283
|
-
directory
|
|
284
|
-
</p>
|
|
285
|
-
<p><a class="source-toggle" href="#"
|
|
286
|
-
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
287
|
-
<div class="method-source-code" id="M000031-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-M000030" class="method-detail">
|
|
309
|
-
<a name="M000030"></a>
|
|
310
|
-
|
|
311
|
-
<div class="method-heading">
|
|
312
|
-
<a href="#M000030" 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('M000030-source');return false;">[Source]</a></p>
|
|
323
|
-
<div class="method-source-code" id="M000030-source">
|
|
324
|
-
<pre>
|
|
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>()
|
|
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>
|
|
328
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
|
|
329
|
-
<span class="ruby-keyword kw">end</span>
|
|
330
|
-
<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">"*.#{@ok_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>
|
|
331
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
|
|
332
|
-
<span class="ruby-keyword kw">end</span>
|
|
333
|
-
<span class="ruby-keyword kw">end</span>
|
|
334
|
-
</pre>
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
</div>
|
|
338
|
-
|
|
339
|
-
<div id="method-M000029" class="method-detail">
|
|
340
|
-
<a name="M000029"></a>
|
|
341
|
-
|
|
342
|
-
<div class="method-heading">
|
|
343
|
-
<a href="#M000029" class="method-signature">
|
|
344
|
-
<span class="method-name">retry_failures</span><span class="method-args">()</span>
|
|
345
|
-
</a>
|
|
346
|
-
</div>
|
|
347
|
-
|
|
348
|
-
<div class="method-description">
|
|
349
|
-
<p>
|
|
350
|
-
Retry anything known to have failed
|
|
351
|
-
</p>
|
|
352
|
-
<p><a class="source-toggle" href="#"
|
|
353
|
-
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
|
354
|
-
<div class="method-source-code" id="M000029-source">
|
|
355
|
-
<pre>
|
|
356
|
-
<span class="ruby-comment cmt"># File lib/pho/file_management.rb, line 32</span>
|
|
357
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retry_failures</span>()
|
|
358
|
-
<span class="ruby-identifier">retries</span> = <span class="ruby-identifier">failures</span>()
|
|
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>
|
|
360
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>) )
|
|
361
|
-
<span class="ruby-comment cmt">#store it</span>
|
|
362
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
|
|
363
|
-
<span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
|
|
364
|
-
<span class="ruby-keyword kw">end</span>
|
|
365
|
-
<span class="ruby-keyword kw">end</span>
|
|
366
|
-
</pre>
|
|
367
|
-
</div>
|
|
368
|
-
</div>
|
|
369
|
-
</div>
|
|
370
|
-
|
|
371
|
-
<div id="method-M000028" class="method-detail">
|
|
372
|
-
<a name="M000028"></a>
|
|
373
|
-
|
|
374
|
-
<div class="method-heading">
|
|
375
|
-
<a href="#M000028" class="method-signature">
|
|
376
|
-
<span class="method-name">store</span><span class="method-args">(recursive=false)</span>
|
|
377
|
-
</a>
|
|
378
|
-
</div>
|
|
379
|
-
|
|
380
|
-
<div class="method-description">
|
|
381
|
-
<p>
|
|
382
|
-
<a href="../Store.html">Store</a> all files that match the file name in
|
|
383
|
-
directory
|
|
384
|
-
</p>
|
|
385
|
-
<p><a class="source-toggle" href="#"
|
|
386
|
-
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
|
387
|
-
<div class="method-source-code" id="M000028-source">
|
|
388
|
-
<pre>
|
|
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>)
|
|
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>
|
|
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>)
|
|
394
|
-
<span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
|
|
395
|
-
<span class="ruby-keyword kw">end</span>
|
|
396
|
-
<span class="ruby-keyword kw">end</span>
|
|
397
|
-
</pre>
|
|
398
|
-
</div>
|
|
399
|
-
</div>
|
|
400
|
-
</div>
|
|
401
|
-
|
|
402
|
-
<div id="method-M000033" class="method-detail">
|
|
403
|
-
<a name="M000033"></a>
|
|
404
|
-
|
|
405
|
-
<div class="method-heading">
|
|
406
|
-
<a href="#M000033" class="method-signature">
|
|
407
|
-
<span class="method-name">successes</span><span class="method-args">(recursive=false)</span>
|
|
408
|
-
</a>
|
|
409
|
-
</div>
|
|
410
|
-
|
|
411
|
-
<div class="method-description">
|
|
412
|
-
<p>
|
|
413
|
-
List <a href="AbstractFileManager.html#M000033">successes</a>
|
|
414
|
-
</p>
|
|
415
|
-
<p><a class="source-toggle" href="#"
|
|
416
|
-
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
|
417
|
-
<div class="method-source-code" id="M000033-source">
|
|
418
|
-
<pre>
|
|
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>)
|
|
421
|
-
<span class="ruby-identifier">successes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</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>
|
|
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>
|
|
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>) )
|
|
425
|
-
<span class="ruby-keyword kw">end</span>
|
|
426
|
-
<span class="ruby-keyword kw">end</span>
|
|
427
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">successes</span>
|
|
428
|
-
<span class="ruby-keyword kw">end</span>
|
|
429
|
-
</pre>
|
|
430
|
-
</div>
|
|
431
|
-
</div>
|
|
432
|
-
</div>
|
|
433
|
-
|
|
434
|
-
<div id="method-M000034" class="method-detail">
|
|
435
|
-
<a name="M000034"></a>
|
|
436
|
-
|
|
437
|
-
<div class="method-heading">
|
|
438
|
-
<a href="#M000034" class="method-signature">
|
|
439
|
-
<span class="method-name">summary</span><span class="method-args">(recursive=false)</span>
|
|
440
|
-
</a>
|
|
441
|
-
</div>
|
|
442
|
-
|
|
443
|
-
<div class="method-description">
|
|
444
|
-
<p>
|
|
445
|
-
Summarize the state of the collection to the provided IO object Creates a
|
|
446
|
-
simple report
|
|
447
|
-
</p>
|
|
448
|
-
<p><a class="source-toggle" href="#"
|
|
449
|
-
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
450
|
-
<div class="method-source-code" id="M000034-source">
|
|
451
|
-
<pre>
|
|
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>)
|
|
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>
|
|
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>
|
|
459
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">summary</span>
|
|
460
|
-
<span class="ruby-keyword kw">end</span>
|
|
461
|
-
</pre>
|
|
462
|
-
</div>
|
|
463
|
-
</div>
|
|
464
|
-
</div>
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
</div>
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
</div>
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
<div id="validator-badges">
|
|
474
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
475
|
-
</div>
|
|
476
|
-
|
|
477
|
-
</body>
|
|
478
|
-
</html>
|