pingr 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/docs/Pingr.html ADDED
@@ -0,0 +1,593 @@
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: Pingr
8
+
9
+ &mdash; Pingr
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Pingr";
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 (P)</a> &raquo;
40
+
41
+
42
+ <span class="title">Pingr</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: Pingr
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/pingr.rb<span class="defines">,<br />
82
+ lib/pingr/request.rb,<br /> lib/pingr/version.rb,<br /> lib/pingr/search_engines/base.rb,<br /> lib/pingr/search_engines/bing.rb,<br /> lib/pingr/search_engines/google.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Defined Under Namespace</h2>
89
+ <p class="children">
90
+
91
+
92
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Pingr/SearchEngines.html" title="Pingr::SearchEngines (module)">SearchEngines</a></span>
93
+
94
+
95
+
96
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Pingr/PingrError.html" title="Pingr::PingrError (class)">PingrError</a></span>, <span class='object_link'><a href="Pingr/Request.html" title="Pingr::Request (class)">Request</a></span>
97
+
98
+
99
+ </p>
100
+
101
+
102
+ <h2>
103
+ Constant Summary
104
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
105
+ </h2>
106
+
107
+ <dl class="constants">
108
+
109
+ <dt id="VERSION-constant" class="">VERSION =
110
+
111
+ </dt>
112
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.2.2</span><span class='tstring_end'>&#39;</span></span></pre></dd>
113
+
114
+ </dl>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+ <h2>
125
+ Class Method Summary
126
+ <small><a href="#" class="summary_toggle">collapse</a></small>
127
+ </h2>
128
+
129
+ <ul class="summary">
130
+
131
+ <li class="public ">
132
+ <span class="summary_signature">
133
+
134
+ <a href="#logger-class_method" title="logger (class method)">.<strong>logger</strong> &#x21d2; Object </a>
135
+
136
+
137
+
138
+ </span>
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+ <span class="summary_desc"><div class='inline'><p>A custom logger to keep track of the Pings.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#logger=-class_method" title="logger= (class method)">.<strong>logger=</strong>(_logger) &#x21d2; Object </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'><p>Sets the logger to be used.</p>
172
+ </div></span>
173
+
174
+ </li>
175
+
176
+
177
+ <li class="private ">
178
+ <span class="summary_signature">
179
+
180
+ <a href="#logger_name-class_method" title="logger_name (class method)">.<strong>logger_name</strong> &#x21d2; Object </a>
181
+
182
+
183
+
184
+ </span>
185
+
186
+
187
+
188
+ <span class="note title private">private</span>
189
+
190
+
191
+
192
+
193
+
194
+ <span class="summary_desc"><div class='inline'><p>Private: The name of the Logger used by Pingr.</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ <li class="public ">
201
+ <span class="summary_signature">
202
+
203
+ <a href="#mode-class_method" title="mode (class method)">.<strong>mode</strong> &#x21d2; Object </a>
204
+
205
+
206
+
207
+ </span>
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <span class="summary_desc"><div class='inline'><p>The mode Pingr is running in.</p>
218
+ </div></span>
219
+
220
+ </li>
221
+
222
+
223
+ <li class="public ">
224
+ <span class="summary_signature">
225
+
226
+ <a href="#mode=-class_method" title="mode= (class method)">.<strong>mode=</strong>(mode_name) &#x21d2; Object </a>
227
+
228
+
229
+
230
+ </span>
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+ <span class="summary_desc"><div class='inline'><p>Set the mode Pingr is running in.</p>
241
+ </div></span>
242
+
243
+ </li>
244
+
245
+
246
+ </ul>
247
+
248
+
249
+
250
+
251
+ <div id="class_method_details" class="method_details_list">
252
+ <h2>Class Method Details</h2>
253
+
254
+
255
+ <div class="method_details first">
256
+ <h3 class="signature first" id="logger-class_method">
257
+
258
+ .<strong>logger</strong> &#x21d2; <tt>Object</tt>
259
+
260
+
261
+
262
+
263
+
264
+ </h3><div class="docstring">
265
+ <div class="discussion">
266
+ <p>A custom logger to keep track of the Pings</p>
267
+
268
+
269
+ </div>
270
+ </div>
271
+ <div class="tags">
272
+
273
+ <p class="tag_title">Returns:</p>
274
+ <ul class="return">
275
+
276
+ <li>
277
+
278
+
279
+ <span class='type'></span>
280
+
281
+
282
+
283
+
284
+ <div class='inline'><p>a Logger object. By default, the log clears itself every week</p>
285
+ </div>
286
+
287
+ </li>
288
+
289
+ </ul>
290
+
291
+ </div><table class="source_code">
292
+ <tr>
293
+ <td>
294
+ <pre class="lines">
295
+
296
+
297
+ 43
298
+ 44
299
+ 45
300
+ 46
301
+ 47
302
+ 48
303
+ 49</pre>
304
+ </td>
305
+ <td>
306
+ <pre class="code"><span class="info file"># File 'lib/pingr.rb', line 43</span>
307
+
308
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
309
+ <span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span>
310
+ <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
311
+ <span class='kw'>else</span>
312
+ <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_logger_name'>logger_name</span><span class='comma'>,</span> <span class='id identifier rubyid_shift_age'>shift_age</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>weekly</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
313
+ <span class='kw'>end</span>
314
+ <span class='kw'>end</span></pre>
315
+ </td>
316
+ </tr>
317
+ </table>
318
+ </div>
319
+
320
+ <div class="method_details ">
321
+ <h3 class="signature " id="logger=-class_method">
322
+
323
+ .<strong>logger=</strong>(_logger) &#x21d2; <tt>Object</tt>
324
+
325
+
326
+
327
+
328
+
329
+ </h3><div class="docstring">
330
+ <div class="discussion">
331
+ <p>Sets the logger to be used.
332
+ If the developer would like to use their own custom logger, let &#39;em.</p>
333
+
334
+
335
+ </div>
336
+ </div>
337
+ <div class="tags">
338
+
339
+
340
+ </div><table class="source_code">
341
+ <tr>
342
+ <td>
343
+ <pre class="lines">
344
+
345
+
346
+ 53
347
+ 54
348
+ 55</pre>
349
+ </td>
350
+ <td>
351
+ <pre class="code"><span class="info file"># File 'lib/pingr.rb', line 53</span>
352
+
353
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_logger='>logger=</span><span class='lparen'>(</span><span class='id identifier rubyid__logger'>_logger</span><span class='rparen'>)</span>
354
+ <span class='ivar'>@logger</span> <span class='op'>=</span> <span class='id identifier rubyid__logger'>_logger</span>
355
+ <span class='kw'>end</span></pre>
356
+ </td>
357
+ </tr>
358
+ </table>
359
+ </div>
360
+
361
+ <div class="method_details ">
362
+ <h3 class="signature " id="logger_name-class_method">
363
+
364
+ .<strong>logger_name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(private)</span>
365
+
366
+
367
+
368
+
369
+
370
+ </h3><div class="docstring">
371
+ <div class="discussion">
372
+ <p>Private: The name of the Logger used by Pingr.
373
+ If we&#39;ve detected a Rails app, sets up a log file in the log directory.
374
+ Otherwise, use STDOUT</p>
375
+
376
+
377
+ </div>
378
+ </div>
379
+ <div class="tags">
380
+
381
+ <p class="tag_title">Returns:</p>
382
+ <ul class="return">
383
+
384
+ <li>
385
+
386
+
387
+ <span class='type'></span>
388
+
389
+
390
+
391
+
392
+ <div class='inline'><p>a String with the logger name or an IO object</p>
393
+ </div>
394
+
395
+ </li>
396
+
397
+ </ul>
398
+
399
+ </div><table class="source_code">
400
+ <tr>
401
+ <td>
402
+ <pre class="lines">
403
+
404
+
405
+ 64
406
+ 65
407
+ 66
408
+ 67
409
+ 68
410
+ 69
411
+ 70</pre>
412
+ </td>
413
+ <td>
414
+ <pre class="code"><span class="info file"># File 'lib/pingr.rb', line 64</span>
415
+
416
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_logger_name'>logger_name</span>
417
+ <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span>
418
+ <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>log</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='embexpr_end'>}</span><span class='tstring_content'>.log</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
419
+ <span class='kw'>else</span>
420
+ <span class='const'>STDOUT</span>
421
+ <span class='kw'>end</span>
422
+ <span class='kw'>end</span></pre>
423
+ </td>
424
+ </tr>
425
+ </table>
426
+ </div>
427
+
428
+ <div class="method_details ">
429
+ <h3 class="signature " id="mode-class_method">
430
+
431
+ .<strong>mode</strong> &#x21d2; <tt>Object</tt>
432
+
433
+
434
+
435
+
436
+
437
+ </h3><div class="docstring">
438
+ <div class="discussion">
439
+ <p>The mode Pingr is running in</p>
440
+
441
+
442
+ </div>
443
+ </div>
444
+ <div class="tags">
445
+
446
+ <p class="tag_title">Returns:</p>
447
+ <ul class="return">
448
+
449
+ <li>
450
+
451
+
452
+ <span class='type'></span>
453
+
454
+
455
+
456
+
457
+ <div class='inline'><p>a Symbol either :test or :live</p>
458
+ </div>
459
+
460
+ </li>
461
+
462
+ </ul>
463
+
464
+ </div><table class="source_code">
465
+ <tr>
466
+ <td>
467
+ <pre class="lines">
468
+
469
+
470
+ 30
471
+ 31
472
+ 32
473
+ 33
474
+ 34
475
+ 35
476
+ 36
477
+ 37
478
+ 38</pre>
479
+ </td>
480
+ <td>
481
+ <pre class="code"><span class="info file"># File 'lib/pingr.rb', line 30</span>
482
+
483
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mode'>mode</span>
484
+ <span class='ivar'>@mode</span> <span class='op'>||=</span> <span class='kw'>begin</span>
485
+ <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Rails</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='period'>.</span><span class='id identifier rubyid_production?'>production?</span>
486
+ <span class='symbol'>:live</span>
487
+ <span class='kw'>else</span>
488
+ <span class='symbol'>:test</span>
489
+ <span class='kw'>end</span>
490
+ <span class='kw'>end</span>
491
+ <span class='kw'>end</span></pre>
492
+ </td>
493
+ </tr>
494
+ </table>
495
+ </div>
496
+
497
+ <div class="method_details ">
498
+ <h3 class="signature " id="mode=-class_method">
499
+
500
+ .<strong>mode=</strong>(mode_name) &#x21d2; <tt>Object</tt>
501
+
502
+
503
+
504
+
505
+
506
+ </h3><div class="docstring">
507
+ <div class="discussion">
508
+ <p>Set the mode Pingr is running in</p>
509
+
510
+
511
+ </div>
512
+ </div>
513
+ <div class="tags">
514
+ <p class="tag_title">Parameters:</p>
515
+ <ul class="param">
516
+
517
+ <li>
518
+
519
+ <span class='name'>mode_name</span>
520
+
521
+
522
+ <span class='type'></span>
523
+
524
+
525
+
526
+ &mdash;
527
+ <div class='inline'><p>A Symbol or String value for the mode. Must be one of :test or :live</p>
528
+ </div>
529
+
530
+ </li>
531
+
532
+ </ul>
533
+
534
+ <p class="tag_title">Raises:</p>
535
+ <ul class="raise">
536
+
537
+ <li>
538
+
539
+
540
+ <span class='type'></span>
541
+
542
+
543
+
544
+
545
+ <div class='inline'><p>PingrError if an invalid value is passed</p>
546
+ </div>
547
+
548
+ </li>
549
+
550
+ </ul>
551
+
552
+ </div><table class="source_code">
553
+ <tr>
554
+ <td>
555
+ <pre class="lines">
556
+
557
+
558
+ 19
559
+ 20
560
+ 21
561
+ 22
562
+ 23
563
+ 24
564
+ 25</pre>
565
+ </td>
566
+ <td>
567
+ <pre class="code"><span class="info file"># File 'lib/pingr.rb', line 19</span>
568
+
569
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mode='>mode=</span><span class='lparen'>(</span><span class='id identifier rubyid_mode_name'>mode_name</span><span class='rparen'>)</span>
570
+ <span class='kw'>unless</span> <span class='id identifier rubyid_mode_name'>mode_name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>test|live</span><span class='regexp_end'>/</span></span>
571
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Pingr/PingrError.html" title="Pingr::PingrError (class)">PingrError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unknown mode: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_mode_name'>mode_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
572
+ <span class='kw'>end</span>
573
+
574
+ <span class='ivar'>@mode</span> <span class='op'>=</span> <span class='id identifier rubyid_mode_name'>mode_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
575
+ <span class='kw'>end</span></pre>
576
+ </td>
577
+ </tr>
578
+ </table>
579
+ </div>
580
+
581
+ </div>
582
+
583
+ </div>
584
+
585
+ <div id="footer">
586
+ Generated on Thu Aug 13 16:28:50 2020 by
587
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
588
+ 0.9.24 (ruby-2.6.6).
589
+ </div>
590
+
591
+ </div>
592
+ </body>
593
+ </html>
data/docs/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-leap-day