tainted_love 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/Gemfile.lock +1 -1
  4. data/README.md +8 -0
  5. data/example/Gemfile.lock +1 -1
  6. data/example/test/test_helper.rb +3 -1
  7. data/lib/tainted_love/replacer/replace_action_view.rb +1 -1
  8. data/lib/tainted_love/reporter/file_reporter.rb +9 -5
  9. data/lib/tainted_love/reporter/stdout_reporter.rb +29 -9
  10. data/lib/tainted_love/validator/railties_yaml_load.rb +16 -0
  11. data/lib/tainted_love/version.rb +1 -1
  12. data/tools/web/.gitignore +1 -0
  13. data/tools/web/Gemfile +3 -0
  14. data/tools/web/application.rb +39 -0
  15. data/tools/web/public/application.css +79 -0
  16. data/tools/web/public/application.js +0 -0
  17. data/tools/web/views/index.erb +57 -0
  18. data/tools/web/views/layout.erb +25 -0
  19. data/tools/web/views/line.erb +11 -0
  20. data/tools/web/views/warning.erb +3 -0
  21. data/tools/web/views/warnings.erb +3 -0
  22. metadata +13 -53
  23. data/docs/TaintedLove.html +0 -482
  24. data/docs/TaintedLove/Configuration.html +0 -499
  25. data/docs/TaintedLove/Replacer.html +0 -129
  26. data/docs/TaintedLove/Replacer/ActionViewHelpersMod.html +0 -230
  27. data/docs/TaintedLove/Replacer/Base.html +0 -320
  28. data/docs/TaintedLove/Replacer/HelperMod.html +0 -226
  29. data/docs/TaintedLove/Replacer/HelpersMod.html +0 -230
  30. data/docs/TaintedLove/Replacer/MarshalMod.html +0 -178
  31. data/docs/TaintedLove/Replacer/ObjectMod.html +0 -282
  32. data/docs/TaintedLove/Replacer/ReplaceActionController.html +0 -329
  33. data/docs/TaintedLove/Replacer/ReplaceActionView.html +0 -317
  34. data/docs/TaintedLove/Replacer/ReplaceActiveRecord.html +0 -341
  35. data/docs/TaintedLove/Replacer/ReplaceDigest.html +0 -369
  36. data/docs/TaintedLove/Replacer/ReplaceFile.html +0 -245
  37. data/docs/TaintedLove/Replacer/ReplaceKernel.html +0 -211
  38. data/docs/TaintedLove/Replacer/ReplaceMarshal.html +0 -219
  39. data/docs/TaintedLove/Replacer/ReplaceObject.html +0 -231
  40. data/docs/TaintedLove/Replacer/ReplaceRailsUserInput.html +0 -374
  41. data/docs/TaintedLove/Replacer/ReplaceSprokets.html +0 -297
  42. data/docs/TaintedLove/Replacer/SprocketsHelperMod.html +0 -226
  43. data/docs/TaintedLove/Reporter.html +0 -117
  44. data/docs/TaintedLove/Reporter/Base.html +0 -466
  45. data/docs/TaintedLove/Reporter/RackReporter.html +0 -309
  46. data/docs/TaintedLove/Reporter/SinatraReporter.html +0 -402
  47. data/docs/TaintedLove/Reporter/SinatraReporter/App.html +0 -210
  48. data/docs/TaintedLove/Reporter/StdoutReporter.html +0 -305
  49. data/docs/TaintedLove/SinatraReporter.html +0 -387
  50. data/docs/TaintedLove/SinatraReporter/App.html +0 -210
  51. data/docs/TaintedLove/StackTrace.html +0 -650
  52. data/docs/TaintedLove/Utils.html +0 -550
  53. data/docs/TaintedLove/Validator.html +0 -129
  54. data/docs/TaintedLove/Validator/ActionViewObjectSend.html +0 -233
  55. data/docs/TaintedLove/Validator/Base.html +0 -200
  56. data/docs/TaintedLove/Validator/ErbEval.html +0 -229
  57. data/docs/TaintedLove/Validator/RedisStoreSerialization.html +0 -238
  58. data/docs/TaintedLove/Validator/SproketsMarshal.html +0 -233
  59. data/docs/TaintedLove/Warning.html +0 -665
  60. data/docs/_index.html +0 -371
  61. data/docs/class_list.html +0 -51
  62. data/docs/css/common.css +0 -1
  63. data/docs/css/full_list.css +0 -58
  64. data/docs/css/style.css +0 -496
  65. data/docs/file.README.html +0 -134
  66. data/docs/file_list.html +0 -56
  67. data/docs/frames.html +0 -17
  68. data/docs/index.html +0 -134
  69. data/docs/js/app.js +0 -292
  70. data/docs/js/full_list.js +0 -216
  71. data/docs/js/jquery.js +0 -4
  72. data/docs/method_list.html +0 -523
  73. data/docs/top-level-namespace.html +0 -110
@@ -1,550 +0,0 @@
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: TaintedLove::Utils
8
-
9
- &mdash; Documentation by YARD 0.9.18
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 = "TaintedLove::Utils";
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 (U)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../TaintedLove.html" title="TaintedLove (module)">TaintedLove</a></span></span>
41
- &raquo;
42
- <span class="title">Utils</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: TaintedLove::Utils
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
- <dl>
78
- <dt>Included in:</dt>
79
- <dd><span class='object_link'><a href="../TaintedLove.html" title="TaintedLove (module)">TaintedLove</a></span></dd>
80
- </dl>
81
-
82
-
83
-
84
- <dl>
85
- <dt>Defined in:</dt>
86
- <dd>lib/tainted_love/utils.rb</dd>
87
- </dl>
88
-
89
- </div>
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <h2>
100
- Instance Method Summary
101
- <small><a href="#" class="summary_toggle">collapse</a></small>
102
- </h2>
103
-
104
- <ul class="summary">
105
-
106
- <li class="public ">
107
- <span class="summary_signature">
108
-
109
- <a href="#add_tracking-instance_method" title="#add_tracking (instance method)">#<strong>add_tracking</strong>(object, payload = {}) {|Object| ... } &#x21d2; Object </a>
110
-
111
-
112
-
113
- </span>
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
- <span class="summary_desc"><div class='inline'>
124
- <p>Adds information about the object.</p>
125
- </div></span>
126
-
127
- </li>
128
-
129
-
130
- <li class="public ">
131
- <span class="summary_signature">
132
-
133
- <a href="#hash-instance_method" title="#hash (instance method)">#<strong>hash</strong>(str) &#x21d2; Object </a>
134
-
135
-
136
-
137
- </span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- <span class="summary_desc"><div class='inline'>
148
- <p>Create a hex encoded MD5 hash.</p>
149
- </div></span>
150
-
151
- </li>
152
-
153
-
154
- <li class="public ">
155
- <span class="summary_signature">
156
-
157
- <a href="#proxy_method-instance_method" title="#proxy_method (instance method)">#<strong>proxy_method</strong>(klass, method, replace_return_value = false) {|*args, &amp;block| ... } &#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'>
172
- <p>Replaces a method defined in klass.</p>
173
- </div></span>
174
-
175
- </li>
176
-
177
-
178
- </ul>
179
-
180
-
181
-
182
-
183
- <div id="instance_method_details" class="method_details_list">
184
- <h2>Instance Method Details</h2>
185
-
186
-
187
- <div class="method_details first">
188
- <h3 class="signature first" id="add_tracking-instance_method">
189
-
190
- #<strong>add_tracking</strong>(object, payload = {}) {|Object| ... } &#x21d2; <tt>Object</tt>
191
-
192
-
193
-
194
-
195
-
196
- </h3><div class="docstring">
197
- <div class="discussion">
198
-
199
- <p>Adds information about the object. The information can be about where the
200
- object is coming from, validation that has been done on the object, etc.</p>
201
-
202
- <p>If the object is frozen, the given block will be called with a new object.
203
- The caller has the responsability of replacing the frozen object with this
204
- new object.</p>
205
-
206
-
207
- </div>
208
- </div>
209
- <div class="tags">
210
- <p class="tag_title">Parameters:</p>
211
- <ul class="param">
212
-
213
- <li>
214
-
215
- <span class='name'>object</span>
216
-
217
-
218
- <span class='type'>(<tt>Object</tt>)</span>
219
-
220
-
221
-
222
- &mdash;
223
- <div class='inline'>
224
- <p>Object to add tracking</p>
225
- </div>
226
-
227
- </li>
228
-
229
- <li>
230
-
231
- <span class='name'>payload</span>
232
-
233
-
234
- <span class='type'>(<tt>Hash</tt>)</span>
235
-
236
-
237
- <em class="default">(defaults to: <tt>{}</tt>)</em>
238
-
239
-
240
- &mdash;
241
- <div class='inline'>
242
- <p>Data to add to the object</p>
243
- </div>
244
-
245
- </li>
246
-
247
- </ul>
248
-
249
- <p class="tag_title">Yields:</p>
250
- <ul class="yield">
251
-
252
- <li>
253
-
254
-
255
- <span class='type'>(<tt>Object</tt>)</span>
256
-
257
-
258
-
259
- &mdash;
260
- <div class='inline'>
261
- <p>Invoked with a duplicate unfrozen version of object</p>
262
- </div>
263
-
264
- </li>
265
-
266
- </ul>
267
- <p class="tag_title">Returns:</p>
268
- <ul class="return">
269
-
270
- <li>
271
-
272
-
273
- <span class='type'>(<tt>Object</tt>)</span>
274
-
275
-
276
-
277
- &mdash;
278
- <div class='inline'>
279
- <p>Given object or dup of it</p>
280
- </div>
281
-
282
- </li>
283
-
284
- </ul>
285
-
286
- </div><table class="source_code">
287
- <tr>
288
- <td>
289
- <pre class="lines">
290
-
291
-
292
- 54
293
- 55
294
- 56
295
- 57
296
- 58
297
- 59
298
- 60
299
- 61
300
- 62
301
- 63
302
- 64
303
- 65
304
- 66
305
- 67
306
- 68</pre>
307
- </td>
308
- <td>
309
- <pre class="code"><span class="info file"># File 'lib/tainted_love/utils.rb', line 54</span>
310
-
311
- <span class='kw'>def</span> <span class='id identifier rubyid_add_tracking'>add_tracking</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
312
- <span class='id identifier rubyid_frozen'>frozen</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_frozen?'>frozen?</span>
313
-
314
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_frozen'>frozen</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
315
-
316
- <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:stacktrace</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="StackTrace.html" title="TaintedLove::StackTrace (class)">StackTrace</a></span></span><span class='period'>.</span><span class='id identifier rubyid_current'><span class='object_link'><a href="StackTrace.html#current-class_method" title="TaintedLove::StackTrace.current (method)">current</a></span></span>
317
-
318
- <span class='id identifier rubyid_object'>object</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='kw'>if</span> <span class='id identifier rubyid_frozen'>frozen</span>
319
-
320
- <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_tainted_love_tracking'>tainted_love_tracking</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_payload'>payload</span>
321
-
322
- <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_frozen'>frozen</span>
323
-
324
- <span class='id identifier rubyid_object'>object</span>
325
- <span class='kw'>end</span></pre>
326
- </td>
327
- </tr>
328
- </table>
329
- </div>
330
-
331
- <div class="method_details ">
332
- <h3 class="signature " id="hash-instance_method">
333
-
334
- #<strong>hash</strong>(str) &#x21d2; <tt>Object</tt>
335
-
336
-
337
-
338
-
339
-
340
- </h3><div class="docstring">
341
- <div class="discussion">
342
-
343
- <p>Create a hex encoded MD5 hash</p>
344
-
345
-
346
- </div>
347
- </div>
348
- <div class="tags">
349
-
350
-
351
- </div><table class="source_code">
352
- <tr>
353
- <td>
354
- <pre class="lines">
355
-
356
-
357
- 74
358
- 75
359
- 76
360
- 77
361
- 78</pre>
362
- </td>
363
- <td>
364
- <pre class="code"><span class="info file"># File 'lib/tainted_love/utils.rb', line 74</span>
365
-
366
- <span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
367
- <span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>MD5</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
368
- <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
369
- <span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span>
370
- <span class='kw'>end</span></pre>
371
- </td>
372
- </tr>
373
- </table>
374
- </div>
375
-
376
- <div class="method_details ">
377
- <h3 class="signature " id="proxy_method-instance_method">
378
-
379
- #<strong>proxy_method</strong>(klass, method, replace_return_value = false) {|*args, &amp;block| ... } &#x21d2; <tt>Object</tt>
380
-
381
-
382
-
383
-
384
-
385
- </h3><div class="docstring">
386
- <div class="discussion">
387
-
388
- <p>Replaces a method defined in klass.</p>
389
-
390
-
391
- </div>
392
- </div>
393
- <div class="tags">
394
- <p class="tag_title">Parameters:</p>
395
- <ul class="param">
396
-
397
- <li>
398
-
399
- <span class='name'>klass</span>
400
-
401
-
402
- <span class='type'>(<tt>Class</tt>, <tt>String</tt>)</span>
403
-
404
-
405
-
406
- &mdash;
407
- <div class='inline'>
408
- <p>The target class</p>
409
- </div>
410
-
411
- </li>
412
-
413
- <li>
414
-
415
- <span class='name'>method</span>
416
-
417
-
418
- <span class='type'>(<tt>Symbol</tt>)</span>
419
-
420
-
421
-
422
- &mdash;
423
- <div class='inline'>
424
- <p>The method name to replace</p>
425
- </div>
426
-
427
- </li>
428
-
429
- <li>
430
-
431
- <span class='name'>replace_return_value</span>
432
-
433
-
434
- <span class='type'>(<tt>Boolean</tt>)</span>
435
-
436
-
437
- <em class="default">(defaults to: <tt>false</tt>)</em>
438
-
439
-
440
- &mdash;
441
- <div class='inline'>
442
- <p>If true, the return value of the function will be the value returned by the
443
- block. Otherwise, the function will return its original value.</p>
444
- </div>
445
-
446
- </li>
447
-
448
- </ul>
449
-
450
- <p class="tag_title">Yields:</p>
451
- <ul class="yield">
452
-
453
- <li>
454
-
455
-
456
- <span class='type'>(<tt>*args</tt>, <tt>&block</tt>)</span>
457
-
458
-
459
-
460
- &mdash;
461
- <div class='inline'>
462
- <p>Block to execute when the function is called</p>
463
- </div>
464
-
465
- </li>
466
-
467
- </ul>
468
-
469
- </div><table class="source_code">
470
- <tr>
471
- <td>
472
- <pre class="lines">
473
-
474
-
475
- 15
476
- 16
477
- 17
478
- 18
479
- 19
480
- 20
481
- 21
482
- 22
483
- 23
484
- 24
485
- 25
486
- 26
487
- 27
488
- 28
489
- 29
490
- 30
491
- 31
492
- 32
493
- 33
494
- 34
495
- 35
496
- 36
497
- 37
498
- 38
499
- 39
500
- 40
501
- 41</pre>
502
- </td>
503
- <td>
504
- <pre class="code"><span class="info file"># File 'lib/tainted_love/utils.rb', line 15</span>
505
-
506
- <span class='kw'>def</span> <span class='id identifier rubyid_proxy_method'>proxy_method</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_replace_return_value'>replace_return_value</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
507
- <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</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>
508
- <span class='kw'>if</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
509
- <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
510
- <span class='kw'>else</span>
511
- <span class='kw'>return</span>
512
- <span class='kw'>end</span>
513
- <span class='kw'>end</span>
514
-
515
- <span class='id identifier rubyid_original_method'>original_method</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>_tainted_love_original_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_method'>method</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
516
-
517
- <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
518
- <span class='id identifier rubyid_alias_method'>alias_method</span> <span class='id identifier rubyid_original_method'>original_method</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span>
519
-
520
- <span class='id identifier rubyid_define_method'>define_method</span> <span class='id identifier rubyid_method'>method</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_given_block'>given_block</span><span class='op'>|</span>
521
- <span class='id identifier rubyid_return_value'>return_value</span> <span class='op'>=</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_original_method'>original_method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_given_block'>given_block</span><span class='rparen'>)</span>
522
-
523
- <span class='id identifier rubyid_block_return'>block_return</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_return_value'>return_value</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
524
-
525
- <span class='kw'>if</span> <span class='id identifier rubyid_replace_return_value'>replace_return_value</span>
526
- <span class='id identifier rubyid_block_return'>block_return</span>
527
- <span class='kw'>else</span>
528
- <span class='id identifier rubyid_return_value'>return_value</span>
529
- <span class='kw'>end</span>
530
- <span class='kw'>end</span>
531
- <span class='kw'>end</span>
532
- <span class='kw'>end</span></pre>
533
- </td>
534
- </tr>
535
- </table>
536
- </div>
537
-
538
- </div>
539
-
540
- </div>
541
-
542
- <div id="footer">
543
- Generated on Tue Apr 2 15:50:34 2019 by
544
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
545
- 0.9.18 (ruby-2.5.3).
546
- </div>
547
-
548
- </div>
549
- </body>
550
- </html>