proxy_manager 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,870 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: ProxyManager::Main
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!ProxyManager/Main.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (M)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../ProxyManager.html" title="ProxyManager (module)">ProxyManager</a></span></span>
36
+ &raquo;
37
+ <span class="title">Main</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: ProxyManager::Main
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">ProxyManager::Main</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/proxy_manager/main.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#bad_list-instance_method" title="#bad_list (instance method)">- (Object) <strong>bad_list</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Returns the value of attribute bad_list.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ <li class="public ">
139
+ <span class="summary_signature">
140
+
141
+ <a href="#bad_list_file-instance_method" title="#bad_list_file (instance method)">- (Object) <strong>bad_list_file</strong> </a>
142
+
143
+
144
+
145
+ </span>
146
+
147
+
148
+
149
+
150
+ <span class="note title readonly">readonly</span>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <span class="summary_desc"><div class='inline'>
161
+ <p>Returns the value of attribute bad_list_file.</p>
162
+ </div></span>
163
+
164
+ </li>
165
+
166
+
167
+ <li class="public ">
168
+ <span class="summary_signature">
169
+
170
+ <a href="#list-instance_method" title="#list (instance method)">- (Object) <strong>list</strong> </a>
171
+
172
+
173
+
174
+ </span>
175
+
176
+
177
+
178
+
179
+ <span class="note title readonly">readonly</span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'>
190
+ <p>Returns the value of attribute list.</p>
191
+ </div></span>
192
+
193
+ </li>
194
+
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#list_file-instance_method" title="#list_file (instance method)">- (Object) <strong>list_file</strong> </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+
207
+
208
+ <span class="note title readonly">readonly</span>
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+ <span class="summary_desc"><div class='inline'>
219
+ <p>Returns the value of attribute list_file.</p>
220
+ </div></span>
221
+
222
+ </li>
223
+
224
+
225
+ </ul>
226
+
227
+
228
+
229
+
230
+
231
+ <h2>
232
+ Instance Method Summary
233
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
234
+ </h2>
235
+
236
+ <ul class="summary">
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#connectable%3F-instance_method" title="#connectable? (instance method)">- (Boolean) <strong>connectable?</strong>(proxy) </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+ <span class="summary_desc"><div class='inline'></div></span>
256
+
257
+ </li>
258
+
259
+
260
+ <li class="public ">
261
+ <span class="summary_signature">
262
+
263
+ <a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(count = 1) </a>
264
+
265
+
266
+
267
+ </span>
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+ <span class="summary_desc"><div class='inline'></div></span>
278
+
279
+ </li>
280
+
281
+
282
+ <li class="public ">
283
+ <span class="summary_signature">
284
+
285
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Main) <strong>initialize</strong>(proxies, bad_proxies) </a>
286
+
287
+
288
+
289
+ </span>
290
+
291
+
292
+ <span class="note title constructor">constructor</span>
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+ <span class="summary_desc"><div class='inline'>
302
+ <p>A new instance of Main.</p>
303
+ </div></span>
304
+
305
+ </li>
306
+
307
+
308
+ <li class="private ">
309
+ <span class="summary_signature">
310
+
311
+ <a href="#load_list_from_array-instance_method" title="#load_list_from_array (instance method)">- (Object) <strong>load_list_from_array</strong>(proxies) </a>
312
+
313
+
314
+
315
+ </span>
316
+
317
+
318
+
319
+ <span class="note title private">private</span>
320
+
321
+
322
+
323
+
324
+
325
+ <span class="summary_desc"><div class='inline'></div></span>
326
+
327
+ </li>
328
+
329
+
330
+ <li class="private ">
331
+ <span class="summary_signature">
332
+
333
+ <a href="#load_list_from_file-instance_method" title="#load_list_from_file (instance method)">- (Object) <strong>load_list_from_file</strong>(proxies) </a>
334
+
335
+
336
+
337
+ </span>
338
+
339
+
340
+
341
+ <span class="note title private">private</span>
342
+
343
+
344
+
345
+
346
+
347
+ <span class="summary_desc"><div class='inline'></div></span>
348
+
349
+ </li>
350
+
351
+
352
+ </ul>
353
+
354
+
355
+ <div id="constructor_details" class="method_details_list">
356
+ <h2>Constructor Details</h2>
357
+
358
+ <div class="method_details first">
359
+ <h3 class="signature first" id="initialize-instance_method">
360
+
361
+ - (<tt><span class='object_link'><a href="" title="ProxyManager::Main (class)">Main</a></span></tt>) <strong>initialize</strong>(proxies, bad_proxies)
362
+
363
+
364
+
365
+
366
+
367
+ </h3><div class="docstring">
368
+ <div class="discussion">
369
+
370
+ <p>Returns a new instance of Main</p>
371
+
372
+
373
+ </div>
374
+ </div>
375
+ <div class="tags">
376
+
377
+
378
+ </div><table class="source_code">
379
+ <tr>
380
+ <td>
381
+ <pre class="lines">
382
+
383
+
384
+ 5
385
+ 6
386
+ 7
387
+ 8
388
+ 9
389
+ 10
390
+ 11
391
+ 12
392
+ 13
393
+ 14
394
+ 15
395
+ 16
396
+ 17
397
+ 18
398
+ 19
399
+ 20</pre>
400
+ </td>
401
+ <td>
402
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 5</span>
403
+
404
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='comma'>,</span> <span class='id identifier rubyid_bad_proxies'>bad_proxies</span><span class='rparen'>)</span>
405
+ <span class='ivar'>@list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
406
+ <span class='ivar'>@bad_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
407
+
408
+ <span class='kw'>if</span> <span class='id identifier rubyid_proxies'>proxies</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Array</span>
409
+ <span class='id identifier rubyid_load_list_from_array'>load_list_from_array</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='rparen'>)</span>
410
+ <span class='kw'>else</span>
411
+ <span class='kw'>if</span> <span class='id identifier rubyid_proxies'>proxies</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>or</span> <span class='id identifier rubyid_bad_proxies'>bad_proxies</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
412
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Both arguments &quot;proxies&quot; and &quot;bad_proxies&quot; required</span><span class='tstring_end'>&#39;</span></span>
413
+ <span class='kw'>end</span>
414
+
415
+ <span class='ivar'>@list_file</span><span class='comma'>,</span> <span class='ivar'>@bad_list_file</span> <span class='op'>=</span> <span class='id identifier rubyid_proxies'>proxies</span><span class='comma'>,</span> <span class='id identifier rubyid_bad_proxies'>bad_proxies</span>
416
+
417
+ <span class='id identifier rubyid_load_list_from_file'>load_list_from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='rparen'>)</span>
418
+ <span class='kw'>end</span>
419
+ <span class='kw'>end</span></pre>
420
+ </td>
421
+ </tr>
422
+ </table>
423
+ </div>
424
+
425
+ </div>
426
+
427
+ <div id="instance_attr_details" class="attr_details">
428
+ <h2>Instance Attribute Details</h2>
429
+
430
+
431
+ <span id=""></span>
432
+ <div class="method_details first">
433
+ <h3 class="signature first" id="bad_list-instance_method">
434
+
435
+ - (<tt>Object</tt>) <strong>bad_list</strong> <span class="extras">(readonly)</span>
436
+
437
+
438
+
439
+
440
+
441
+ </h3><div class="docstring">
442
+ <div class="discussion">
443
+
444
+ <p>Returns the value of attribute bad_list</p>
445
+
446
+
447
+ </div>
448
+ </div>
449
+ <div class="tags">
450
+
451
+
452
+ </div><table class="source_code">
453
+ <tr>
454
+ <td>
455
+ <pre class="lines">
456
+
457
+
458
+ 3
459
+ 4
460
+ 5</pre>
461
+ </td>
462
+ <td>
463
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 3</span>
464
+
465
+ <span class='kw'>def</span> <span class='id identifier rubyid_bad_list'>bad_list</span>
466
+ <span class='ivar'>@bad_list</span>
467
+ <span class='kw'>end</span></pre>
468
+ </td>
469
+ </tr>
470
+ </table>
471
+ </div>
472
+
473
+
474
+ <span id=""></span>
475
+ <div class="method_details ">
476
+ <h3 class="signature " id="bad_list_file-instance_method">
477
+
478
+ - (<tt>Object</tt>) <strong>bad_list_file</strong> <span class="extras">(readonly)</span>
479
+
480
+
481
+
482
+
483
+
484
+ </h3><div class="docstring">
485
+ <div class="discussion">
486
+
487
+ <p>Returns the value of attribute bad_list_file</p>
488
+
489
+
490
+ </div>
491
+ </div>
492
+ <div class="tags">
493
+
494
+
495
+ </div><table class="source_code">
496
+ <tr>
497
+ <td>
498
+ <pre class="lines">
499
+
500
+
501
+ 3
502
+ 4
503
+ 5</pre>
504
+ </td>
505
+ <td>
506
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 3</span>
507
+
508
+ <span class='kw'>def</span> <span class='id identifier rubyid_bad_list_file'>bad_list_file</span>
509
+ <span class='ivar'>@bad_list_file</span>
510
+ <span class='kw'>end</span></pre>
511
+ </td>
512
+ </tr>
513
+ </table>
514
+ </div>
515
+
516
+
517
+ <span id=""></span>
518
+ <div class="method_details ">
519
+ <h3 class="signature " id="list-instance_method">
520
+
521
+ - (<tt>Object</tt>) <strong>list</strong> <span class="extras">(readonly)</span>
522
+
523
+
524
+
525
+
526
+
527
+ </h3><div class="docstring">
528
+ <div class="discussion">
529
+
530
+ <p>Returns the value of attribute list</p>
531
+
532
+
533
+ </div>
534
+ </div>
535
+ <div class="tags">
536
+
537
+
538
+ </div><table class="source_code">
539
+ <tr>
540
+ <td>
541
+ <pre class="lines">
542
+
543
+
544
+ 3
545
+ 4
546
+ 5</pre>
547
+ </td>
548
+ <td>
549
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 3</span>
550
+
551
+ <span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span>
552
+ <span class='ivar'>@list</span>
553
+ <span class='kw'>end</span></pre>
554
+ </td>
555
+ </tr>
556
+ </table>
557
+ </div>
558
+
559
+
560
+ <span id=""></span>
561
+ <div class="method_details ">
562
+ <h3 class="signature " id="list_file-instance_method">
563
+
564
+ - (<tt>Object</tt>) <strong>list_file</strong> <span class="extras">(readonly)</span>
565
+
566
+
567
+
568
+
569
+
570
+ </h3><div class="docstring">
571
+ <div class="discussion">
572
+
573
+ <p>Returns the value of attribute list_file</p>
574
+
575
+
576
+ </div>
577
+ </div>
578
+ <div class="tags">
579
+
580
+
581
+ </div><table class="source_code">
582
+ <tr>
583
+ <td>
584
+ <pre class="lines">
585
+
586
+
587
+ 3
588
+ 4
589
+ 5</pre>
590
+ </td>
591
+ <td>
592
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 3</span>
593
+
594
+ <span class='kw'>def</span> <span class='id identifier rubyid_list_file'>list_file</span>
595
+ <span class='ivar'>@list_file</span>
596
+ <span class='kw'>end</span></pre>
597
+ </td>
598
+ </tr>
599
+ </table>
600
+ </div>
601
+
602
+ </div>
603
+
604
+
605
+ <div id="instance_method_details" class="method_details_list">
606
+ <h2>Instance Method Details</h2>
607
+
608
+
609
+ <div class="method_details first">
610
+ <h3 class="signature first" id="connectable?-instance_method">
611
+
612
+ - (<tt>Boolean</tt>) <strong>connectable?</strong>(proxy)
613
+
614
+
615
+
616
+
617
+
618
+ </h3><div class="docstring">
619
+ <div class="discussion">
620
+
621
+
622
+ </div>
623
+ </div>
624
+ <div class="tags">
625
+
626
+ <p class="tag_title">Returns:</p>
627
+ <ul class="return">
628
+
629
+ <li>
630
+
631
+
632
+ <span class='type'>(<tt>Boolean</tt>)</span>
633
+
634
+
635
+
636
+ </li>
637
+
638
+ </ul>
639
+
640
+ </div><table class="source_code">
641
+ <tr>
642
+ <td>
643
+ <pre class="lines">
644
+
645
+
646
+ 22
647
+ 23
648
+ 24
649
+ 25</pre>
650
+ </td>
651
+ <td>
652
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 22</span>
653
+
654
+ <span class='kw'>def</span> <span class='id identifier rubyid_connectable?'>connectable?</span><span class='lparen'>(</span><span class='id identifier rubyid_proxy'>proxy</span><span class='rparen'>)</span>
655
+ <span class='id identifier rubyid_proxy'>proxy</span> <span class='op'>=</span> <span class='id identifier rubyid_proxy'>proxy</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_proxy'>proxy</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
656
+ <span class='const'>Net</span><span class='op'>::</span><span class='const'>Ping</span><span class='op'>::</span><span class='const'>TCP</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_proxy'>proxy</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_proxy'>proxy</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ping'>ping</span>
657
+ <span class='kw'>end</span></pre>
658
+ </td>
659
+ </tr>
660
+ </table>
661
+ </div>
662
+
663
+ <div class="method_details ">
664
+ <h3 class="signature " id="get-instance_method">
665
+
666
+ - (<tt>Object</tt>) <strong>get</strong>(count = 1)
667
+
668
+
669
+
670
+
671
+
672
+ </h3><table class="source_code">
673
+ <tr>
674
+ <td>
675
+ <pre class="lines">
676
+
677
+
678
+ 27
679
+ 28
680
+ 29
681
+ 30
682
+ 31
683
+ 32
684
+ 33
685
+ 34
686
+ 35
687
+ 36
688
+ 37
689
+ 38
690
+ 39
691
+ 40
692
+ 41
693
+ 42
694
+ 43
695
+ 44
696
+ 45
697
+ 46
698
+ 47
699
+ 48
700
+ 49
701
+ 50
702
+ 51
703
+ 52
704
+ 53
705
+ 54
706
+ 55
707
+ 56
708
+ 57
709
+ 58
710
+ 59
711
+ 60
712
+ 61
713
+ 62
714
+ 63
715
+ 64
716
+ 65
717
+ 66
718
+ 67
719
+ 68
720
+ 69
721
+ 70
722
+ 71
723
+ 72
724
+ 73
725
+ 74
726
+ 75
727
+ 76
728
+ 77</pre>
729
+ </td>
730
+ <td>
731
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 27</span>
732
+
733
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>1</span><span class='rparen'>)</span>
734
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>List is empty</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
735
+
736
+ <span class='id identifier rubyid_items'>items</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
737
+
738
+ <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_proxy'>proxy</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='op'>|</span>
739
+ <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_delete_at'>delete_at</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
740
+
741
+ <span class='kw'>if</span> <span class='id identifier rubyid_connectable?'>connectable?</span> <span class='id identifier rubyid_proxy'>proxy</span>
742
+ <span class='ivar'>@list</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_proxy'>proxy</span>
743
+
744
+ <span class='kw'>if</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>1</span>
745
+ <span class='id identifier rubyid_items'>items</span> <span class='op'>=</span> <span class='id identifier rubyid_proxy'>proxy</span>
746
+ <span class='kw'>break</span>
747
+ <span class='kw'>else</span>
748
+ <span class='id identifier rubyid_items'>items</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_proxy'>proxy</span>
749
+ <span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='id identifier rubyid_count'>count</span>
750
+ <span class='kw'>end</span>
751
+ <span class='kw'>else</span>
752
+ <span class='ivar'>@bad_list</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_proxy'>proxy</span>
753
+ <span class='kw'>end</span>
754
+ <span class='kw'>end</span>
755
+
756
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>There are no available proxy</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
757
+
758
+ <span class='kw'>if</span> <span class='ivar'>@list_file</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@bad_list_file</span>
759
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='ivar'>@list_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
760
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
761
+
762
+ <span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
763
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p'>p</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p'>p</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
764
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@list</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rbracket'>]</span>
765
+ <span class='kw'>end</span>
766
+
767
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span>
768
+ <span class='kw'>end</span>
769
+
770
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='ivar'>@bad_list_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
771
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
772
+
773
+ <span class='ivar'>@bad_list</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
774
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p'>p</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p'>p</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
775
+ <span class='id identifier rubyid_source'>source</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@bad_list</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rbracket'>]</span>
776
+ <span class='kw'>end</span>
777
+
778
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span>
779
+ <span class='kw'>end</span>
780
+ <span class='kw'>end</span>
781
+
782
+ <span class='id identifier rubyid_items'>items</span>
783
+ <span class='kw'>end</span></pre>
784
+ </td>
785
+ </tr>
786
+ </table>
787
+ </div>
788
+
789
+ <div class="method_details ">
790
+ <h3 class="signature " id="load_list_from_array-instance_method">
791
+
792
+ - (<tt>Object</tt>) <strong>load_list_from_array</strong>(proxies) <span class="extras">(private)</span>
793
+
794
+
795
+
796
+
797
+
798
+ </h3><table class="source_code">
799
+ <tr>
800
+ <td>
801
+ <pre class="lines">
802
+
803
+
804
+ 81
805
+ 82
806
+ 83</pre>
807
+ </td>
808
+ <td>
809
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 81</span>
810
+
811
+ <span class='kw'>def</span> <span class='id identifier rubyid_load_list_from_array'>load_list_from_array</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='rparen'>)</span>
812
+ <span class='ivar'>@list</span> <span class='op'>=</span> <span class='id identifier rubyid_proxies'>proxies</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
813
+ <span class='kw'>end</span></pre>
814
+ </td>
815
+ </tr>
816
+ </table>
817
+ </div>
818
+
819
+ <div class="method_details ">
820
+ <h3 class="signature " id="load_list_from_file-instance_method">
821
+
822
+ - (<tt>Object</tt>) <strong>load_list_from_file</strong>(proxies) <span class="extras">(private)</span>
823
+
824
+
825
+
826
+
827
+
828
+ </h3><table class="source_code">
829
+ <tr>
830
+ <td>
831
+ <pre class="lines">
832
+
833
+
834
+ 85
835
+ 86
836
+ 87
837
+ 88
838
+ 89
839
+ 90
840
+ 91
841
+ 92</pre>
842
+ </td>
843
+ <td>
844
+ <pre class="code"><span class="info file"># File 'lib/proxy_manager/main.rb', line 85</span>
845
+
846
+ <span class='kw'>def</span> <span class='id identifier rubyid_load_list_from_file'>load_list_from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='rparen'>)</span>
847
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_proxies'>proxies</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>r</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
848
+ <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
849
+ <span class='kw'>if</span> <span class='id identifier rubyid_line'>line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span> <span class='kw'>and</span> <span class='id identifier rubyid_line'>line</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
850
+ <span class='ivar'>@list</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_line'>line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbracket'>]</span>
851
+ <span class='kw'>end</span>
852
+ <span class='kw'>end</span>
853
+ <span class='kw'>end</span></pre>
854
+ </td>
855
+ </tr>
856
+ </table>
857
+ </div>
858
+
859
+ </div>
860
+
861
+ </div>
862
+
863
+ <div id="footer">
864
+ Generated on Mon Mar 31 19:20:19 2014 by
865
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
866
+ 0.8.7.4 (ruby-2.1.0).
867
+ </div>
868
+
869
+ </body>
870
+ </html>