dh_easy-core 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +7 -0
- data/.yardopts +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE +21 -0
- data/README.md +20 -0
- data/Rakefile +22 -0
- data/dh_easy-core.gemspec +50 -0
- data/doc/DhEasy.html +117 -0
- data/doc/DhEasy/Core.html +1590 -0
- data/doc/DhEasy/Core/Config.html +311 -0
- data/doc/DhEasy/Core/Exception.html +117 -0
- data/doc/DhEasy/Core/Exception/OutdatedError.html +135 -0
- data/doc/DhEasy/Core/Helper.html +117 -0
- data/doc/DhEasy/Core/Helper/Cookie.html +1070 -0
- data/doc/DhEasy/Core/Mock.html +282 -0
- data/doc/DhEasy/Core/Mock/FakeDb.html +3779 -0
- data/doc/DhEasy/Core/Mock/FakeExecutor.html +3289 -0
- data/doc/DhEasy/Core/Mock/FakeFinisher.html +160 -0
- data/doc/DhEasy/Core/Mock/FakeParser.html +160 -0
- data/doc/DhEasy/Core/Mock/FakeSeeder.html +160 -0
- data/doc/DhEasy/Core/Plugin.html +117 -0
- data/doc/DhEasy/Core/Plugin/CollectionVault.html +299 -0
- data/doc/DhEasy/Core/Plugin/ConfigBehavior.html +541 -0
- data/doc/DhEasy/Core/Plugin/ContextIntegrator.html +445 -0
- data/doc/DhEasy/Core/Plugin/Executor.html +259 -0
- data/doc/DhEasy/Core/Plugin/ExecutorBehavior.html +344 -0
- data/doc/DhEasy/Core/Plugin/Finisher.html +265 -0
- data/doc/DhEasy/Core/Plugin/FinisherBehavior.html +142 -0
- data/doc/DhEasy/Core/Plugin/InitializeHook.html +220 -0
- data/doc/DhEasy/Core/Plugin/Parser.html +270 -0
- data/doc/DhEasy/Core/Plugin/ParserBehavior.html +235 -0
- data/doc/DhEasy/Core/Plugin/Seeder.html +674 -0
- data/doc/DhEasy/Core/Plugin/SeederBehavior.html +142 -0
- data/doc/DhEasy/Core/SmartCollection.html +1087 -0
- data/doc/_index.html +364 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +91 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +91 -0
- data/doc/js/app.js +303 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +939 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/dh_easy/core.rb +257 -0
- data/lib/dh_easy/core/config.rb +27 -0
- data/lib/dh_easy/core/exception.rb +8 -0
- data/lib/dh_easy/core/exception/outdated_error.rb +9 -0
- data/lib/dh_easy/core/helper.rb +8 -0
- data/lib/dh_easy/core/helper/cookie.rb +209 -0
- data/lib/dh_easy/core/mock.rb +45 -0
- data/lib/dh_easy/core/mock/fake_db.rb +561 -0
- data/lib/dh_easy/core/mock/fake_executor.rb +373 -0
- data/lib/dh_easy/core/mock/fake_finisher.rb +28 -0
- data/lib/dh_easy/core/mock/fake_parser.rb +33 -0
- data/lib/dh_easy/core/mock/fake_seeder.rb +28 -0
- data/lib/dh_easy/core/plugin.rb +19 -0
- data/lib/dh_easy/core/plugin/collection_vault.rb +23 -0
- data/lib/dh_easy/core/plugin/config_behavior.rb +43 -0
- data/lib/dh_easy/core/plugin/context_integrator.rb +60 -0
- data/lib/dh_easy/core/plugin/executor.rb +19 -0
- data/lib/dh_easy/core/plugin/executor_behavior.rb +32 -0
- data/lib/dh_easy/core/plugin/finisher.rb +19 -0
- data/lib/dh_easy/core/plugin/finisher_behavior.rb +9 -0
- data/lib/dh_easy/core/plugin/initialize_hook.rb +17 -0
- data/lib/dh_easy/core/plugin/parser.rb +19 -0
- data/lib/dh_easy/core/plugin/parser_behavior.rb +17 -0
- data/lib/dh_easy/core/plugin/seeder.rb +44 -0
- data/lib/dh_easy/core/plugin/seeder_behavior.rb +9 -0
- data/lib/dh_easy/core/smart_collection.rb +236 -0
- data/lib/dh_easy/core/version.rb +6 -0
- metadata +249 -0
@@ -0,0 +1,3289 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: DhEasy::Core::Mock::FakeExecutor
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "DhEasy::Core::Mock::FakeExecutor";
|
19
|
+
relpath = '../../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../../_index.html">Index (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../../DhEasy.html" title="DhEasy (module)">DhEasy</a></span></span> » <span class='title'><span class='object_link'><a href="../../Core.html" title="DhEasy::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../Mock.html" title="DhEasy::Core::Mock (module)">Mock</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">FakeExecutor</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: DhEasy::Core::Mock::FakeExecutor
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dl>
|
75
|
+
<dt>Includes:</dt>
|
76
|
+
<dd>Datahen::Plugin::ContextExposer</dd>
|
77
|
+
</dl>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dl>
|
83
|
+
<dt>Included in:</dt>
|
84
|
+
<dd><span class='object_link'><a href="FakeFinisher.html" title="DhEasy::Core::Mock::FakeFinisher (class)">FakeFinisher</a></span>, <span class='object_link'><a href="FakeParser.html" title="DhEasy::Core::Mock::FakeParser (class)">FakeParser</a></span>, <span class='object_link'><a href="FakeSeeder.html" title="DhEasy::Core::Mock::FakeSeeder (class)">FakeSeeder</a></span></dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dl>
|
90
|
+
<dt>Defined in:</dt>
|
91
|
+
<dd>lib/dh_easy/core/mock/fake_executor.rb</dd>
|
92
|
+
</dl>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<h2>Overview</h2><div class="docstring">
|
97
|
+
<div class="discussion">
|
98
|
+
|
99
|
+
<p>Fake executor that emulates `Datahen` executor.</p>
|
100
|
+
|
101
|
+
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<div class="tags">
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Constant Summary
|
111
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<dl class="constants">
|
115
|
+
|
116
|
+
<dt id="MAX_FIND_OUTPUTS_PER_PAGE-constant" class="">MAX_FIND_OUTPUTS_PER_PAGE =
|
117
|
+
<div class="docstring">
|
118
|
+
<div class="discussion">
|
119
|
+
|
120
|
+
<p>Max allowed page size when query outputs (see #find_outputs).</p>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
<div class="tags">
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</dt>
|
130
|
+
<dd><pre class="code"><span class='int'>500</span></pre></dd>
|
131
|
+
|
132
|
+
</dl>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
139
|
+
<ul class="summary">
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#content-instance_method" title="#content (instance method)">#<strong>content</strong> ⇒ String<sup>?</sup> </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>Page content.</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#failed_content-instance_method" title="#failed_content (instance method)">#<strong>failed_content</strong> ⇒ String<sup>?</sup> </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<span class="summary_desc"><div class='inline'>
|
189
|
+
<p>Failed page content.</p>
|
190
|
+
</div></span>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
</ul>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<h2>
|
202
|
+
Instance Method Summary
|
203
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
204
|
+
</h2>
|
205
|
+
|
206
|
+
<ul class="summary">
|
207
|
+
|
208
|
+
<li class="public ">
|
209
|
+
<span class="summary_signature">
|
210
|
+
|
211
|
+
<a href="#db-instance_method" title="#db (instance method)">#<strong>db</strong> ⇒ Object </a>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</span>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<span class="summary_desc"><div class='inline'>
|
226
|
+
<p>Fake database to represent what it is saved.</p>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
<li class="public ">
|
233
|
+
<span class="summary_signature">
|
234
|
+
|
235
|
+
<a href="#execute_script-instance_method" title="#execute_script (instance method)">#<strong>execute_script</strong>(file_path, vars = {}) ⇒ Object </a>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<span class="summary_desc"><div class='inline'>
|
250
|
+
<p>Execute an script file as an executor.</p>
|
251
|
+
</div></span>
|
252
|
+
|
253
|
+
</li>
|
254
|
+
|
255
|
+
|
256
|
+
<li class="public ">
|
257
|
+
<span class="summary_signature">
|
258
|
+
|
259
|
+
<a href="#find_output-instance_method" title="#find_output (instance method)">#<strong>find_output</strong>(collection = 'default', query = {}, opts = {}) ⇒ Hash<sup>?</sup> </a>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
</span>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
<span class="summary_desc"><div class='inline'>
|
274
|
+
<p>Find one output by collection and query with pagination.</p>
|
275
|
+
</div></span>
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
|
280
|
+
<li class="public ">
|
281
|
+
<span class="summary_signature">
|
282
|
+
|
283
|
+
<a href="#find_outputs-instance_method" title="#find_outputs (instance method)">#<strong>find_outputs</strong>(collection = 'default', query = {}, page = 1, per_page = 30, opts = {}) ⇒ Array </a>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</span>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<span class="summary_desc"><div class='inline'>
|
298
|
+
<p>Find outputs by collection and query with pagination.</p>
|
299
|
+
</div></span>
|
300
|
+
|
301
|
+
</li>
|
302
|
+
|
303
|
+
|
304
|
+
<li class="public ">
|
305
|
+
<span class="summary_signature">
|
306
|
+
|
307
|
+
<a href="#flush-instance_method" title="#flush (instance method)">#<strong>flush</strong> ⇒ Object </a>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</span>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<span class="summary_desc"><div class='inline'>
|
322
|
+
<p>Save all drafts into db and clear draft queues.</p>
|
323
|
+
</div></span>
|
324
|
+
|
325
|
+
</li>
|
326
|
+
|
327
|
+
|
328
|
+
<li class="public ">
|
329
|
+
<span class="summary_signature">
|
330
|
+
|
331
|
+
<a href="#flush_outputs-instance_method" title="#flush_outputs (instance method)">#<strong>flush_outputs</strong> ⇒ Object </a>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</span>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<span class="summary_desc"><div class='inline'>
|
346
|
+
<p>Save draft outputs into db and clear draft queue.</p>
|
347
|
+
</div></span>
|
348
|
+
|
349
|
+
</li>
|
350
|
+
|
351
|
+
|
352
|
+
<li class="public ">
|
353
|
+
<span class="summary_signature">
|
354
|
+
|
355
|
+
<a href="#flush_pages-instance_method" title="#flush_pages (instance method)">#<strong>flush_pages</strong> ⇒ Object </a>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
</span>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
<span class="summary_desc"><div class='inline'>
|
370
|
+
<p>Save draft pages into db and clear draft queue.</p>
|
371
|
+
</div></span>
|
372
|
+
|
373
|
+
</li>
|
374
|
+
|
375
|
+
|
376
|
+
<li class="public ">
|
377
|
+
<span class="summary_signature">
|
378
|
+
|
379
|
+
<a href="#flush_self_actions-instance_method" title="#flush_self_actions (instance method)">#<strong>flush_self_actions</strong> ⇒ Object </a>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
</span>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
<span class="summary_desc"><div class='inline'>
|
394
|
+
<p>Execute any action applied to current page.</p>
|
395
|
+
</div></span>
|
396
|
+
|
397
|
+
</li>
|
398
|
+
|
399
|
+
|
400
|
+
<li class="public ">
|
401
|
+
<span class="summary_signature">
|
402
|
+
|
403
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ Object </a>
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
</span>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
<span class="summary_desc"><div class='inline'>
|
418
|
+
<p>Initialize object.</p>
|
419
|
+
</div></span>
|
420
|
+
|
421
|
+
</li>
|
422
|
+
|
423
|
+
|
424
|
+
<li class="public ">
|
425
|
+
<span class="summary_signature">
|
426
|
+
|
427
|
+
<a href="#job_id-instance_method" title="#job_id (instance method)">#<strong>job_id</strong> ⇒ Integer<sup>?</sup> </a>
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
</span>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
<span class="summary_desc"><div class='inline'>
|
442
|
+
<p>Fake job ID used by executor.</p>
|
443
|
+
</div></span>
|
444
|
+
|
445
|
+
</li>
|
446
|
+
|
447
|
+
|
448
|
+
<li class="public ">
|
449
|
+
<span class="summary_signature">
|
450
|
+
|
451
|
+
<a href="#job_id=-instance_method" title="#job_id= (instance method)">#<strong>job_id=</strong>(value) ⇒ Object </a>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
</span>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<span class="summary_desc"><div class='inline'>
|
466
|
+
<p>Set fake job ID value.</p>
|
467
|
+
</div></span>
|
468
|
+
|
469
|
+
</li>
|
470
|
+
|
471
|
+
|
472
|
+
<li class="public ">
|
473
|
+
<span class="summary_signature">
|
474
|
+
|
475
|
+
<a href="#latest_job_by-instance_method" title="#latest_job_by (instance method)">#<strong>latest_job_by</strong>(scraper_name, filter = {}) ⇒ Hash<sup>?</sup> </a>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</span>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
<span class="summary_desc"><div class='inline'>
|
490
|
+
<p>Get latest job by scraper_name.</p>
|
491
|
+
</div></span>
|
492
|
+
|
493
|
+
</li>
|
494
|
+
|
495
|
+
|
496
|
+
<li class="public ">
|
497
|
+
<span class="summary_signature">
|
498
|
+
|
499
|
+
<a href="#outputs-instance_method" title="#outputs (instance method)">#<strong>outputs</strong> ⇒ Array </a>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
</span>
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
<span class="summary_desc"><div class='inline'>
|
514
|
+
<p>Draft outputs, usually get saved after execution.</p>
|
515
|
+
</div></span>
|
516
|
+
|
517
|
+
</li>
|
518
|
+
|
519
|
+
|
520
|
+
<li class="public ">
|
521
|
+
<span class="summary_signature">
|
522
|
+
|
523
|
+
<a href="#page-instance_method" title="#page (instance method)">#<strong>page</strong> ⇒ Hash<sup>?</sup> </a>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
</span>
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
<span class="summary_desc"><div class='inline'>
|
538
|
+
<p>Current page used by executor.</p>
|
539
|
+
</div></span>
|
540
|
+
|
541
|
+
</li>
|
542
|
+
|
543
|
+
|
544
|
+
<li class="public ">
|
545
|
+
<span class="summary_signature">
|
546
|
+
|
547
|
+
<a href="#page=-instance_method" title="#page= (instance method)">#<strong>page=</strong>(value) ⇒ Object </a>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</span>
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
<span class="summary_desc"><div class='inline'>
|
562
|
+
<p>Set current page.</p>
|
563
|
+
</div></span>
|
564
|
+
|
565
|
+
</li>
|
566
|
+
|
567
|
+
|
568
|
+
<li class="public ">
|
569
|
+
<span class="summary_signature">
|
570
|
+
|
571
|
+
<a href="#pages-instance_method" title="#pages (instance method)">#<strong>pages</strong> ⇒ Array </a>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
</span>
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
<span class="summary_desc"><div class='inline'>
|
586
|
+
<p>Draft pages, usually get saved after execution.</p>
|
587
|
+
</div></span>
|
588
|
+
|
589
|
+
</li>
|
590
|
+
|
591
|
+
|
592
|
+
<li class="public ">
|
593
|
+
<span class="summary_signature">
|
594
|
+
|
595
|
+
<a href="#refetch-instance_method" title="#refetch (instance method)">#<strong>refetch</strong>(gid) ⇒ Object </a>
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
</span>
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
<span class="summary_desc"><div class='inline'>
|
610
|
+
<p>Refetch a page by gid.</p>
|
611
|
+
</div></span>
|
612
|
+
|
613
|
+
</li>
|
614
|
+
|
615
|
+
|
616
|
+
<li class="public ">
|
617
|
+
<span class="summary_signature">
|
618
|
+
|
619
|
+
<a href="#refetch_self-instance_method" title="#refetch_self (instance method)">#<strong>refetch_self</strong> ⇒ Boollean </a>
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
</span>
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
<span class="summary_desc"><div class='inline'>
|
634
|
+
<p>Refetch self page flag.</p>
|
635
|
+
</div></span>
|
636
|
+
|
637
|
+
</li>
|
638
|
+
|
639
|
+
|
640
|
+
<li class="public ">
|
641
|
+
<span class="summary_signature">
|
642
|
+
|
643
|
+
<a href="#refetch_self=-instance_method" title="#refetch_self= (instance method)">#<strong>refetch_self=</strong>(value) ⇒ Object </a>
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
</span>
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
<span class="summary_desc"><div class='inline'>
|
658
|
+
<p>Set refetch self page flag.</p>
|
659
|
+
</div></span>
|
660
|
+
|
661
|
+
</li>
|
662
|
+
|
663
|
+
|
664
|
+
<li class="public ">
|
665
|
+
<span class="summary_signature">
|
666
|
+
|
667
|
+
<a href="#reparse-instance_method" title="#reparse (instance method)">#<strong>reparse</strong>(page_gid) ⇒ Object </a>
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
</span>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
<span class="summary_desc"><div class='inline'>
|
682
|
+
<p>Reparse a page by gid.</p>
|
683
|
+
</div></span>
|
684
|
+
|
685
|
+
</li>
|
686
|
+
|
687
|
+
|
688
|
+
<li class="public ">
|
689
|
+
<span class="summary_signature">
|
690
|
+
|
691
|
+
<a href="#reparse_self-instance_method" title="#reparse_self (instance method)">#<strong>reparse_self</strong> ⇒ Boollean </a>
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
</span>
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
<span class="summary_desc"><div class='inline'>
|
706
|
+
<p>Reparse self page flag.</p>
|
707
|
+
</div></span>
|
708
|
+
|
709
|
+
</li>
|
710
|
+
|
711
|
+
|
712
|
+
<li class="public ">
|
713
|
+
<span class="summary_signature">
|
714
|
+
|
715
|
+
<a href="#reparse_self=-instance_method" title="#reparse_self= (instance method)">#<strong>reparse_self=</strong>(value) ⇒ Object </a>
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
</span>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
<span class="summary_desc"><div class='inline'>
|
730
|
+
<p>Set reparse self page flag.</p>
|
731
|
+
</div></span>
|
732
|
+
|
733
|
+
</li>
|
734
|
+
|
735
|
+
|
736
|
+
<li class="public ">
|
737
|
+
<span class="summary_signature">
|
738
|
+
|
739
|
+
<a href="#save_jobs-instance_method" title="#save_jobs (instance method)">#<strong>save_jobs</strong>(list) ⇒ Object </a>
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
</span>
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
<span class="summary_desc"><div class='inline'>
|
754
|
+
<p>Save a job collection on db and remove all the element from
|
755
|
+
<code>list</code>.</p>
|
756
|
+
</div></span>
|
757
|
+
|
758
|
+
</li>
|
759
|
+
|
760
|
+
|
761
|
+
<li class="public ">
|
762
|
+
<span class="summary_signature">
|
763
|
+
|
764
|
+
<a href="#save_outputs-instance_method" title="#save_outputs (instance method)">#<strong>save_outputs</strong>(list) ⇒ Object </a>
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
</span>
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
<span class="summary_desc"><div class='inline'>
|
779
|
+
<p>Save an output collection on db and remove all the element from
|
780
|
+
<code>list</code>.</p>
|
781
|
+
</div></span>
|
782
|
+
|
783
|
+
</li>
|
784
|
+
|
785
|
+
|
786
|
+
<li class="public ">
|
787
|
+
<span class="summary_signature">
|
788
|
+
|
789
|
+
<a href="#save_pages-instance_method" title="#save_pages (instance method)">#<strong>save_pages</strong>(list) ⇒ Object </a>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
</span>
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
<span class="summary_desc"><div class='inline'>
|
804
|
+
<p>Save a page collection on db and remove all the element from
|
805
|
+
<code>list</code>.</p>
|
806
|
+
</div></span>
|
807
|
+
|
808
|
+
</li>
|
809
|
+
|
810
|
+
|
811
|
+
<li class="public ">
|
812
|
+
<span class="summary_signature">
|
813
|
+
|
814
|
+
<a href="#saved_jobs-instance_method" title="#saved_jobs (instance method)">#<strong>saved_jobs</strong> ⇒ Object </a>
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
</span>
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
<span class="summary_desc"><div class='inline'>
|
829
|
+
<p>Retrive a list of saved jobs.</p>
|
830
|
+
</div></span>
|
831
|
+
|
832
|
+
</li>
|
833
|
+
|
834
|
+
|
835
|
+
<li class="public ">
|
836
|
+
<span class="summary_signature">
|
837
|
+
|
838
|
+
<a href="#saved_outputs-instance_method" title="#saved_outputs (instance method)">#<strong>saved_outputs</strong> ⇒ Object </a>
|
839
|
+
|
840
|
+
|
841
|
+
|
842
|
+
</span>
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
<span class="summary_desc"><div class='inline'>
|
853
|
+
<p>Retrive a list of saved outputs.</p>
|
854
|
+
</div></span>
|
855
|
+
|
856
|
+
</li>
|
857
|
+
|
858
|
+
|
859
|
+
<li class="public ">
|
860
|
+
<span class="summary_signature">
|
861
|
+
|
862
|
+
<a href="#saved_pages-instance_method" title="#saved_pages (instance method)">#<strong>saved_pages</strong> ⇒ Object </a>
|
863
|
+
|
864
|
+
|
865
|
+
|
866
|
+
</span>
|
867
|
+
|
868
|
+
|
869
|
+
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
<span class="summary_desc"><div class='inline'>
|
877
|
+
<p>Retrive a list of saved pages.</p>
|
878
|
+
</div></span>
|
879
|
+
|
880
|
+
</li>
|
881
|
+
|
882
|
+
|
883
|
+
<li class="public ">
|
884
|
+
<span class="summary_signature">
|
885
|
+
|
886
|
+
<a href="#scraper_name-instance_method" title="#scraper_name (instance method)">#<strong>scraper_name</strong> ⇒ Integer<sup>?</sup> </a>
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
</span>
|
891
|
+
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
<span class="summary_desc"><div class='inline'>
|
901
|
+
<p>Fake scraper name used by executor.</p>
|
902
|
+
</div></span>
|
903
|
+
|
904
|
+
</li>
|
905
|
+
|
906
|
+
|
907
|
+
<li class="public ">
|
908
|
+
<span class="summary_signature">
|
909
|
+
|
910
|
+
<a href="#scraper_name=-instance_method" title="#scraper_name= (instance method)">#<strong>scraper_name=</strong>(value) ⇒ Object </a>
|
911
|
+
|
912
|
+
|
913
|
+
|
914
|
+
</span>
|
915
|
+
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
|
923
|
+
|
924
|
+
<span class="summary_desc"><div class='inline'>
|
925
|
+
<p>Set fake scraper name value.</p>
|
926
|
+
</div></span>
|
927
|
+
|
928
|
+
</li>
|
929
|
+
|
930
|
+
|
931
|
+
</ul>
|
932
|
+
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
<div id="instance_attr_details" class="attr_details">
|
937
|
+
<h2>Instance Attribute Details</h2>
|
938
|
+
|
939
|
+
|
940
|
+
<span id="content=-instance_method"></span>
|
941
|
+
<div class="method_details first">
|
942
|
+
<h3 class="signature first" id="content-instance_method">
|
943
|
+
|
944
|
+
#<strong>content</strong> ⇒ <tt>String</tt><sup>?</sup>
|
945
|
+
|
946
|
+
|
947
|
+
|
948
|
+
|
949
|
+
|
950
|
+
</h3><div class="docstring">
|
951
|
+
<div class="discussion">
|
952
|
+
|
953
|
+
<p>Page content.</p>
|
954
|
+
|
955
|
+
|
956
|
+
</div>
|
957
|
+
</div>
|
958
|
+
<div class="tags">
|
959
|
+
|
960
|
+
<p class="tag_title">Returns:</p>
|
961
|
+
<ul class="return">
|
962
|
+
|
963
|
+
<li>
|
964
|
+
|
965
|
+
|
966
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
967
|
+
|
968
|
+
|
969
|
+
|
970
|
+
</li>
|
971
|
+
|
972
|
+
</ul>
|
973
|
+
|
974
|
+
</div><table class="source_code">
|
975
|
+
<tr>
|
976
|
+
<td>
|
977
|
+
<pre class="lines">
|
978
|
+
|
979
|
+
|
980
|
+
13
|
981
|
+
14
|
982
|
+
15</pre>
|
983
|
+
</td>
|
984
|
+
<td>
|
985
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 13</span>
|
986
|
+
|
987
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span>
|
988
|
+
<span class='ivar'>@content</span>
|
989
|
+
<span class='kw'>end</span></pre>
|
990
|
+
</td>
|
991
|
+
</tr>
|
992
|
+
</table>
|
993
|
+
</div>
|
994
|
+
|
995
|
+
|
996
|
+
<span id="failed_content=-instance_method"></span>
|
997
|
+
<div class="method_details ">
|
998
|
+
<h3 class="signature " id="failed_content-instance_method">
|
999
|
+
|
1000
|
+
#<strong>failed_content</strong> ⇒ <tt>String</tt><sup>?</sup>
|
1001
|
+
|
1002
|
+
|
1003
|
+
|
1004
|
+
|
1005
|
+
|
1006
|
+
</h3><div class="docstring">
|
1007
|
+
<div class="discussion">
|
1008
|
+
|
1009
|
+
<p>Failed page content.</p>
|
1010
|
+
|
1011
|
+
|
1012
|
+
</div>
|
1013
|
+
</div>
|
1014
|
+
<div class="tags">
|
1015
|
+
|
1016
|
+
<p class="tag_title">Returns:</p>
|
1017
|
+
<ul class="return">
|
1018
|
+
|
1019
|
+
<li>
|
1020
|
+
|
1021
|
+
|
1022
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
1023
|
+
|
1024
|
+
|
1025
|
+
|
1026
|
+
</li>
|
1027
|
+
|
1028
|
+
</ul>
|
1029
|
+
|
1030
|
+
</div><table class="source_code">
|
1031
|
+
<tr>
|
1032
|
+
<td>
|
1033
|
+
<pre class="lines">
|
1034
|
+
|
1035
|
+
|
1036
|
+
16
|
1037
|
+
17
|
1038
|
+
18</pre>
|
1039
|
+
</td>
|
1040
|
+
<td>
|
1041
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 16</span>
|
1042
|
+
|
1043
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_failed_content'>failed_content</span>
|
1044
|
+
<span class='ivar'>@failed_content</span>
|
1045
|
+
<span class='kw'>end</span></pre>
|
1046
|
+
</td>
|
1047
|
+
</tr>
|
1048
|
+
</table>
|
1049
|
+
</div>
|
1050
|
+
|
1051
|
+
</div>
|
1052
|
+
|
1053
|
+
|
1054
|
+
<div id="instance_method_details" class="method_details_list">
|
1055
|
+
<h2>Instance Method Details</h2>
|
1056
|
+
|
1057
|
+
|
1058
|
+
<div class="method_details first">
|
1059
|
+
<h3 class="signature first" id="db-instance_method">
|
1060
|
+
|
1061
|
+
#<strong>db</strong> ⇒ <tt>Object</tt>
|
1062
|
+
|
1063
|
+
|
1064
|
+
|
1065
|
+
|
1066
|
+
|
1067
|
+
</h3><div class="docstring">
|
1068
|
+
<div class="discussion">
|
1069
|
+
|
1070
|
+
<p>Fake database to represent what it is saved.</p>
|
1071
|
+
|
1072
|
+
|
1073
|
+
</div>
|
1074
|
+
</div>
|
1075
|
+
<div class="tags">
|
1076
|
+
|
1077
|
+
|
1078
|
+
</div><table class="source_code">
|
1079
|
+
<tr>
|
1080
|
+
<td>
|
1081
|
+
<pre class="lines">
|
1082
|
+
|
1083
|
+
|
1084
|
+
75
|
1085
|
+
76
|
1086
|
+
77</pre>
|
1087
|
+
</td>
|
1088
|
+
<td>
|
1089
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 75</span>
|
1090
|
+
|
1091
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_db'>db</span>
|
1092
|
+
<span class='ivar'>@db</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../../../DhEasy.html" title="DhEasy (module)">DhEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Core.html" title="DhEasy::Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Mock.html" title="DhEasy::Core::Mock (module)">Mock</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FakeDb.html" title="DhEasy::Core::Mock::FakeDb (class)">FakeDb</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FakeDb.html#initialize-instance_method" title="DhEasy::Core::Mock::FakeDb#initialize (method)">new</a></span></span>
|
1093
|
+
<span class='kw'>end</span></pre>
|
1094
|
+
</td>
|
1095
|
+
</tr>
|
1096
|
+
</table>
|
1097
|
+
</div>
|
1098
|
+
|
1099
|
+
<div class="method_details ">
|
1100
|
+
<h3 class="signature " id="execute_script-instance_method">
|
1101
|
+
|
1102
|
+
#<strong>execute_script</strong>(file_path, vars = {}) ⇒ <tt>Object</tt>
|
1103
|
+
|
1104
|
+
|
1105
|
+
|
1106
|
+
|
1107
|
+
|
1108
|
+
</h3><div class="docstring">
|
1109
|
+
<div class="discussion">
|
1110
|
+
|
1111
|
+
<p>Execute an script file as an executor.</p>
|
1112
|
+
|
1113
|
+
|
1114
|
+
</div>
|
1115
|
+
</div>
|
1116
|
+
<div class="tags">
|
1117
|
+
<p class="tag_title">Parameters:</p>
|
1118
|
+
<ul class="param">
|
1119
|
+
|
1120
|
+
<li>
|
1121
|
+
|
1122
|
+
<span class='name'>file_path</span>
|
1123
|
+
|
1124
|
+
|
1125
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1126
|
+
|
1127
|
+
|
1128
|
+
|
1129
|
+
—
|
1130
|
+
<div class='inline'>
|
1131
|
+
<p>Script file path to execute.</p>
|
1132
|
+
</div>
|
1133
|
+
|
1134
|
+
</li>
|
1135
|
+
|
1136
|
+
</ul>
|
1137
|
+
|
1138
|
+
|
1139
|
+
</div><table class="source_code">
|
1140
|
+
<tr>
|
1141
|
+
<td>
|
1142
|
+
<pre class="lines">
|
1143
|
+
|
1144
|
+
|
1145
|
+
342
|
1146
|
+
343
|
1147
|
+
344
|
1148
|
+
345</pre>
|
1149
|
+
</td>
|
1150
|
+
<td>
|
1151
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 342</span>
|
1152
|
+
|
1153
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_execute_script'>execute_script</span> <span class='id identifier rubyid_file_path'>file_path</span><span class='comma'>,</span> <span class='id identifier rubyid_vars'>vars</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1154
|
+
<span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_isolated_binding'>isolated_binding</span><span class='lparen'>(</span><span class='id identifier rubyid_vars'>vars</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
1155
|
+
<span class='id identifier rubyid_flush'>flush</span>
|
1156
|
+
<span class='kw'>end</span></pre>
|
1157
|
+
</td>
|
1158
|
+
</tr>
|
1159
|
+
</table>
|
1160
|
+
</div>
|
1161
|
+
|
1162
|
+
<div class="method_details ">
|
1163
|
+
<h3 class="signature " id="find_output-instance_method">
|
1164
|
+
|
1165
|
+
#<strong>find_output</strong>(collection = 'default', query = {}, opts = {}) ⇒ <tt>Hash</tt><sup>?</sup>
|
1166
|
+
|
1167
|
+
|
1168
|
+
|
1169
|
+
|
1170
|
+
|
1171
|
+
</h3><div class="docstring">
|
1172
|
+
<div class="discussion">
|
1173
|
+
|
1174
|
+
<div class="note notetag">
|
1175
|
+
<strong>Note:</strong>
|
1176
|
+
<div class='inline'>
|
1177
|
+
<p>*opts `:job_id` option is prioritize over `:scraper_name` when both exists.
|
1178
|
+
If none add provided or nil values, then current job will be used to query
|
1179
|
+
instead, this is the defaul behavior.</p>
|
1180
|
+
</div>
|
1181
|
+
</div>
|
1182
|
+
|
1183
|
+
|
1184
|
+
<p>Find one output by collection and query with pagination.</p>
|
1185
|
+
|
1186
|
+
|
1187
|
+
</div>
|
1188
|
+
</div>
|
1189
|
+
<div class="tags">
|
1190
|
+
|
1191
|
+
<div class="examples">
|
1192
|
+
<p class="tag_title">Examples:</p>
|
1193
|
+
|
1194
|
+
|
1195
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_output'>find_output</span></code></pre>
|
1196
|
+
|
1197
|
+
|
1198
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_output'>find_output</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span></code></pre>
|
1199
|
+
|
1200
|
+
|
1201
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_output'>find_output</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span></code></pre>
|
1202
|
+
|
1203
|
+
|
1204
|
+
<p class="example_title"><div class='inline'>
|
1205
|
+
<p>Find from another scraper by name</p>
|
1206
|
+
</div></p>
|
1207
|
+
|
1208
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_output'>find_output</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>scraper_name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_scraper</span><span class='tstring_end'>'</span></span></code></pre>
|
1209
|
+
|
1210
|
+
|
1211
|
+
<p class="example_title"><div class='inline'>
|
1212
|
+
<p>Find from another scraper by job_id</p>
|
1213
|
+
</div></p>
|
1214
|
+
|
1215
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_output'>find_output</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>job_id:</span> <span class='int'>123</span></code></pre>
|
1216
|
+
|
1217
|
+
</div>
|
1218
|
+
<p class="tag_title">Parameters:</p>
|
1219
|
+
<ul class="param">
|
1220
|
+
|
1221
|
+
<li>
|
1222
|
+
|
1223
|
+
<span class='name'>collection</span>
|
1224
|
+
|
1225
|
+
|
1226
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1227
|
+
|
1228
|
+
|
1229
|
+
<em class="default">(defaults to: <tt>'default'</tt>)</em>
|
1230
|
+
|
1231
|
+
|
1232
|
+
—
|
1233
|
+
<div class='inline'>
|
1234
|
+
<p>('default') Collection name.</p>
|
1235
|
+
</div>
|
1236
|
+
|
1237
|
+
</li>
|
1238
|
+
|
1239
|
+
<li>
|
1240
|
+
|
1241
|
+
<span class='name'>query</span>
|
1242
|
+
|
1243
|
+
|
1244
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1245
|
+
|
1246
|
+
|
1247
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1248
|
+
|
1249
|
+
|
1250
|
+
—
|
1251
|
+
<div class='inline'>
|
1252
|
+
<p>({}) Filters to query.</p>
|
1253
|
+
</div>
|
1254
|
+
|
1255
|
+
</li>
|
1256
|
+
|
1257
|
+
<li>
|
1258
|
+
|
1259
|
+
<span class='name'>opts</span>
|
1260
|
+
|
1261
|
+
|
1262
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1263
|
+
|
1264
|
+
|
1265
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1266
|
+
|
1267
|
+
|
1268
|
+
—
|
1269
|
+
<div class='inline'>
|
1270
|
+
<p>({}) Configuration options.</p>
|
1271
|
+
</div>
|
1272
|
+
|
1273
|
+
</li>
|
1274
|
+
|
1275
|
+
</ul>
|
1276
|
+
|
1277
|
+
|
1278
|
+
|
1279
|
+
|
1280
|
+
|
1281
|
+
|
1282
|
+
|
1283
|
+
|
1284
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
1285
|
+
<ul class="option">
|
1286
|
+
|
1287
|
+
<li>
|
1288
|
+
<span class="name">:scraper_name</span>
|
1289
|
+
<span class="type">(<tt>String</tt>, <tt>nil</tt>)</span>
|
1290
|
+
<span class="default">
|
1291
|
+
|
1292
|
+
— default:
|
1293
|
+
<tt>nil</tt>
|
1294
|
+
|
1295
|
+
</span>
|
1296
|
+
|
1297
|
+
— <div class='inline'>
|
1298
|
+
<p>Scraper name to query from.</p>
|
1299
|
+
</div>
|
1300
|
+
|
1301
|
+
</li>
|
1302
|
+
|
1303
|
+
<li>
|
1304
|
+
<span class="name">:job_id</span>
|
1305
|
+
<span class="type">(<tt>Integer</tt>, <tt>nil</tt>)</span>
|
1306
|
+
<span class="default">
|
1307
|
+
|
1308
|
+
— default:
|
1309
|
+
<tt>nil</tt>
|
1310
|
+
|
1311
|
+
</span>
|
1312
|
+
|
1313
|
+
— <div class='inline'>
|
1314
|
+
<p>Job's id to query from.</p>
|
1315
|
+
</div>
|
1316
|
+
|
1317
|
+
</li>
|
1318
|
+
|
1319
|
+
</ul>
|
1320
|
+
|
1321
|
+
|
1322
|
+
<p class="tag_title">Returns:</p>
|
1323
|
+
<ul class="return">
|
1324
|
+
|
1325
|
+
<li>
|
1326
|
+
|
1327
|
+
|
1328
|
+
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
1329
|
+
|
1330
|
+
|
1331
|
+
|
1332
|
+
</li>
|
1333
|
+
|
1334
|
+
</ul>
|
1335
|
+
<p class="tag_title">Raises:</p>
|
1336
|
+
<ul class="raise">
|
1337
|
+
|
1338
|
+
<li>
|
1339
|
+
|
1340
|
+
|
1341
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1342
|
+
|
1343
|
+
|
1344
|
+
|
1345
|
+
—
|
1346
|
+
<div class='inline'>
|
1347
|
+
<p><code>collection</code> is not String.</p>
|
1348
|
+
</div>
|
1349
|
+
|
1350
|
+
</li>
|
1351
|
+
|
1352
|
+
<li>
|
1353
|
+
|
1354
|
+
|
1355
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1356
|
+
|
1357
|
+
|
1358
|
+
|
1359
|
+
—
|
1360
|
+
<div class='inline'>
|
1361
|
+
<p><code>query</code> is not a Hash.</p>
|
1362
|
+
</div>
|
1363
|
+
|
1364
|
+
</li>
|
1365
|
+
|
1366
|
+
</ul>
|
1367
|
+
|
1368
|
+
</div><table class="source_code">
|
1369
|
+
<tr>
|
1370
|
+
<td>
|
1371
|
+
<pre class="lines">
|
1372
|
+
|
1373
|
+
|
1374
|
+
334
|
1375
|
+
335
|
1376
|
+
336
|
1377
|
+
337</pre>
|
1378
|
+
</td>
|
1379
|
+
<td>
|
1380
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 334</span>
|
1381
|
+
|
1382
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_output'>find_output</span> <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>default</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1383
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_find_outputs'>find_outputs</span><span class='lparen'>(</span><span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
1384
|
+
<span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1385
|
+
<span class='kw'>end</span></pre>
|
1386
|
+
</td>
|
1387
|
+
</tr>
|
1388
|
+
</table>
|
1389
|
+
</div>
|
1390
|
+
|
1391
|
+
<div class="method_details ">
|
1392
|
+
<h3 class="signature " id="find_outputs-instance_method">
|
1393
|
+
|
1394
|
+
#<strong>find_outputs</strong>(collection = 'default', query = {}, page = 1, per_page = 30, opts = {}) ⇒ <tt>Array</tt>
|
1395
|
+
|
1396
|
+
|
1397
|
+
|
1398
|
+
|
1399
|
+
|
1400
|
+
</h3><div class="docstring">
|
1401
|
+
<div class="discussion">
|
1402
|
+
|
1403
|
+
<div class="note notetag">
|
1404
|
+
<strong>Note:</strong>
|
1405
|
+
<div class='inline'>
|
1406
|
+
<p>*opts `:job_id` option is prioritize over `:scraper_name` when both exists.
|
1407
|
+
If none add provided or nil values, then current job will be used to query
|
1408
|
+
instead, this is the defaul behavior.</p>
|
1409
|
+
</div>
|
1410
|
+
</div>
|
1411
|
+
|
1412
|
+
|
1413
|
+
<p>Find outputs by collection and query with pagination.</p>
|
1414
|
+
|
1415
|
+
|
1416
|
+
</div>
|
1417
|
+
</div>
|
1418
|
+
<div class="tags">
|
1419
|
+
|
1420
|
+
<div class="examples">
|
1421
|
+
<p class="tag_title">Examples:</p>
|
1422
|
+
|
1423
|
+
|
1424
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span></code></pre>
|
1425
|
+
|
1426
|
+
|
1427
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span></code></pre>
|
1428
|
+
|
1429
|
+
|
1430
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span></code></pre>
|
1431
|
+
|
1432
|
+
|
1433
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='int'>1</span></code></pre>
|
1434
|
+
|
1435
|
+
|
1436
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>30</span></code></pre>
|
1437
|
+
|
1438
|
+
|
1439
|
+
<p class="example_title"><div class='inline'>
|
1440
|
+
<p>Find from another scraper by name</p>
|
1441
|
+
</div></p>
|
1442
|
+
|
1443
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='label'>scraper_name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_scraper</span><span class='tstring_end'>'</span></span></code></pre>
|
1444
|
+
|
1445
|
+
|
1446
|
+
<p class="example_title"><div class='inline'>
|
1447
|
+
<p>Find from another scraper by job_id</p>
|
1448
|
+
</div></p>
|
1449
|
+
|
1450
|
+
<pre class="example code"><code><span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>my_collection</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>30</span><span class='comma'>,</span> <span class='label'>job_id:</span> <span class='int'>123</span></code></pre>
|
1451
|
+
|
1452
|
+
</div>
|
1453
|
+
<p class="tag_title">Parameters:</p>
|
1454
|
+
<ul class="param">
|
1455
|
+
|
1456
|
+
<li>
|
1457
|
+
|
1458
|
+
<span class='name'>collection</span>
|
1459
|
+
|
1460
|
+
|
1461
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1462
|
+
|
1463
|
+
|
1464
|
+
<em class="default">(defaults to: <tt>'default'</tt>)</em>
|
1465
|
+
|
1466
|
+
|
1467
|
+
—
|
1468
|
+
<div class='inline'>
|
1469
|
+
<p>('default') Collection name.</p>
|
1470
|
+
</div>
|
1471
|
+
|
1472
|
+
</li>
|
1473
|
+
|
1474
|
+
<li>
|
1475
|
+
|
1476
|
+
<span class='name'>query</span>
|
1477
|
+
|
1478
|
+
|
1479
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1480
|
+
|
1481
|
+
|
1482
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1483
|
+
|
1484
|
+
|
1485
|
+
—
|
1486
|
+
<div class='inline'>
|
1487
|
+
<p>({}) Filters to query.</p>
|
1488
|
+
</div>
|
1489
|
+
|
1490
|
+
</li>
|
1491
|
+
|
1492
|
+
<li>
|
1493
|
+
|
1494
|
+
<span class='name'>page</span>
|
1495
|
+
|
1496
|
+
|
1497
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1498
|
+
|
1499
|
+
|
1500
|
+
<em class="default">(defaults to: <tt>1</tt>)</em>
|
1501
|
+
|
1502
|
+
|
1503
|
+
—
|
1504
|
+
<div class='inline'>
|
1505
|
+
<p>(1) Page number.</p>
|
1506
|
+
</div>
|
1507
|
+
|
1508
|
+
</li>
|
1509
|
+
|
1510
|
+
<li>
|
1511
|
+
|
1512
|
+
<span class='name'>per_page</span>
|
1513
|
+
|
1514
|
+
|
1515
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1516
|
+
|
1517
|
+
|
1518
|
+
<em class="default">(defaults to: <tt>30</tt>)</em>
|
1519
|
+
|
1520
|
+
|
1521
|
+
—
|
1522
|
+
<div class='inline'>
|
1523
|
+
<p>(30) Page size.</p>
|
1524
|
+
</div>
|
1525
|
+
|
1526
|
+
</li>
|
1527
|
+
|
1528
|
+
<li>
|
1529
|
+
|
1530
|
+
<span class='name'>opts</span>
|
1531
|
+
|
1532
|
+
|
1533
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1534
|
+
|
1535
|
+
|
1536
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1537
|
+
|
1538
|
+
|
1539
|
+
—
|
1540
|
+
<div class='inline'>
|
1541
|
+
<p>({}) Configuration options.</p>
|
1542
|
+
</div>
|
1543
|
+
|
1544
|
+
</li>
|
1545
|
+
|
1546
|
+
</ul>
|
1547
|
+
|
1548
|
+
|
1549
|
+
|
1550
|
+
|
1551
|
+
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1555
|
+
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
1560
|
+
<ul class="option">
|
1561
|
+
|
1562
|
+
<li>
|
1563
|
+
<span class="name">:scraper_name</span>
|
1564
|
+
<span class="type">(<tt>String</tt>, <tt>nil</tt>)</span>
|
1565
|
+
<span class="default">
|
1566
|
+
|
1567
|
+
— default:
|
1568
|
+
<tt>nil</tt>
|
1569
|
+
|
1570
|
+
</span>
|
1571
|
+
|
1572
|
+
— <div class='inline'>
|
1573
|
+
<p>Scraper name to query from.</p>
|
1574
|
+
</div>
|
1575
|
+
|
1576
|
+
</li>
|
1577
|
+
|
1578
|
+
<li>
|
1579
|
+
<span class="name">:job_id</span>
|
1580
|
+
<span class="type">(<tt>Integer</tt>, <tt>nil</tt>)</span>
|
1581
|
+
<span class="default">
|
1582
|
+
|
1583
|
+
— default:
|
1584
|
+
<tt>nil</tt>
|
1585
|
+
|
1586
|
+
</span>
|
1587
|
+
|
1588
|
+
— <div class='inline'>
|
1589
|
+
<p>Job's id to query from.</p>
|
1590
|
+
</div>
|
1591
|
+
|
1592
|
+
</li>
|
1593
|
+
|
1594
|
+
</ul>
|
1595
|
+
|
1596
|
+
|
1597
|
+
<p class="tag_title">Returns:</p>
|
1598
|
+
<ul class="return">
|
1599
|
+
|
1600
|
+
<li>
|
1601
|
+
|
1602
|
+
|
1603
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1604
|
+
|
1605
|
+
|
1606
|
+
|
1607
|
+
</li>
|
1608
|
+
|
1609
|
+
</ul>
|
1610
|
+
<p class="tag_title">Raises:</p>
|
1611
|
+
<ul class="raise">
|
1612
|
+
|
1613
|
+
<li>
|
1614
|
+
|
1615
|
+
|
1616
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1617
|
+
|
1618
|
+
|
1619
|
+
|
1620
|
+
—
|
1621
|
+
<div class='inline'>
|
1622
|
+
<p><code>collection</code> is not String.</p>
|
1623
|
+
</div>
|
1624
|
+
|
1625
|
+
</li>
|
1626
|
+
|
1627
|
+
<li>
|
1628
|
+
|
1629
|
+
|
1630
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1631
|
+
|
1632
|
+
|
1633
|
+
|
1634
|
+
—
|
1635
|
+
<div class='inline'>
|
1636
|
+
<p><code>query</code> is not a Hash.</p>
|
1637
|
+
</div>
|
1638
|
+
|
1639
|
+
</li>
|
1640
|
+
|
1641
|
+
<li>
|
1642
|
+
|
1643
|
+
|
1644
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1645
|
+
|
1646
|
+
|
1647
|
+
|
1648
|
+
—
|
1649
|
+
<div class='inline'>
|
1650
|
+
<p><code>page</code> is not an Integer greater than 0.</p>
|
1651
|
+
</div>
|
1652
|
+
|
1653
|
+
</li>
|
1654
|
+
|
1655
|
+
<li>
|
1656
|
+
|
1657
|
+
|
1658
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1659
|
+
|
1660
|
+
|
1661
|
+
|
1662
|
+
—
|
1663
|
+
<div class='inline'>
|
1664
|
+
<p><code>per_page</code> is not an Integer between 1 and 500.</p>
|
1665
|
+
</div>
|
1666
|
+
|
1667
|
+
</li>
|
1668
|
+
|
1669
|
+
</ul>
|
1670
|
+
|
1671
|
+
</div><table class="source_code">
|
1672
|
+
<tr>
|
1673
|
+
<td>
|
1674
|
+
<pre class="lines">
|
1675
|
+
|
1676
|
+
|
1677
|
+
286
|
1678
|
+
287
|
1679
|
+
288
|
1680
|
+
289
|
1681
|
+
290
|
1682
|
+
291
|
1683
|
+
292
|
1684
|
+
293
|
1685
|
+
294
|
1686
|
+
295
|
1687
|
+
296
|
1688
|
+
297
|
1689
|
+
298
|
1690
|
+
299
|
1691
|
+
300
|
1692
|
+
301
|
1693
|
+
302
|
1694
|
+
303
|
1695
|
+
304</pre>
|
1696
|
+
</td>
|
1697
|
+
<td>
|
1698
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 286</span>
|
1699
|
+
|
1700
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_find_outputs'>find_outputs</span> <span class='id identifier rubyid_collection'>collection</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>default</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_page'>page</span> <span class='op'>=</span> <span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_per_page'>per_page</span> <span class='op'>=</span> <span class='int'>30</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1701
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>collection needs to be a String.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_collection'>collection</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
1702
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>query needs to be a Hash.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_query'>query</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
1703
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_page'>page</span> <span class='op'>></span> <span class='int'>0</span>
|
1704
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>page needs to be an Integer greater than 0.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1705
|
+
<span class='kw'>end</span>
|
1706
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_per_page'>per_page</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_per_page'>per_page</span> <span class='op'>></span> <span class='int'>0</span> <span class='op'>&&</span> <span class='id identifier rubyid_per_page'>per_page</span> <span class='op'><=</span> <span class='const'><span class='object_link'><a href="#MAX_FIND_OUTPUTS_PER_PAGE-constant" title="DhEasy::Core::Mock::FakeExecutor::MAX_FIND_OUTPUTS_PER_PAGE (constant)">MAX_FIND_OUTPUTS_PER_PAGE</a></span></span>
|
1707
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>per_page needs to be an Integer between 1 and </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#MAX_FIND_OUTPUTS_PER_PAGE-constant" title="DhEasy::Core::Mock::FakeExecutor::MAX_FIND_OUTPUTS_PER_PAGE (constant)">MAX_FIND_OUTPUTS_PER_PAGE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1708
|
+
<span class='kw'>end</span>
|
1709
|
+
|
1710
|
+
<span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>0</span>
|
1711
|
+
<span class='id identifier rubyid_offset'>offset</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='id identifier rubyid_per_page'>per_page</span>
|
1712
|
+
<span class='id identifier rubyid_job'>job</span> <span class='op'>=</span> <span class='id identifier rubyid_latest_job_by'>latest_job_by</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:scraper_name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1713
|
+
<span class='id identifier rubyid_fixed_query'>fixed_query</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
1714
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_collection</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_collection'>collection</span><span class='comma'>,</span>
|
1715
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_job_id</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:job_id</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_job_id'>job_id</span> <span class='op'>:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1716
|
+
<span class='rparen'>)</span>
|
1717
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span> <span class='symbol'>:outputs</span><span class='comma'>,</span> <span class='id identifier rubyid_fixed_query'>fixed_query</span><span class='comma'>,</span> <span class='id identifier rubyid_offset'>offset</span><span class='comma'>,</span> <span class='id identifier rubyid_per_page'>per_page</span>
|
1718
|
+
<span class='kw'>end</span></pre>
|
1719
|
+
</td>
|
1720
|
+
</tr>
|
1721
|
+
</table>
|
1722
|
+
</div>
|
1723
|
+
|
1724
|
+
<div class="method_details ">
|
1725
|
+
<h3 class="signature " id="flush-instance_method">
|
1726
|
+
|
1727
|
+
#<strong>flush</strong> ⇒ <tt>Object</tt>
|
1728
|
+
|
1729
|
+
|
1730
|
+
|
1731
|
+
|
1732
|
+
|
1733
|
+
</h3><div class="docstring">
|
1734
|
+
<div class="discussion">
|
1735
|
+
|
1736
|
+
<p>Save all drafts into db and clear draft queues.</p>
|
1737
|
+
|
1738
|
+
|
1739
|
+
</div>
|
1740
|
+
</div>
|
1741
|
+
<div class="tags">
|
1742
|
+
|
1743
|
+
|
1744
|
+
</div><table class="source_code">
|
1745
|
+
<tr>
|
1746
|
+
<td>
|
1747
|
+
<pre class="lines">
|
1748
|
+
|
1749
|
+
|
1750
|
+
231
|
1751
|
+
232
|
1752
|
+
233
|
1753
|
+
234
|
1754
|
+
235</pre>
|
1755
|
+
</td>
|
1756
|
+
<td>
|
1757
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 231</span>
|
1758
|
+
|
1759
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_flush'>flush</span>
|
1760
|
+
<span class='id identifier rubyid_flush_pages'>flush_pages</span>
|
1761
|
+
<span class='id identifier rubyid_flush_outputs'>flush_outputs</span>
|
1762
|
+
<span class='id identifier rubyid_flush_self_actions'>flush_self_actions</span>
|
1763
|
+
<span class='kw'>end</span></pre>
|
1764
|
+
</td>
|
1765
|
+
</tr>
|
1766
|
+
</table>
|
1767
|
+
</div>
|
1768
|
+
|
1769
|
+
<div class="method_details ">
|
1770
|
+
<h3 class="signature " id="flush_outputs-instance_method">
|
1771
|
+
|
1772
|
+
#<strong>flush_outputs</strong> ⇒ <tt>Object</tt>
|
1773
|
+
|
1774
|
+
|
1775
|
+
|
1776
|
+
|
1777
|
+
|
1778
|
+
</h3><div class="docstring">
|
1779
|
+
<div class="discussion">
|
1780
|
+
|
1781
|
+
<p>Save draft outputs into db and clear draft queue.</p>
|
1782
|
+
|
1783
|
+
|
1784
|
+
</div>
|
1785
|
+
</div>
|
1786
|
+
<div class="tags">
|
1787
|
+
|
1788
|
+
|
1789
|
+
</div><table class="source_code">
|
1790
|
+
<tr>
|
1791
|
+
<td>
|
1792
|
+
<pre class="lines">
|
1793
|
+
|
1794
|
+
|
1795
|
+
225
|
1796
|
+
226
|
1797
|
+
227
|
1798
|
+
228</pre>
|
1799
|
+
</td>
|
1800
|
+
<td>
|
1801
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 225</span>
|
1802
|
+
|
1803
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_flush_outputs'>flush_outputs</span>
|
1804
|
+
<span class='id identifier rubyid_save_outputs'>save_outputs</span> <span class='id identifier rubyid_outputs'>outputs</span>
|
1805
|
+
<span class='id identifier rubyid_clear_draft_outputs'>clear_draft_outputs</span>
|
1806
|
+
<span class='kw'>end</span></pre>
|
1807
|
+
</td>
|
1808
|
+
</tr>
|
1809
|
+
</table>
|
1810
|
+
</div>
|
1811
|
+
|
1812
|
+
<div class="method_details ">
|
1813
|
+
<h3 class="signature " id="flush_pages-instance_method">
|
1814
|
+
|
1815
|
+
#<strong>flush_pages</strong> ⇒ <tt>Object</tt>
|
1816
|
+
|
1817
|
+
|
1818
|
+
|
1819
|
+
|
1820
|
+
|
1821
|
+
</h3><div class="docstring">
|
1822
|
+
<div class="discussion">
|
1823
|
+
|
1824
|
+
<p>Save draft pages into db and clear draft queue.</p>
|
1825
|
+
|
1826
|
+
|
1827
|
+
</div>
|
1828
|
+
</div>
|
1829
|
+
<div class="tags">
|
1830
|
+
|
1831
|
+
|
1832
|
+
</div><table class="source_code">
|
1833
|
+
<tr>
|
1834
|
+
<td>
|
1835
|
+
<pre class="lines">
|
1836
|
+
|
1837
|
+
|
1838
|
+
219
|
1839
|
+
220
|
1840
|
+
221
|
1841
|
+
222</pre>
|
1842
|
+
</td>
|
1843
|
+
<td>
|
1844
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 219</span>
|
1845
|
+
|
1846
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_flush_pages'>flush_pages</span>
|
1847
|
+
<span class='id identifier rubyid_save_pages'>save_pages</span> <span class='id identifier rubyid_pages'>pages</span>
|
1848
|
+
<span class='id identifier rubyid_clear_draft_pages'>clear_draft_pages</span>
|
1849
|
+
<span class='kw'>end</span></pre>
|
1850
|
+
</td>
|
1851
|
+
</tr>
|
1852
|
+
</table>
|
1853
|
+
</div>
|
1854
|
+
|
1855
|
+
<div class="method_details ">
|
1856
|
+
<h3 class="signature " id="flush_self_actions-instance_method">
|
1857
|
+
|
1858
|
+
#<strong>flush_self_actions</strong> ⇒ <tt>Object</tt>
|
1859
|
+
|
1860
|
+
|
1861
|
+
|
1862
|
+
|
1863
|
+
|
1864
|
+
</h3><div class="docstring">
|
1865
|
+
<div class="discussion">
|
1866
|
+
|
1867
|
+
<p>Execute any action applied to current page</p>
|
1868
|
+
|
1869
|
+
|
1870
|
+
</div>
|
1871
|
+
</div>
|
1872
|
+
<div class="tags">
|
1873
|
+
|
1874
|
+
|
1875
|
+
</div><table class="source_code">
|
1876
|
+
<tr>
|
1877
|
+
<td>
|
1878
|
+
<pre class="lines">
|
1879
|
+
|
1880
|
+
|
1881
|
+
206
|
1882
|
+
207
|
1883
|
+
208
|
1884
|
+
209
|
1885
|
+
210
|
1886
|
+
211
|
1887
|
+
212
|
1888
|
+
213
|
1889
|
+
214
|
1890
|
+
215
|
1891
|
+
216</pre>
|
1892
|
+
</td>
|
1893
|
+
<td>
|
1894
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 206</span>
|
1895
|
+
|
1896
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_flush_self_actions'>flush_self_actions</span>
|
1897
|
+
<span class='comment'># Save page current page before refetch/reparse
|
1898
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_refetch_self'>refetch_self</span> <span class='op'>||</span> <span class='id identifier rubyid_reparse_self'>reparse_self</span>
|
1899
|
+
<span class='id identifier rubyid_temp_page_gid_override'>temp_page_gid_override</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_allow_page_gid_override?'>allow_page_gid_override?</span>
|
1900
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_enable_page_gid_override'>enable_page_gid_override</span> <span class='kw'>if</span> <span class='id identifier rubyid_temp_page_gid_override'>temp_page_gid_override</span>
|
1901
|
+
<span class='id identifier rubyid_save_pages'>save_pages</span> <span class='lbracket'>[</span><span class='id identifier rubyid_page'>page</span><span class='rbracket'>]</span>
|
1902
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_disable_page_gid_override'>disable_page_gid_override</span> <span class='kw'>if</span> <span class='id identifier rubyid_temp_page_gid_override'>temp_page_gid_override</span>
|
1903
|
+
<span class='kw'>end</span>
|
1904
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_refetch'>refetch</span><span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_refetch_self'>refetch_self</span>
|
1905
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_reparse'>reparse</span><span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_reparse_self'>reparse_self</span>
|
1906
|
+
<span class='kw'>end</span></pre>
|
1907
|
+
</td>
|
1908
|
+
</tr>
|
1909
|
+
</table>
|
1910
|
+
</div>
|
1911
|
+
|
1912
|
+
<div class="method_details ">
|
1913
|
+
<h3 class="signature " id="initialize-instance_method">
|
1914
|
+
|
1915
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt>Object</tt>
|
1916
|
+
|
1917
|
+
|
1918
|
+
|
1919
|
+
|
1920
|
+
|
1921
|
+
</h3><div class="docstring">
|
1922
|
+
<div class="discussion">
|
1923
|
+
|
1924
|
+
<p>Initialize object.</p>
|
1925
|
+
|
1926
|
+
|
1927
|
+
</div>
|
1928
|
+
</div>
|
1929
|
+
<div class="tags">
|
1930
|
+
<p class="tag_title">Parameters:</p>
|
1931
|
+
<ul class="param">
|
1932
|
+
|
1933
|
+
<li>
|
1934
|
+
|
1935
|
+
<span class='name'>opts</span>
|
1936
|
+
|
1937
|
+
|
1938
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1939
|
+
|
1940
|
+
|
1941
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1942
|
+
|
1943
|
+
|
1944
|
+
—
|
1945
|
+
<div class='inline'>
|
1946
|
+
<p>({}) Configuration options.</p>
|
1947
|
+
</div>
|
1948
|
+
|
1949
|
+
</li>
|
1950
|
+
|
1951
|
+
</ul>
|
1952
|
+
|
1953
|
+
|
1954
|
+
|
1955
|
+
|
1956
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
1957
|
+
<ul class="option">
|
1958
|
+
|
1959
|
+
<li>
|
1960
|
+
<span class="name">:pages</span>
|
1961
|
+
<span class="type">(<tt>Array</tt>)</span>
|
1962
|
+
<span class="default">
|
1963
|
+
|
1964
|
+
— default:
|
1965
|
+
<tt>nil</tt>
|
1966
|
+
|
1967
|
+
</span>
|
1968
|
+
|
1969
|
+
— <div class='inline'>
|
1970
|
+
<p>Array to initialize pages, can be nil for empty.</p>
|
1971
|
+
</div>
|
1972
|
+
|
1973
|
+
</li>
|
1974
|
+
|
1975
|
+
<li>
|
1976
|
+
<span class="name">:outputs</span>
|
1977
|
+
<span class="type">(<tt>Array</tt>)</span>
|
1978
|
+
<span class="default">
|
1979
|
+
|
1980
|
+
— default:
|
1981
|
+
<tt>nil</tt>
|
1982
|
+
|
1983
|
+
</span>
|
1984
|
+
|
1985
|
+
— <div class='inline'>
|
1986
|
+
<p>Array to initialize outputs, can be nil for empty.</p>
|
1987
|
+
</div>
|
1988
|
+
|
1989
|
+
</li>
|
1990
|
+
|
1991
|
+
<li>
|
1992
|
+
<span class="name">:job_id</span>
|
1993
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
1994
|
+
<span class="default">
|
1995
|
+
|
1996
|
+
— default:
|
1997
|
+
<tt>nil</tt>
|
1998
|
+
|
1999
|
+
</span>
|
2000
|
+
|
2001
|
+
— <div class='inline'>
|
2002
|
+
<p>A number to represent the job_id.</p>
|
2003
|
+
</div>
|
2004
|
+
|
2005
|
+
</li>
|
2006
|
+
|
2007
|
+
<li>
|
2008
|
+
<span class="name">:page</span>
|
2009
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
2010
|
+
<span class="default">
|
2011
|
+
|
2012
|
+
— default:
|
2013
|
+
<tt>nil</tt>
|
2014
|
+
|
2015
|
+
</span>
|
2016
|
+
|
2017
|
+
— <div class='inline'>
|
2018
|
+
<p>Current page.</p>
|
2019
|
+
</div>
|
2020
|
+
|
2021
|
+
</li>
|
2022
|
+
|
2023
|
+
</ul>
|
2024
|
+
|
2025
|
+
|
2026
|
+
<p class="tag_title">Raises:</p>
|
2027
|
+
<ul class="raise">
|
2028
|
+
|
2029
|
+
<li>
|
2030
|
+
|
2031
|
+
|
2032
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
2033
|
+
|
2034
|
+
|
2035
|
+
|
2036
|
+
—
|
2037
|
+
<div class='inline'>
|
2038
|
+
<p>When pages or outputs are not Array.</p>
|
2039
|
+
</div>
|
2040
|
+
|
2041
|
+
</li>
|
2042
|
+
|
2043
|
+
</ul>
|
2044
|
+
|
2045
|
+
</div><table class="source_code">
|
2046
|
+
<tr>
|
2047
|
+
<td>
|
2048
|
+
<pre class="lines">
|
2049
|
+
|
2050
|
+
|
2051
|
+
88
|
2052
|
+
89
|
2053
|
+
90
|
2054
|
+
91
|
2055
|
+
92
|
2056
|
+
93
|
2057
|
+
94
|
2058
|
+
95
|
2059
|
+
96
|
2060
|
+
97
|
2061
|
+
98
|
2062
|
+
99
|
2063
|
+
100</pre>
|
2064
|
+
</td>
|
2065
|
+
<td>
|
2066
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 88</span>
|
2067
|
+
|
2068
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
2069
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:pages</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:pages</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
|
2070
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Pages must be an array.</span><span class='tstring_end'>"</span></span>
|
2071
|
+
<span class='kw'>end</span>
|
2072
|
+
<span class='ivar'>@pages</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:pages</span><span class='rbracket'>]</span>
|
2073
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:outputs</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:outputs</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
|
2074
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Outputs must be an array.</span><span class='tstring_end'>"</span></span>
|
2075
|
+
<span class='kw'>end</span>
|
2076
|
+
<span class='ivar'>@outputs</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:outputs</span><span class='rbracket'>]</span>
|
2077
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_job_id'>job_id</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:job_id</span><span class='rbracket'>]</span>
|
2078
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_scraper_name'>scraper_name</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:scraper_name</span><span class='rbracket'>]</span>
|
2079
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_page'>page</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:page</span><span class='rbracket'>]</span>
|
2080
|
+
<span class='kw'>end</span></pre>
|
2081
|
+
</td>
|
2082
|
+
</tr>
|
2083
|
+
</table>
|
2084
|
+
</div>
|
2085
|
+
|
2086
|
+
<div class="method_details ">
|
2087
|
+
<h3 class="signature " id="job_id-instance_method">
|
2088
|
+
|
2089
|
+
#<strong>job_id</strong> ⇒ <tt>Integer</tt><sup>?</sup>
|
2090
|
+
|
2091
|
+
|
2092
|
+
|
2093
|
+
|
2094
|
+
|
2095
|
+
</h3><div class="docstring">
|
2096
|
+
<div class="discussion">
|
2097
|
+
|
2098
|
+
<p>Fake job ID used by executor.</p>
|
2099
|
+
|
2100
|
+
|
2101
|
+
</div>
|
2102
|
+
</div>
|
2103
|
+
<div class="tags">
|
2104
|
+
|
2105
|
+
<p class="tag_title">Returns:</p>
|
2106
|
+
<ul class="return">
|
2107
|
+
|
2108
|
+
<li>
|
2109
|
+
|
2110
|
+
|
2111
|
+
<span class='type'>(<tt>Integer</tt>, <tt>nil</tt>)</span>
|
2112
|
+
|
2113
|
+
|
2114
|
+
|
2115
|
+
</li>
|
2116
|
+
|
2117
|
+
</ul>
|
2118
|
+
|
2119
|
+
</div><table class="source_code">
|
2120
|
+
<tr>
|
2121
|
+
<td>
|
2122
|
+
<pre class="lines">
|
2123
|
+
|
2124
|
+
|
2125
|
+
115
|
2126
|
+
116
|
2127
|
+
117</pre>
|
2128
|
+
</td>
|
2129
|
+
<td>
|
2130
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 115</span>
|
2131
|
+
|
2132
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_job_id'>job_id</span>
|
2133
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_job_id'>job_id</span>
|
2134
|
+
<span class='kw'>end</span></pre>
|
2135
|
+
</td>
|
2136
|
+
</tr>
|
2137
|
+
</table>
|
2138
|
+
</div>
|
2139
|
+
|
2140
|
+
<div class="method_details ">
|
2141
|
+
<h3 class="signature " id="job_id=-instance_method">
|
2142
|
+
|
2143
|
+
#<strong>job_id=</strong>(value) ⇒ <tt>Object</tt>
|
2144
|
+
|
2145
|
+
|
2146
|
+
|
2147
|
+
|
2148
|
+
|
2149
|
+
</h3><div class="docstring">
|
2150
|
+
<div class="discussion">
|
2151
|
+
|
2152
|
+
<p>Set fake job ID value.</p>
|
2153
|
+
|
2154
|
+
|
2155
|
+
</div>
|
2156
|
+
</div>
|
2157
|
+
<div class="tags">
|
2158
|
+
|
2159
|
+
|
2160
|
+
</div><table class="source_code">
|
2161
|
+
<tr>
|
2162
|
+
<td>
|
2163
|
+
<pre class="lines">
|
2164
|
+
|
2165
|
+
|
2166
|
+
120
|
2167
|
+
121
|
2168
|
+
122
|
2169
|
+
123</pre>
|
2170
|
+
</td>
|
2171
|
+
<td>
|
2172
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 120</span>
|
2173
|
+
|
2174
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_job_id='>job_id=</span> <span class='id identifier rubyid_value'>value</span>
|
2175
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_job_id'>job_id</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2176
|
+
<span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2177
|
+
<span class='kw'>end</span></pre>
|
2178
|
+
</td>
|
2179
|
+
</tr>
|
2180
|
+
</table>
|
2181
|
+
</div>
|
2182
|
+
|
2183
|
+
<div class="method_details ">
|
2184
|
+
<h3 class="signature " id="latest_job_by-instance_method">
|
2185
|
+
|
2186
|
+
#<strong>latest_job_by</strong>(scraper_name, filter = {}) ⇒ <tt>Hash</tt><sup>?</sup>
|
2187
|
+
|
2188
|
+
|
2189
|
+
|
2190
|
+
|
2191
|
+
|
2192
|
+
</h3><div class="docstring">
|
2193
|
+
<div class="discussion">
|
2194
|
+
|
2195
|
+
<p>Get latest job by scraper_name.</p>
|
2196
|
+
|
2197
|
+
|
2198
|
+
</div>
|
2199
|
+
</div>
|
2200
|
+
<div class="tags">
|
2201
|
+
<p class="tag_title">Parameters:</p>
|
2202
|
+
<ul class="param">
|
2203
|
+
|
2204
|
+
<li>
|
2205
|
+
|
2206
|
+
<span class='name'>scraper_name</span>
|
2207
|
+
|
2208
|
+
|
2209
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2210
|
+
|
2211
|
+
|
2212
|
+
|
2213
|
+
—
|
2214
|
+
<div class='inline'>
|
2215
|
+
<p>Scraper name.</p>
|
2216
|
+
</div>
|
2217
|
+
|
2218
|
+
</li>
|
2219
|
+
|
2220
|
+
<li>
|
2221
|
+
|
2222
|
+
<span class='name'>filter</span>
|
2223
|
+
|
2224
|
+
|
2225
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2226
|
+
|
2227
|
+
|
2228
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
2229
|
+
|
2230
|
+
|
2231
|
+
—
|
2232
|
+
<div class='inline'>
|
2233
|
+
<p>({}) Additional_filters.</p>
|
2234
|
+
</div>
|
2235
|
+
|
2236
|
+
</li>
|
2237
|
+
|
2238
|
+
</ul>
|
2239
|
+
|
2240
|
+
<p class="tag_title">Returns:</p>
|
2241
|
+
<ul class="return">
|
2242
|
+
|
2243
|
+
<li>
|
2244
|
+
|
2245
|
+
|
2246
|
+
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
2247
|
+
|
2248
|
+
|
2249
|
+
|
2250
|
+
—
|
2251
|
+
<div class='inline'>
|
2252
|
+
<p>Return nil if no scraper_name or scraper_name is nil.</p>
|
2253
|
+
</div>
|
2254
|
+
|
2255
|
+
</li>
|
2256
|
+
|
2257
|
+
</ul>
|
2258
|
+
|
2259
|
+
</div><table class="source_code">
|
2260
|
+
<tr>
|
2261
|
+
<td>
|
2262
|
+
<pre class="lines">
|
2263
|
+
|
2264
|
+
|
2265
|
+
244
|
2266
|
+
245
|
2267
|
+
246
|
2268
|
+
247
|
2269
|
+
248</pre>
|
2270
|
+
</td>
|
2271
|
+
<td>
|
2272
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 244</span>
|
2273
|
+
|
2274
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_latest_job_by'>latest_job_by</span> <span class='id identifier rubyid_scraper_name'>scraper_name</span><span class='comma'>,</span> <span class='id identifier rubyid_filter'>filter</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
2275
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_scraper_name'>scraper_name</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2276
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span> <span class='symbol'>:jobs</span><span class='comma'>,</span> <span class='id identifier rubyid_filter'>filter</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>scraper_name</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='id identifier rubyid_scraper_name'>scraper_name</span><span class='rparen'>)</span>
|
2277
|
+
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='comma'>,</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>created_at</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'><=></span> <span class='id identifier rubyid_b'>b</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>created_at</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
2278
|
+
<span class='kw'>end</span></pre>
|
2279
|
+
</td>
|
2280
|
+
</tr>
|
2281
|
+
</table>
|
2282
|
+
</div>
|
2283
|
+
|
2284
|
+
<div class="method_details ">
|
2285
|
+
<h3 class="signature " id="outputs-instance_method">
|
2286
|
+
|
2287
|
+
#<strong>outputs</strong> ⇒ <tt>Array</tt>
|
2288
|
+
|
2289
|
+
|
2290
|
+
|
2291
|
+
|
2292
|
+
|
2293
|
+
</h3><div class="docstring">
|
2294
|
+
<div class="discussion">
|
2295
|
+
|
2296
|
+
<p>Draft outputs, usually get saved after execution.</p>
|
2297
|
+
|
2298
|
+
|
2299
|
+
</div>
|
2300
|
+
</div>
|
2301
|
+
<div class="tags">
|
2302
|
+
|
2303
|
+
<p class="tag_title">Returns:</p>
|
2304
|
+
<ul class="return">
|
2305
|
+
|
2306
|
+
<li>
|
2307
|
+
|
2308
|
+
|
2309
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
2310
|
+
|
2311
|
+
|
2312
|
+
|
2313
|
+
</li>
|
2314
|
+
|
2315
|
+
</ul>
|
2316
|
+
|
2317
|
+
</div><table class="source_code">
|
2318
|
+
<tr>
|
2319
|
+
<td>
|
2320
|
+
<pre class="lines">
|
2321
|
+
|
2322
|
+
|
2323
|
+
58
|
2324
|
+
59
|
2325
|
+
60</pre>
|
2326
|
+
</td>
|
2327
|
+
<td>
|
2328
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 58</span>
|
2329
|
+
|
2330
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_outputs'>outputs</span>
|
2331
|
+
<span class='ivar'>@outputs</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
2332
|
+
<span class='kw'>end</span></pre>
|
2333
|
+
</td>
|
2334
|
+
</tr>
|
2335
|
+
</table>
|
2336
|
+
</div>
|
2337
|
+
|
2338
|
+
<div class="method_details ">
|
2339
|
+
<h3 class="signature " id="page-instance_method">
|
2340
|
+
|
2341
|
+
#<strong>page</strong> ⇒ <tt>Hash</tt><sup>?</sup>
|
2342
|
+
|
2343
|
+
|
2344
|
+
|
2345
|
+
|
2346
|
+
|
2347
|
+
</h3><div class="docstring">
|
2348
|
+
<div class="discussion">
|
2349
|
+
|
2350
|
+
<p>Current page used by executor.</p>
|
2351
|
+
|
2352
|
+
|
2353
|
+
</div>
|
2354
|
+
</div>
|
2355
|
+
<div class="tags">
|
2356
|
+
|
2357
|
+
<p class="tag_title">Returns:</p>
|
2358
|
+
<ul class="return">
|
2359
|
+
|
2360
|
+
<li>
|
2361
|
+
|
2362
|
+
|
2363
|
+
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
2364
|
+
|
2365
|
+
|
2366
|
+
|
2367
|
+
</li>
|
2368
|
+
|
2369
|
+
</ul>
|
2370
|
+
|
2371
|
+
</div><table class="source_code">
|
2372
|
+
<tr>
|
2373
|
+
<td>
|
2374
|
+
<pre class="lines">
|
2375
|
+
|
2376
|
+
|
2377
|
+
127
|
2378
|
+
128
|
2379
|
+
129</pre>
|
2380
|
+
</td>
|
2381
|
+
<td>
|
2382
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 127</span>
|
2383
|
+
|
2384
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_page'>page</span>
|
2385
|
+
<span class='ivar'>@page</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../../../DhEasy.html" title="DhEasy (module)">DhEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Core.html" title="DhEasy::Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Mock.html" title="DhEasy::Core::Mock (module)">Mock</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FakeDb.html" title="DhEasy::Core::Mock::FakeDb (class)">FakeDb</a></span></span><span class='period'>.</span><span class='id identifier rubyid_build_fake_page'><span class='object_link'><a href="FakeDb.html#build_fake_page-class_method" title="DhEasy::Core::Mock::FakeDb.build_fake_page (method)">build_fake_page</a></span></span> <span class='label'>job_id:</span> <span class='id identifier rubyid_job_id'>job_id</span>
|
2386
|
+
<span class='kw'>end</span></pre>
|
2387
|
+
</td>
|
2388
|
+
</tr>
|
2389
|
+
</table>
|
2390
|
+
</div>
|
2391
|
+
|
2392
|
+
<div class="method_details ">
|
2393
|
+
<h3 class="signature " id="page=-instance_method">
|
2394
|
+
|
2395
|
+
#<strong>page=</strong>(value) ⇒ <tt>Object</tt>
|
2396
|
+
|
2397
|
+
|
2398
|
+
|
2399
|
+
|
2400
|
+
|
2401
|
+
</h3><div class="docstring">
|
2402
|
+
<div class="discussion">
|
2403
|
+
|
2404
|
+
<p>Set current page.</p>
|
2405
|
+
|
2406
|
+
|
2407
|
+
</div>
|
2408
|
+
</div>
|
2409
|
+
<div class="tags">
|
2410
|
+
|
2411
|
+
|
2412
|
+
</div><table class="source_code">
|
2413
|
+
<tr>
|
2414
|
+
<td>
|
2415
|
+
<pre class="lines">
|
2416
|
+
|
2417
|
+
|
2418
|
+
132
|
2419
|
+
133
|
2420
|
+
134
|
2421
|
+
135
|
2422
|
+
136
|
2423
|
+
137
|
2424
|
+
138
|
2425
|
+
139
|
2426
|
+
140</pre>
|
2427
|
+
</td>
|
2428
|
+
<td>
|
2429
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 132</span>
|
2430
|
+
|
2431
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_page='>page=</span> <span class='id identifier rubyid_value'>value</span>
|
2432
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2433
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../DhEasy.html" title="DhEasy (module)">DhEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Core.html" title="DhEasy::Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Mock.html" title="DhEasy::Core::Mock (module)">Mock</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FakeDb.html" title="DhEasy::Core::Mock::FakeDb (class)">FakeDb</a></span></span><span class='period'>.</span><span class='id identifier rubyid_build_page'><span class='object_link'><a href="FakeDb.html#build_page-class_method" title="DhEasy::Core::Mock::FakeDb.build_page (method)">build_page</a></span></span> <span class='id identifier rubyid_value'>value</span>
|
2434
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_job_id'>job_id</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2435
|
+
<span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>job_id</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_job_id'>job_id</span>
|
2436
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_page_gid'>page_gid</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2437
|
+
<span class='kw'>end</span>
|
2438
|
+
<span class='ivar'>@page</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2439
|
+
<span class='kw'>end</span></pre>
|
2440
|
+
</td>
|
2441
|
+
</tr>
|
2442
|
+
</table>
|
2443
|
+
</div>
|
2444
|
+
|
2445
|
+
<div class="method_details ">
|
2446
|
+
<h3 class="signature " id="pages-instance_method">
|
2447
|
+
|
2448
|
+
#<strong>pages</strong> ⇒ <tt>Array</tt>
|
2449
|
+
|
2450
|
+
|
2451
|
+
|
2452
|
+
|
2453
|
+
|
2454
|
+
</h3><div class="docstring">
|
2455
|
+
<div class="discussion">
|
2456
|
+
|
2457
|
+
<p>Draft pages, usually get saved after execution.</p>
|
2458
|
+
|
2459
|
+
|
2460
|
+
</div>
|
2461
|
+
</div>
|
2462
|
+
<div class="tags">
|
2463
|
+
|
2464
|
+
<p class="tag_title">Returns:</p>
|
2465
|
+
<ul class="return">
|
2466
|
+
|
2467
|
+
<li>
|
2468
|
+
|
2469
|
+
|
2470
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
2471
|
+
|
2472
|
+
|
2473
|
+
|
2474
|
+
</li>
|
2475
|
+
|
2476
|
+
</ul>
|
2477
|
+
|
2478
|
+
</div><table class="source_code">
|
2479
|
+
<tr>
|
2480
|
+
<td>
|
2481
|
+
<pre class="lines">
|
2482
|
+
|
2483
|
+
|
2484
|
+
52
|
2485
|
+
53
|
2486
|
+
54</pre>
|
2487
|
+
</td>
|
2488
|
+
<td>
|
2489
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 52</span>
|
2490
|
+
|
2491
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pages'>pages</span>
|
2492
|
+
<span class='ivar'>@pages</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
2493
|
+
<span class='kw'>end</span></pre>
|
2494
|
+
</td>
|
2495
|
+
</tr>
|
2496
|
+
</table>
|
2497
|
+
</div>
|
2498
|
+
|
2499
|
+
<div class="method_details ">
|
2500
|
+
<h3 class="signature " id="refetch-instance_method">
|
2501
|
+
|
2502
|
+
#<strong>refetch</strong>(gid) ⇒ <tt>Object</tt>
|
2503
|
+
|
2504
|
+
|
2505
|
+
|
2506
|
+
|
2507
|
+
|
2508
|
+
</h3><div class="docstring">
|
2509
|
+
<div class="discussion">
|
2510
|
+
|
2511
|
+
<p>Refetch a page by gid.</p>
|
2512
|
+
|
2513
|
+
|
2514
|
+
</div>
|
2515
|
+
</div>
|
2516
|
+
<div class="tags">
|
2517
|
+
<p class="tag_title">Parameters:</p>
|
2518
|
+
<ul class="param">
|
2519
|
+
|
2520
|
+
<li>
|
2521
|
+
|
2522
|
+
<span class='name'>gid</span>
|
2523
|
+
|
2524
|
+
|
2525
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2526
|
+
|
2527
|
+
|
2528
|
+
|
2529
|
+
—
|
2530
|
+
<div class='inline'>
|
2531
|
+
<p>Page's gid to refetch.</p>
|
2532
|
+
</div>
|
2533
|
+
|
2534
|
+
</li>
|
2535
|
+
|
2536
|
+
</ul>
|
2537
|
+
|
2538
|
+
<p class="tag_title">Raises:</p>
|
2539
|
+
<ul class="raise">
|
2540
|
+
|
2541
|
+
<li>
|
2542
|
+
|
2543
|
+
|
2544
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
2545
|
+
|
2546
|
+
|
2547
|
+
|
2548
|
+
</li>
|
2549
|
+
|
2550
|
+
</ul>
|
2551
|
+
|
2552
|
+
</div><table class="source_code">
|
2553
|
+
<tr>
|
2554
|
+
<td>
|
2555
|
+
<pre class="lines">
|
2556
|
+
|
2557
|
+
|
2558
|
+
350
|
2559
|
+
351
|
2560
|
+
352
|
2561
|
+
353
|
2562
|
+
354
|
2563
|
+
355
|
2564
|
+
356
|
2565
|
+
357</pre>
|
2566
|
+
</td>
|
2567
|
+
<td>
|
2568
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 350</span>
|
2569
|
+
|
2570
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_refetch'>refetch</span> <span class='id identifier rubyid_gid'>gid</span>
|
2571
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>gid needs to be a String.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_gid'>gid</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
2572
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_gid'>gid</span>
|
2573
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_refetch_self'>refetch_self</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2574
|
+
<span class='kw'>return</span>
|
2575
|
+
<span class='kw'>end</span>
|
2576
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_refetch'>refetch</span><span class='lparen'>(</span><span class='id identifier rubyid_job_id'>job_id</span><span class='comma'>,</span> <span class='id identifier rubyid_gid'>gid</span><span class='rparen'>)</span>
|
2577
|
+
<span class='kw'>end</span></pre>
|
2578
|
+
</td>
|
2579
|
+
</tr>
|
2580
|
+
</table>
|
2581
|
+
</div>
|
2582
|
+
|
2583
|
+
<div class="method_details ">
|
2584
|
+
<h3 class="signature " id="refetch_self-instance_method">
|
2585
|
+
|
2586
|
+
#<strong>refetch_self</strong> ⇒ <tt>Boollean</tt>
|
2587
|
+
|
2588
|
+
|
2589
|
+
|
2590
|
+
|
2591
|
+
|
2592
|
+
</h3><div class="docstring">
|
2593
|
+
<div class="discussion">
|
2594
|
+
|
2595
|
+
<div class="note notetag">
|
2596
|
+
<strong>Note:</strong>
|
2597
|
+
<div class='inline'>
|
2598
|
+
<p>It is stronger than #reparse_self flag.</p>
|
2599
|
+
</div>
|
2600
|
+
</div>
|
2601
|
+
|
2602
|
+
|
2603
|
+
<p>Refetch self page flag.</p>
|
2604
|
+
|
2605
|
+
|
2606
|
+
</div>
|
2607
|
+
</div>
|
2608
|
+
<div class="tags">
|
2609
|
+
|
2610
|
+
<p class="tag_title">Returns:</p>
|
2611
|
+
<ul class="return">
|
2612
|
+
|
2613
|
+
<li>
|
2614
|
+
|
2615
|
+
|
2616
|
+
<span class='type'>(<tt>Boollean</tt>)</span>
|
2617
|
+
|
2618
|
+
|
2619
|
+
|
2620
|
+
</li>
|
2621
|
+
|
2622
|
+
</ul>
|
2623
|
+
|
2624
|
+
</div><table class="source_code">
|
2625
|
+
<tr>
|
2626
|
+
<td>
|
2627
|
+
<pre class="lines">
|
2628
|
+
|
2629
|
+
|
2630
|
+
145
|
2631
|
+
146
|
2632
|
+
147</pre>
|
2633
|
+
</td>
|
2634
|
+
<td>
|
2635
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 145</span>
|
2636
|
+
|
2637
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_refetch_self'>refetch_self</span>
|
2638
|
+
<span class='ivar'>@refetch_self</span> <span class='op'>||=</span> <span class='kw'>false</span>
|
2639
|
+
<span class='kw'>end</span></pre>
|
2640
|
+
</td>
|
2641
|
+
</tr>
|
2642
|
+
</table>
|
2643
|
+
</div>
|
2644
|
+
|
2645
|
+
<div class="method_details ">
|
2646
|
+
<h3 class="signature " id="refetch_self=-instance_method">
|
2647
|
+
|
2648
|
+
#<strong>refetch_self=</strong>(value) ⇒ <tt>Object</tt>
|
2649
|
+
|
2650
|
+
|
2651
|
+
|
2652
|
+
|
2653
|
+
|
2654
|
+
</h3><div class="docstring">
|
2655
|
+
<div class="discussion">
|
2656
|
+
|
2657
|
+
<p>Set refetch self page flag.</p>
|
2658
|
+
|
2659
|
+
|
2660
|
+
</div>
|
2661
|
+
</div>
|
2662
|
+
<div class="tags">
|
2663
|
+
|
2664
|
+
|
2665
|
+
</div><table class="source_code">
|
2666
|
+
<tr>
|
2667
|
+
<td>
|
2668
|
+
<pre class="lines">
|
2669
|
+
|
2670
|
+
|
2671
|
+
150
|
2672
|
+
151
|
2673
|
+
152</pre>
|
2674
|
+
</td>
|
2675
|
+
<td>
|
2676
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 150</span>
|
2677
|
+
|
2678
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_refetch_self='>refetch_self=</span> <span class='id identifier rubyid_value'>value</span>
|
2679
|
+
<span class='ivar'>@refetch_self</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2680
|
+
<span class='kw'>end</span></pre>
|
2681
|
+
</td>
|
2682
|
+
</tr>
|
2683
|
+
</table>
|
2684
|
+
</div>
|
2685
|
+
|
2686
|
+
<div class="method_details ">
|
2687
|
+
<h3 class="signature " id="reparse-instance_method">
|
2688
|
+
|
2689
|
+
#<strong>reparse</strong>(page_gid) ⇒ <tt>Object</tt>
|
2690
|
+
|
2691
|
+
|
2692
|
+
|
2693
|
+
|
2694
|
+
|
2695
|
+
</h3><div class="docstring">
|
2696
|
+
<div class="discussion">
|
2697
|
+
|
2698
|
+
<p>Reparse a page by gid.</p>
|
2699
|
+
|
2700
|
+
|
2701
|
+
</div>
|
2702
|
+
</div>
|
2703
|
+
<div class="tags">
|
2704
|
+
<p class="tag_title">Parameters:</p>
|
2705
|
+
<ul class="param">
|
2706
|
+
|
2707
|
+
<li>
|
2708
|
+
|
2709
|
+
<span class='name'>page_gid</span>
|
2710
|
+
|
2711
|
+
|
2712
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2713
|
+
|
2714
|
+
|
2715
|
+
|
2716
|
+
—
|
2717
|
+
<div class='inline'>
|
2718
|
+
<p>Page's gid to reparse.</p>
|
2719
|
+
</div>
|
2720
|
+
|
2721
|
+
</li>
|
2722
|
+
|
2723
|
+
</ul>
|
2724
|
+
|
2725
|
+
<p class="tag_title">Raises:</p>
|
2726
|
+
<ul class="raise">
|
2727
|
+
|
2728
|
+
<li>
|
2729
|
+
|
2730
|
+
|
2731
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
2732
|
+
|
2733
|
+
|
2734
|
+
|
2735
|
+
</li>
|
2736
|
+
|
2737
|
+
</ul>
|
2738
|
+
|
2739
|
+
</div><table class="source_code">
|
2740
|
+
<tr>
|
2741
|
+
<td>
|
2742
|
+
<pre class="lines">
|
2743
|
+
|
2744
|
+
|
2745
|
+
362
|
2746
|
+
363
|
2747
|
+
364
|
2748
|
+
365
|
2749
|
+
366
|
2750
|
+
367
|
2751
|
+
368
|
2752
|
+
369</pre>
|
2753
|
+
</td>
|
2754
|
+
<td>
|
2755
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 362</span>
|
2756
|
+
|
2757
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_reparse'>reparse</span> <span class='id identifier rubyid_page_gid'>page_gid</span>
|
2758
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>page_gid needs to be a String.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_page_gid'>page_gid</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
2759
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_page'>page</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>gid</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_page_gid'>page_gid</span>
|
2760
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_reparse_self'>reparse_self</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2761
|
+
<span class='kw'>return</span>
|
2762
|
+
<span class='kw'>end</span>
|
2763
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_reparse'>reparse</span><span class='lparen'>(</span><span class='id identifier rubyid_job_id'>job_id</span><span class='comma'>,</span> <span class='id identifier rubyid_page_gid'>page_gid</span><span class='rparen'>)</span>
|
2764
|
+
<span class='kw'>end</span></pre>
|
2765
|
+
</td>
|
2766
|
+
</tr>
|
2767
|
+
</table>
|
2768
|
+
</div>
|
2769
|
+
|
2770
|
+
<div class="method_details ">
|
2771
|
+
<h3 class="signature " id="reparse_self-instance_method">
|
2772
|
+
|
2773
|
+
#<strong>reparse_self</strong> ⇒ <tt>Boollean</tt>
|
2774
|
+
|
2775
|
+
|
2776
|
+
|
2777
|
+
|
2778
|
+
|
2779
|
+
</h3><div class="docstring">
|
2780
|
+
<div class="discussion">
|
2781
|
+
|
2782
|
+
<p>Reparse self page flag.</p>
|
2783
|
+
|
2784
|
+
|
2785
|
+
</div>
|
2786
|
+
</div>
|
2787
|
+
<div class="tags">
|
2788
|
+
|
2789
|
+
<p class="tag_title">Returns:</p>
|
2790
|
+
<ul class="return">
|
2791
|
+
|
2792
|
+
<li>
|
2793
|
+
|
2794
|
+
|
2795
|
+
<span class='type'>(<tt>Boollean</tt>)</span>
|
2796
|
+
|
2797
|
+
|
2798
|
+
|
2799
|
+
</li>
|
2800
|
+
|
2801
|
+
</ul>
|
2802
|
+
|
2803
|
+
</div><table class="source_code">
|
2804
|
+
<tr>
|
2805
|
+
<td>
|
2806
|
+
<pre class="lines">
|
2807
|
+
|
2808
|
+
|
2809
|
+
156
|
2810
|
+
157
|
2811
|
+
158</pre>
|
2812
|
+
</td>
|
2813
|
+
<td>
|
2814
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 156</span>
|
2815
|
+
|
2816
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_reparse_self'>reparse_self</span>
|
2817
|
+
<span class='ivar'>@reparse_self</span> <span class='op'>||=</span> <span class='kw'>false</span>
|
2818
|
+
<span class='kw'>end</span></pre>
|
2819
|
+
</td>
|
2820
|
+
</tr>
|
2821
|
+
</table>
|
2822
|
+
</div>
|
2823
|
+
|
2824
|
+
<div class="method_details ">
|
2825
|
+
<h3 class="signature " id="reparse_self=-instance_method">
|
2826
|
+
|
2827
|
+
#<strong>reparse_self=</strong>(value) ⇒ <tt>Object</tt>
|
2828
|
+
|
2829
|
+
|
2830
|
+
|
2831
|
+
|
2832
|
+
|
2833
|
+
</h3><div class="docstring">
|
2834
|
+
<div class="discussion">
|
2835
|
+
|
2836
|
+
<p>Set reparse self page flag.</p>
|
2837
|
+
|
2838
|
+
|
2839
|
+
</div>
|
2840
|
+
</div>
|
2841
|
+
<div class="tags">
|
2842
|
+
|
2843
|
+
|
2844
|
+
</div><table class="source_code">
|
2845
|
+
<tr>
|
2846
|
+
<td>
|
2847
|
+
<pre class="lines">
|
2848
|
+
|
2849
|
+
|
2850
|
+
161
|
2851
|
+
162
|
2852
|
+
163</pre>
|
2853
|
+
</td>
|
2854
|
+
<td>
|
2855
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 161</span>
|
2856
|
+
|
2857
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_reparse_self='>reparse_self=</span> <span class='id identifier rubyid_value'>value</span>
|
2858
|
+
<span class='ivar'>@reparse_self</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2859
|
+
<span class='kw'>end</span></pre>
|
2860
|
+
</td>
|
2861
|
+
</tr>
|
2862
|
+
</table>
|
2863
|
+
</div>
|
2864
|
+
|
2865
|
+
<div class="method_details ">
|
2866
|
+
<h3 class="signature " id="save_jobs-instance_method">
|
2867
|
+
|
2868
|
+
#<strong>save_jobs</strong>(list) ⇒ <tt>Object</tt>
|
2869
|
+
|
2870
|
+
|
2871
|
+
|
2872
|
+
|
2873
|
+
|
2874
|
+
</h3><div class="docstring">
|
2875
|
+
<div class="discussion">
|
2876
|
+
|
2877
|
+
<p>Save a job collection on db and remove all the element from
|
2878
|
+
<code>list</code>.</p>
|
2879
|
+
|
2880
|
+
|
2881
|
+
</div>
|
2882
|
+
</div>
|
2883
|
+
<div class="tags">
|
2884
|
+
<p class="tag_title">Parameters:</p>
|
2885
|
+
<ul class="param">
|
2886
|
+
|
2887
|
+
<li>
|
2888
|
+
|
2889
|
+
<span class='name'>list</span>
|
2890
|
+
|
2891
|
+
|
2892
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
2893
|
+
|
2894
|
+
|
2895
|
+
|
2896
|
+
—
|
2897
|
+
<div class='inline'>
|
2898
|
+
<p>Collection of jobs to save.</p>
|
2899
|
+
</div>
|
2900
|
+
|
2901
|
+
</li>
|
2902
|
+
|
2903
|
+
</ul>
|
2904
|
+
|
2905
|
+
|
2906
|
+
</div><table class="source_code">
|
2907
|
+
<tr>
|
2908
|
+
<td>
|
2909
|
+
<pre class="lines">
|
2910
|
+
|
2911
|
+
|
2912
|
+
183
|
2913
|
+
184
|
2914
|
+
185
|
2915
|
+
186</pre>
|
2916
|
+
</td>
|
2917
|
+
<td>
|
2918
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 183</span>
|
2919
|
+
|
2920
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_save_jobs'>save_jobs</span> <span class='id identifier rubyid_list'>list</span>
|
2921
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_job'>job</span><span class='op'>|</span> <span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_jobs'>jobs</span> <span class='op'><<</span> <span class='id identifier rubyid_job'>job</span><span class='rbrace'>}</span>
|
2922
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
2923
|
+
<span class='kw'>end</span></pre>
|
2924
|
+
</td>
|
2925
|
+
</tr>
|
2926
|
+
</table>
|
2927
|
+
</div>
|
2928
|
+
|
2929
|
+
<div class="method_details ">
|
2930
|
+
<h3 class="signature " id="save_outputs-instance_method">
|
2931
|
+
|
2932
|
+
#<strong>save_outputs</strong>(list) ⇒ <tt>Object</tt>
|
2933
|
+
|
2934
|
+
|
2935
|
+
|
2936
|
+
|
2937
|
+
|
2938
|
+
</h3><div class="docstring">
|
2939
|
+
<div class="discussion">
|
2940
|
+
|
2941
|
+
<p>Save an output collection on db and remove all the element from</p>
|
2942
|
+
|
2943
|
+
<pre class="code ruby"><code class="ruby">+list+.
|
2944
|
+
</code></pre>
|
2945
|
+
|
2946
|
+
|
2947
|
+
</div>
|
2948
|
+
</div>
|
2949
|
+
<div class="tags">
|
2950
|
+
<p class="tag_title">Parameters:</p>
|
2951
|
+
<ul class="param">
|
2952
|
+
|
2953
|
+
<li>
|
2954
|
+
|
2955
|
+
<span class='name'>list</span>
|
2956
|
+
|
2957
|
+
|
2958
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
2959
|
+
|
2960
|
+
|
2961
|
+
|
2962
|
+
—
|
2963
|
+
<div class='inline'>
|
2964
|
+
<p>Collection of outputs to save.</p>
|
2965
|
+
</div>
|
2966
|
+
|
2967
|
+
</li>
|
2968
|
+
|
2969
|
+
</ul>
|
2970
|
+
|
2971
|
+
|
2972
|
+
</div><table class="source_code">
|
2973
|
+
<tr>
|
2974
|
+
<td>
|
2975
|
+
<pre class="lines">
|
2976
|
+
|
2977
|
+
|
2978
|
+
200
|
2979
|
+
201
|
2980
|
+
202
|
2981
|
+
203</pre>
|
2982
|
+
</td>
|
2983
|
+
<td>
|
2984
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 200</span>
|
2985
|
+
|
2986
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_save_outputs'>save_outputs</span> <span class='id identifier rubyid_list'>list</span>
|
2987
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_output'>output</span><span class='op'>|</span> <span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_outputs'>outputs</span> <span class='op'><<</span> <span class='id identifier rubyid_output'>output</span><span class='rbrace'>}</span>
|
2988
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
2989
|
+
<span class='kw'>end</span></pre>
|
2990
|
+
</td>
|
2991
|
+
</tr>
|
2992
|
+
</table>
|
2993
|
+
</div>
|
2994
|
+
|
2995
|
+
<div class="method_details ">
|
2996
|
+
<h3 class="signature " id="save_pages-instance_method">
|
2997
|
+
|
2998
|
+
#<strong>save_pages</strong>(list) ⇒ <tt>Object</tt>
|
2999
|
+
|
3000
|
+
|
3001
|
+
|
3002
|
+
|
3003
|
+
|
3004
|
+
</h3><div class="docstring">
|
3005
|
+
<div class="discussion">
|
3006
|
+
|
3007
|
+
<p>Save a page collection on db and remove all the element from
|
3008
|
+
<code>list</code>.</p>
|
3009
|
+
|
3010
|
+
|
3011
|
+
</div>
|
3012
|
+
</div>
|
3013
|
+
<div class="tags">
|
3014
|
+
<p class="tag_title">Parameters:</p>
|
3015
|
+
<ul class="param">
|
3016
|
+
|
3017
|
+
<li>
|
3018
|
+
|
3019
|
+
<span class='name'>list</span>
|
3020
|
+
|
3021
|
+
|
3022
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
3023
|
+
|
3024
|
+
|
3025
|
+
|
3026
|
+
—
|
3027
|
+
<div class='inline'>
|
3028
|
+
<p>Collection of pages to save.</p>
|
3029
|
+
</div>
|
3030
|
+
|
3031
|
+
</li>
|
3032
|
+
|
3033
|
+
</ul>
|
3034
|
+
|
3035
|
+
|
3036
|
+
</div><table class="source_code">
|
3037
|
+
<tr>
|
3038
|
+
<td>
|
3039
|
+
<pre class="lines">
|
3040
|
+
|
3041
|
+
|
3042
|
+
191
|
3043
|
+
192
|
3044
|
+
193
|
3045
|
+
194</pre>
|
3046
|
+
</td>
|
3047
|
+
<td>
|
3048
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 191</span>
|
3049
|
+
|
3050
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_save_pages'>save_pages</span> <span class='id identifier rubyid_list'>list</span>
|
3051
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_pages'>pages</span> <span class='op'><<</span> <span class='id identifier rubyid_page'>page</span><span class='rbrace'>}</span>
|
3052
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
3053
|
+
<span class='kw'>end</span></pre>
|
3054
|
+
</td>
|
3055
|
+
</tr>
|
3056
|
+
</table>
|
3057
|
+
</div>
|
3058
|
+
|
3059
|
+
<div class="method_details ">
|
3060
|
+
<h3 class="signature " id="saved_jobs-instance_method">
|
3061
|
+
|
3062
|
+
#<strong>saved_jobs</strong> ⇒ <tt>Object</tt>
|
3063
|
+
|
3064
|
+
|
3065
|
+
|
3066
|
+
|
3067
|
+
|
3068
|
+
</h3><div class="docstring">
|
3069
|
+
<div class="discussion">
|
3070
|
+
|
3071
|
+
<p>Retrive a list of saved jobs.</p>
|
3072
|
+
|
3073
|
+
|
3074
|
+
</div>
|
3075
|
+
</div>
|
3076
|
+
<div class="tags">
|
3077
|
+
|
3078
|
+
|
3079
|
+
</div><table class="source_code">
|
3080
|
+
<tr>
|
3081
|
+
<td>
|
3082
|
+
<pre class="lines">
|
3083
|
+
|
3084
|
+
|
3085
|
+
166
|
3086
|
+
167
|
3087
|
+
168</pre>
|
3088
|
+
</td>
|
3089
|
+
<td>
|
3090
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 166</span>
|
3091
|
+
|
3092
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_saved_jobs'>saved_jobs</span>
|
3093
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_jobs'>jobs</span>
|
3094
|
+
<span class='kw'>end</span></pre>
|
3095
|
+
</td>
|
3096
|
+
</tr>
|
3097
|
+
</table>
|
3098
|
+
</div>
|
3099
|
+
|
3100
|
+
<div class="method_details ">
|
3101
|
+
<h3 class="signature " id="saved_outputs-instance_method">
|
3102
|
+
|
3103
|
+
#<strong>saved_outputs</strong> ⇒ <tt>Object</tt>
|
3104
|
+
|
3105
|
+
|
3106
|
+
|
3107
|
+
|
3108
|
+
|
3109
|
+
</h3><div class="docstring">
|
3110
|
+
<div class="discussion">
|
3111
|
+
|
3112
|
+
<p>Retrive a list of saved outputs.</p>
|
3113
|
+
|
3114
|
+
|
3115
|
+
</div>
|
3116
|
+
</div>
|
3117
|
+
<div class="tags">
|
3118
|
+
|
3119
|
+
|
3120
|
+
</div><table class="source_code">
|
3121
|
+
<tr>
|
3122
|
+
<td>
|
3123
|
+
<pre class="lines">
|
3124
|
+
|
3125
|
+
|
3126
|
+
176
|
3127
|
+
177
|
3128
|
+
178</pre>
|
3129
|
+
</td>
|
3130
|
+
<td>
|
3131
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 176</span>
|
3132
|
+
|
3133
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_saved_outputs'>saved_outputs</span>
|
3134
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_outputs'>outputs</span>
|
3135
|
+
<span class='kw'>end</span></pre>
|
3136
|
+
</td>
|
3137
|
+
</tr>
|
3138
|
+
</table>
|
3139
|
+
</div>
|
3140
|
+
|
3141
|
+
<div class="method_details ">
|
3142
|
+
<h3 class="signature " id="saved_pages-instance_method">
|
3143
|
+
|
3144
|
+
#<strong>saved_pages</strong> ⇒ <tt>Object</tt>
|
3145
|
+
|
3146
|
+
|
3147
|
+
|
3148
|
+
|
3149
|
+
|
3150
|
+
</h3><div class="docstring">
|
3151
|
+
<div class="discussion">
|
3152
|
+
|
3153
|
+
<p>Retrive a list of saved pages. Drafted pages can be included.</p>
|
3154
|
+
|
3155
|
+
|
3156
|
+
</div>
|
3157
|
+
</div>
|
3158
|
+
<div class="tags">
|
3159
|
+
|
3160
|
+
|
3161
|
+
</div><table class="source_code">
|
3162
|
+
<tr>
|
3163
|
+
<td>
|
3164
|
+
<pre class="lines">
|
3165
|
+
|
3166
|
+
|
3167
|
+
171
|
3168
|
+
172
|
3169
|
+
173</pre>
|
3170
|
+
</td>
|
3171
|
+
<td>
|
3172
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 171</span>
|
3173
|
+
|
3174
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_saved_pages'>saved_pages</span>
|
3175
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_pages'>pages</span>
|
3176
|
+
<span class='kw'>end</span></pre>
|
3177
|
+
</td>
|
3178
|
+
</tr>
|
3179
|
+
</table>
|
3180
|
+
</div>
|
3181
|
+
|
3182
|
+
<div class="method_details ">
|
3183
|
+
<h3 class="signature " id="scraper_name-instance_method">
|
3184
|
+
|
3185
|
+
#<strong>scraper_name</strong> ⇒ <tt>Integer</tt><sup>?</sup>
|
3186
|
+
|
3187
|
+
|
3188
|
+
|
3189
|
+
|
3190
|
+
|
3191
|
+
</h3><div class="docstring">
|
3192
|
+
<div class="discussion">
|
3193
|
+
|
3194
|
+
<p>Fake scraper name used by executor.</p>
|
3195
|
+
|
3196
|
+
|
3197
|
+
</div>
|
3198
|
+
</div>
|
3199
|
+
<div class="tags">
|
3200
|
+
|
3201
|
+
<p class="tag_title">Returns:</p>
|
3202
|
+
<ul class="return">
|
3203
|
+
|
3204
|
+
<li>
|
3205
|
+
|
3206
|
+
|
3207
|
+
<span class='type'>(<tt>Integer</tt>, <tt>nil</tt>)</span>
|
3208
|
+
|
3209
|
+
|
3210
|
+
|
3211
|
+
</li>
|
3212
|
+
|
3213
|
+
</ul>
|
3214
|
+
|
3215
|
+
</div><table class="source_code">
|
3216
|
+
<tr>
|
3217
|
+
<td>
|
3218
|
+
<pre class="lines">
|
3219
|
+
|
3220
|
+
|
3221
|
+
104
|
3222
|
+
105
|
3223
|
+
106</pre>
|
3224
|
+
</td>
|
3225
|
+
<td>
|
3226
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 104</span>
|
3227
|
+
|
3228
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scraper_name'>scraper_name</span>
|
3229
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_scraper_name'>scraper_name</span>
|
3230
|
+
<span class='kw'>end</span></pre>
|
3231
|
+
</td>
|
3232
|
+
</tr>
|
3233
|
+
</table>
|
3234
|
+
</div>
|
3235
|
+
|
3236
|
+
<div class="method_details ">
|
3237
|
+
<h3 class="signature " id="scraper_name=-instance_method">
|
3238
|
+
|
3239
|
+
#<strong>scraper_name=</strong>(value) ⇒ <tt>Object</tt>
|
3240
|
+
|
3241
|
+
|
3242
|
+
|
3243
|
+
|
3244
|
+
|
3245
|
+
</h3><div class="docstring">
|
3246
|
+
<div class="discussion">
|
3247
|
+
|
3248
|
+
<p>Set fake scraper name value.</p>
|
3249
|
+
|
3250
|
+
|
3251
|
+
</div>
|
3252
|
+
</div>
|
3253
|
+
<div class="tags">
|
3254
|
+
|
3255
|
+
|
3256
|
+
</div><table class="source_code">
|
3257
|
+
<tr>
|
3258
|
+
<td>
|
3259
|
+
<pre class="lines">
|
3260
|
+
|
3261
|
+
|
3262
|
+
109
|
3263
|
+
110
|
3264
|
+
111</pre>
|
3265
|
+
</td>
|
3266
|
+
<td>
|
3267
|
+
<pre class="code"><span class="info file"># File 'lib/dh_easy/core/mock/fake_executor.rb', line 109</span>
|
3268
|
+
|
3269
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scraper_name='>scraper_name=</span> <span class='id identifier rubyid_value'>value</span>
|
3270
|
+
<span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_scraper_name'>scraper_name</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
3271
|
+
<span class='kw'>end</span></pre>
|
3272
|
+
</td>
|
3273
|
+
</tr>
|
3274
|
+
</table>
|
3275
|
+
</div>
|
3276
|
+
|
3277
|
+
</div>
|
3278
|
+
|
3279
|
+
</div>
|
3280
|
+
|
3281
|
+
<div id="footer">
|
3282
|
+
Generated on Wed Dec 4 23:00:02 2019 by
|
3283
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
3284
|
+
0.9.20 (ruby-2.5.3).
|
3285
|
+
</div>
|
3286
|
+
|
3287
|
+
</div>
|
3288
|
+
</body>
|
3289
|
+
</html>
|