LRH 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LRH.rb +27 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04af4321fdfc0897011caf1c6bbf8fdf2d15f378
|
4
|
+
data.tar.gz: 136ebcdf88808f80be77061593e9545b538afbde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80eb42e81538871fface1c8709f6ac94e2056f573907d7afa06d065c4af1aef68aeee46c9cc86e71986df0e1e3b54f86bc25774eafa3b64ee217b14e933b9f7b
|
7
|
+
data.tar.gz: 9cee1c8be09ad43deb8870bfe2ab4336ad848cbd62ad9374557413e0e191140d94dec5acbc5407b0040d1aa62fca9c91e26eddff5417743ba90b812d29dd976e
|
data/LRH.rb
CHANGED
@@ -21,6 +21,14 @@ class IOAble
|
|
21
21
|
return get_option(:debug)
|
22
22
|
end
|
23
23
|
|
24
|
+
def job=(job)
|
25
|
+
@job = job
|
26
|
+
end
|
27
|
+
|
28
|
+
def halt!
|
29
|
+
@job.halt! if @job
|
30
|
+
end
|
31
|
+
|
24
32
|
def log(obj)
|
25
33
|
msg = nil
|
26
34
|
msg = "Lister: " + obj.to_s if self.is_a? Lister
|
@@ -210,24 +218,43 @@ class Harvester < IOAble
|
|
210
218
|
end
|
211
219
|
|
212
220
|
class Job
|
221
|
+
NOT_RUNNING = 0
|
222
|
+
RUNNING = 1
|
223
|
+
HALTED = 2
|
224
|
+
|
213
225
|
def initialize(lister, runner, harvester)
|
214
226
|
@lister = lister
|
215
227
|
@runner = runner
|
216
228
|
@harvester = harvester
|
229
|
+
|
230
|
+
@lister.job = self
|
231
|
+
@runner.job = self
|
232
|
+
@harvester.job = self
|
233
|
+
|
234
|
+
@status = NOT_RUNNING
|
217
235
|
end
|
218
236
|
|
219
237
|
def run
|
238
|
+
@status = RUNNING
|
220
239
|
@lister._list do |target|
|
221
240
|
partial = @runner._run(target)
|
222
241
|
@harvester._harvest(partial)
|
242
|
+
|
243
|
+
break if @status != RUNNING
|
223
244
|
end
|
224
245
|
|
225
246
|
@runner._finally do |to_harvest|
|
226
247
|
@harvester._harvest(to_harvest)
|
227
248
|
end
|
228
249
|
|
250
|
+
@status = NOT_RUNNING
|
251
|
+
|
229
252
|
return @harvester._result
|
230
253
|
end
|
254
|
+
|
255
|
+
def halt!
|
256
|
+
@status = HALTED
|
257
|
+
end
|
231
258
|
end
|
232
259
|
|
233
260
|
class PartialJob < Job
|