brakeman 4.8.0 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +144 -2
  3. data/README.md +23 -6
  4. data/bundle/load.rb +7 -5
  5. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/CHANGELOG.md +24 -0
  6. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/FAQ.md +0 -0
  7. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/Gemfile +1 -4
  8. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/MIT-LICENSE +0 -0
  9. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/README.md +21 -16
  10. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/REFERENCE.md +39 -10
  11. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/TODO +0 -0
  12. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/haml.gemspec +2 -1
  13. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/attribute_builder.rb +58 -3
  14. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/attribute_compiler.rb +45 -32
  15. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/attribute_parser.rb +0 -0
  16. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/buffer.rb +0 -56
  17. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/compiler.rb +0 -0
  18. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/engine.rb +0 -0
  19. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/error.rb +0 -0
  20. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/escapable.rb +77 -0
  21. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/exec.rb +0 -0
  22. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/filters.rb +0 -0
  23. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/generator.rb +0 -0
  24. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/action_view_extensions.rb +0 -0
  25. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/action_view_mods.rb +0 -0
  26. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/action_view_xss_mods.rb +0 -0
  27. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/safe_erubi_template.rb +0 -0
  28. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/safe_erubis_template.rb +0 -0
  29. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers/xss_mods.rb +6 -3
  30. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/helpers.rb +7 -1
  31. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/options.rb +0 -0
  32. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/parser.rb +32 -4
  33. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/plugin.rb +18 -1
  34. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/railtie.rb +5 -0
  35. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/sass_rails_filter.rb +0 -0
  36. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/template/options.rb +0 -0
  37. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/template.rb +0 -0
  38. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/temple_engine.rb +2 -1
  39. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/temple_line_counter.rb +0 -0
  40. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/util.rb +1 -1
  41. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml/version.rb +1 -1
  42. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/lib/haml.rb +0 -0
  43. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/yard/default/fulldoc/html/css/common.sass +0 -0
  44. data/bundle/ruby/2.7.0/gems/{haml-5.1.2 → haml-5.2.2}/yard/default/layout/html/footer.erb +0 -0
  45. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/MIT-LICENSE.txt +20 -0
  46. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/processor_count.rb +45 -0
  47. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/version.rb +4 -0
  48. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb +532 -0
  49. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
  50. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/NEWS.md +178 -0
  51. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/README.md +48 -0
  52. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
  53. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
  54. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
  55. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
  56. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
  57. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
  58. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
  59. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
  60. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
  61. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
  62. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
  63. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
  64. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
  65. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
  66. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
  67. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
  68. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
  69. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
  70. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
  71. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
  72. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
  73. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
  74. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
  75. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
  76. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
  77. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
  78. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
  79. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
  80. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
  81. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
  82. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
  83. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
  84. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
  85. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
  86. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
  87. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
  88. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
  89. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
  90. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
  91. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
  92. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
  93. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
  94. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
  95. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
  96. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
  97. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
  98. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
  99. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
  100. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
  101. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
  102. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/History.rdoc +148 -0
  103. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/Manifest.txt +7 -0
  104. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/README.rdoc +1 -0
  105. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/compare/normalize.rb +51 -6
  106. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/debugging.md +190 -0
  107. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/gauntlet.md +106 -0
  108. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/rp_extensions.rb +15 -36
  109. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/rp_stringscanner.rb +33 -0
  110. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby20_parser.rb +7128 -0
  111. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby20_parser.y +420 -296
  112. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby21_parser.rb +7182 -0
  113. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby21_parser.y +415 -293
  114. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby22_parser.rb +7228 -0
  115. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby22_parser.y +419 -295
  116. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby23_parser.rb +7237 -0
  117. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby23_parser.y +419 -295
  118. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby24_parser.rb +7268 -0
  119. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby24_parser.y +419 -295
  120. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.rb +7268 -0
  121. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2/lib/ruby26_parser.y → ruby_parser-3.18.1/lib/ruby25_parser.y} +418 -308
  122. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.rb +7287 -0
  123. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2/lib/ruby_parser.yy → ruby_parser-3.18.1/lib/ruby26_parser.y} +419 -399
  124. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.rb +8517 -0
  125. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2/lib/ruby25_parser.y → ruby_parser-3.18.1/lib/ruby27_parser.y} +1030 -294
  126. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.rb +8751 -0
  127. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.y +3472 -0
  128. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby3_parser.yy +3476 -0
  129. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby_lexer.rb +308 -605
  130. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby_lexer.rex +33 -27
  131. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby_lexer.rex.rb +65 -31
  132. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_lexer_strings.rb +638 -0
  133. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby_parser.rb +4 -0
  134. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_parser.yy +3487 -0
  135. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/lib/ruby_parser_extras.rb +341 -127
  136. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/tools/munge.rb +43 -10
  137. data/bundle/ruby/2.7.0/gems/{ruby_parser-3.14.2 → ruby_parser-3.18.1}/tools/ripper.rb +15 -10
  138. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/History.rdoc +39 -0
  139. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/Manifest.txt +0 -0
  140. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/README.rdoc +0 -0
  141. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/composite_sexp_processor.rb +0 -0
  142. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/pt_testcase.rb +9 -4
  143. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/sexp.rb +19 -9
  144. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/sexp_matcher.rb +4 -7
  145. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/sexp_processor.rb +1 -1
  146. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/strict_sexp.rb +25 -3
  147. data/bundle/ruby/2.7.0/gems/{sexp_processor-4.14.1 → sexp_processor-4.16.0}/lib/unique.rb +0 -0
  148. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/CHANGES +4 -0
  149. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/Gemfile +12 -13
  150. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/LICENSE +0 -0
  151. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/README.jp.md +0 -0
  152. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/README.md +0 -0
  153. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/code_attributes.rb +0 -0
  154. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/command.rb +13 -13
  155. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/controls.rb +0 -0
  156. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/do_inserter.rb +0 -0
  157. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/embedded.rb +0 -0
  158. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/end_inserter.rb +0 -0
  159. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/engine.rb +0 -0
  160. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/erb_converter.rb +0 -0
  161. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/filter.rb +0 -0
  162. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/grammar.rb +0 -0
  163. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/include.rb +0 -0
  164. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/interpolation.rb +0 -0
  165. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/logic_less/context.rb +0 -0
  166. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/logic_less/filter.rb +0 -0
  167. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/logic_less.rb +0 -0
  168. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/parser.rb +1 -1
  169. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/smart/escaper.rb +0 -0
  170. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/smart/filter.rb +0 -0
  171. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/smart/parser.rb +0 -0
  172. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/smart.rb +0 -0
  173. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/splat/builder.rb +0 -0
  174. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/splat/filter.rb +0 -0
  175. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/template.rb +0 -0
  176. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/translator.rb +0 -0
  177. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim/version.rb +1 -1
  178. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/lib/slim.rb +0 -0
  179. data/bundle/ruby/2.7.0/gems/{slim-4.0.1 → slim-4.1.0}/slim.gemspec +0 -0
  180. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/CHANGELOG.md +8 -0
  181. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/MIT-LICENSE.txt +0 -0
  182. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/README.md +1 -1
  183. data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  184. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/lib/unicode/display_width/constants.rb +2 -2
  185. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/lib/unicode/display_width/index.rb +0 -0
  186. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
  187. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/lib/unicode/display_width/string_ext.rb +0 -0
  188. data/bundle/ruby/2.7.0/gems/{unicode-display_width-1.6.1 → unicode-display_width-1.8.0}/lib/unicode/display_width.rb +0 -0
  189. data/lib/brakeman/app_tree.rb +37 -4
  190. data/lib/brakeman/checks/base_check.rb +18 -2
  191. data/lib/brakeman/checks/check_basic_auth.rb +2 -0
  192. data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +28 -0
  193. data/lib/brakeman/checks/check_deserialize.rb +21 -1
  194. data/lib/brakeman/checks/check_detailed_exceptions.rb +1 -1
  195. data/lib/brakeman/checks/check_eol_rails.rb +23 -0
  196. data/lib/brakeman/checks/check_eol_ruby.rb +26 -0
  197. data/lib/brakeman/checks/check_evaluation.rb +1 -1
  198. data/lib/brakeman/checks/check_execute.rb +12 -1
  199. data/lib/brakeman/checks/check_json_entity_escape.rb +38 -0
  200. data/lib/brakeman/checks/check_json_parsing.rb +1 -1
  201. data/lib/brakeman/checks/check_mass_assignment.rb +37 -9
  202. data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -1
  203. data/lib/brakeman/checks/check_model_attributes.rb +1 -1
  204. data/lib/brakeman/checks/check_page_caching_cve.rb +37 -0
  205. data/lib/brakeman/checks/check_permit_attributes.rb +1 -1
  206. data/lib/brakeman/checks/check_regex_dos.rb +1 -1
  207. data/lib/brakeman/checks/check_render.rb +15 -1
  208. data/lib/brakeman/checks/check_sanitize_methods.rb +2 -1
  209. data/lib/brakeman/checks/check_skip_before_filter.rb +4 -4
  210. data/lib/brakeman/checks/check_sql.rb +60 -9
  211. data/lib/brakeman/checks/check_symbol_dos.rb +1 -1
  212. data/lib/brakeman/checks/check_template_injection.rb +32 -0
  213. data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +68 -0
  214. data/lib/brakeman/checks/check_verb_confusion.rb +75 -0
  215. data/lib/brakeman/checks/eol_check.rb +47 -0
  216. data/lib/brakeman/commandline.rb +25 -1
  217. data/lib/brakeman/file_parser.rb +58 -22
  218. data/lib/brakeman/options.rb +39 -2
  219. data/lib/brakeman/parsers/template_parser.rb +26 -3
  220. data/lib/brakeman/processors/alias_processor.rb +132 -24
  221. data/lib/brakeman/processors/base_processor.rb +4 -4
  222. data/lib/brakeman/processors/controller_alias_processor.rb +6 -43
  223. data/lib/brakeman/processors/controller_processor.rb +1 -1
  224. data/lib/brakeman/processors/gem_processor.rb +3 -0
  225. data/lib/brakeman/processors/haml_template_processor.rb +17 -1
  226. data/lib/brakeman/processors/lib/call_conversion_helper.rb +13 -7
  227. data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
  228. data/lib/brakeman/processors/lib/find_all_calls.rb +28 -13
  229. data/lib/brakeman/processors/lib/rails3_config_processor.rb +16 -16
  230. data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -0
  231. data/lib/brakeman/processors/lib/rails4_config_processor.rb +2 -1
  232. data/lib/brakeman/processors/lib/render_helper.rb +3 -1
  233. data/lib/brakeman/processors/library_processor.rb +9 -0
  234. data/lib/brakeman/processors/model_processor.rb +32 -0
  235. data/lib/brakeman/processors/output_processor.rb +1 -1
  236. data/lib/brakeman/processors/template_alias_processor.rb +5 -0
  237. data/lib/brakeman/report/ignore/config.rb +5 -1
  238. data/lib/brakeman/report/ignore/interactive.rb +1 -1
  239. data/lib/brakeman/report/report_base.rb +0 -2
  240. data/lib/brakeman/report/report_csv.rb +37 -60
  241. data/lib/brakeman/report/report_github.rb +31 -0
  242. data/lib/brakeman/report/report_junit.rb +2 -2
  243. data/lib/brakeman/report/report_sarif.rb +133 -0
  244. data/lib/brakeman/report/report_sonar.rb +38 -0
  245. data/lib/brakeman/report/report_tabs.rb +1 -1
  246. data/lib/brakeman/report/report_text.rb +38 -17
  247. data/lib/brakeman/report.rb +19 -1
  248. data/lib/brakeman/rescanner.rb +7 -5
  249. data/lib/brakeman/scanner.rb +65 -31
  250. data/lib/brakeman/tracker/collection.rb +57 -7
  251. data/lib/brakeman/tracker/config.rb +87 -5
  252. data/lib/brakeman/tracker/constants.rb +8 -7
  253. data/lib/brakeman/tracker/controller.rb +1 -1
  254. data/lib/brakeman/tracker/method_info.rb +70 -0
  255. data/lib/brakeman/tracker.rb +42 -5
  256. data/lib/brakeman/util.rb +58 -21
  257. data/lib/brakeman/version.rb +1 -1
  258. data/lib/brakeman/warning.rb +10 -2
  259. data/lib/brakeman/warning_codes.rb +13 -0
  260. data/lib/brakeman.rb +45 -6
  261. data/lib/ruby_parser/bm_sexp.rb +33 -9
  262. metadata +201 -123
  263. data/bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/escapable.rb +0 -50
  264. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/debugging.md +0 -18
  265. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/rp_stringscanner.rb +0 -64
  266. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby20_parser.rb +0 -7042
  267. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby21_parser.rb +0 -7113
  268. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby22_parser.rb +0 -7146
  269. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby23_parser.rb +0 -7163
  270. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby24_parser.rb +0 -7175
  271. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby25_parser.rb +0 -7175
  272. data/bundle/ruby/2.7.0/gems/ruby_parser-3.14.2/lib/ruby26_parser.rb +0 -7195
  273. data/bundle/ruby/2.7.0/gems/unicode-display_width-1.6.1/data/display_width.marshal.gz +0 -0
@@ -0,0 +1,532 @@
1
+ # frozen_string_literal: true
2
+ require 'rbconfig'
3
+ require 'parallel/version'
4
+ require 'parallel/processor_count'
5
+
6
+ module Parallel
7
+ extend ProcessorCount
8
+
9
+ Stop = Object.new.freeze
10
+
11
+ class DeadWorker < StandardError
12
+ end
13
+
14
+ class Break < StandardError
15
+ attr_reader :value
16
+
17
+ def initialize(value = nil)
18
+ super()
19
+ @value = value
20
+ end
21
+ end
22
+
23
+ class Kill < Break
24
+ end
25
+
26
+ class UndumpableException < StandardError
27
+ attr_reader :backtrace
28
+
29
+ def initialize(original)
30
+ super "#{original.class}: #{original.message}"
31
+ @backtrace = original.backtrace
32
+ end
33
+ end
34
+
35
+ class ExceptionWrapper
36
+ attr_reader :exception
37
+
38
+ def initialize(exception)
39
+ # Remove the bindings stack added by the better_errors gem,
40
+ # because it cannot be marshalled
41
+ if exception.instance_variable_defined? :@__better_errors_bindings_stack
42
+ exception.send :remove_instance_variable, :@__better_errors_bindings_stack
43
+ end
44
+
45
+ @exception =
46
+ begin
47
+ Marshal.dump(exception) && exception
48
+ rescue StandardError
49
+ UndumpableException.new(exception)
50
+ end
51
+ end
52
+ end
53
+
54
+ class Worker
55
+ attr_reader :pid, :read, :write
56
+ attr_accessor :thread
57
+
58
+ def initialize(read, write, pid)
59
+ @read = read
60
+ @write = write
61
+ @pid = pid
62
+ end
63
+
64
+ def stop
65
+ close_pipes
66
+ wait # if it goes zombie, rather wait here to be able to debug
67
+ end
68
+
69
+ # might be passed to started_processes and simultaneously closed by another thread
70
+ # when running in isolation mode, so we have to check if it is closed before closing
71
+ def close_pipes
72
+ read.close unless read.closed?
73
+ write.close unless write.closed?
74
+ end
75
+
76
+ def work(data)
77
+ begin
78
+ Marshal.dump(data, write)
79
+ rescue Errno::EPIPE
80
+ raise DeadWorker
81
+ end
82
+
83
+ result = begin
84
+ Marshal.load(read)
85
+ rescue EOFError
86
+ raise DeadWorker
87
+ end
88
+ raise result.exception if result.is_a?(ExceptionWrapper)
89
+ result
90
+ end
91
+
92
+ private
93
+
94
+ def wait
95
+ Process.wait(pid)
96
+ rescue Interrupt
97
+ # process died
98
+ end
99
+ end
100
+
101
+ class JobFactory
102
+ def initialize(source, mutex)
103
+ @lambda = (source.respond_to?(:call) && source) || queue_wrapper(source)
104
+ @source = source.to_a unless @lambda # turn Range and other Enumerable-s into an Array
105
+ @mutex = mutex
106
+ @index = -1
107
+ @stopped = false
108
+ end
109
+
110
+ def next
111
+ if producer?
112
+ # - index and item stay in sync
113
+ # - do not call lambda after it has returned Stop
114
+ item, index = @mutex.synchronize do
115
+ return if @stopped
116
+ item = @lambda.call
117
+ @stopped = (item == Stop)
118
+ return if @stopped
119
+ [item, @index += 1]
120
+ end
121
+ else
122
+ index = @mutex.synchronize { @index += 1 }
123
+ return if index >= size
124
+ item = @source[index]
125
+ end
126
+ [item, index]
127
+ end
128
+
129
+ def size
130
+ if producer?
131
+ Float::INFINITY
132
+ else
133
+ @source.size
134
+ end
135
+ end
136
+
137
+ # generate item that is sent to workers
138
+ # just index is faster + less likely to blow up with unserializable errors
139
+ def pack(item, index)
140
+ producer? ? [item, index] : index
141
+ end
142
+
143
+ # unpack item that is sent to workers
144
+ def unpack(data)
145
+ producer? ? data : [@source[data], data]
146
+ end
147
+
148
+ private
149
+
150
+ def producer?
151
+ @lambda
152
+ end
153
+
154
+ def queue_wrapper(array)
155
+ array.respond_to?(:num_waiting) && array.respond_to?(:pop) && -> { array.pop(false) }
156
+ end
157
+ end
158
+
159
+ class UserInterruptHandler
160
+ INTERRUPT_SIGNAL = :SIGINT
161
+
162
+ class << self
163
+ # kill all these pids or threads if user presses Ctrl+c
164
+ def kill_on_ctrl_c(pids, options)
165
+ @to_be_killed ||= []
166
+ old_interrupt = nil
167
+ signal = options.fetch(:interrupt_signal, INTERRUPT_SIGNAL)
168
+
169
+ if @to_be_killed.empty?
170
+ old_interrupt = trap_interrupt(signal) do
171
+ warn 'Parallel execution interrupted, exiting ...'
172
+ @to_be_killed.flatten.each { |pid| kill(pid) }
173
+ end
174
+ end
175
+
176
+ @to_be_killed << pids
177
+
178
+ yield
179
+ ensure
180
+ @to_be_killed.pop # do not kill pids that could be used for new processes
181
+ restore_interrupt(old_interrupt, signal) if @to_be_killed.empty?
182
+ end
183
+
184
+ def kill(thing)
185
+ Process.kill(:KILL, thing)
186
+ rescue Errno::ESRCH
187
+ # some linux systems already automatically killed the children at this point
188
+ # so we just ignore them not being there
189
+ end
190
+
191
+ private
192
+
193
+ def trap_interrupt(signal)
194
+ old = Signal.trap signal, 'IGNORE'
195
+
196
+ Signal.trap signal do
197
+ yield
198
+ if !old || old == "DEFAULT"
199
+ raise Interrupt
200
+ else
201
+ old.call
202
+ end
203
+ end
204
+
205
+ old
206
+ end
207
+
208
+ def restore_interrupt(old, signal)
209
+ Signal.trap signal, old
210
+ end
211
+ end
212
+ end
213
+
214
+ class << self
215
+ def in_threads(options = { count: 2 })
216
+ threads = []
217
+ count, = extract_count_from_options(options)
218
+
219
+ Thread.handle_interrupt(Exception => :never) do
220
+ Thread.handle_interrupt(Exception => :immediate) do
221
+ count.times do |i|
222
+ threads << Thread.new { yield(i) }
223
+ end
224
+ threads.map(&:value)
225
+ end
226
+ ensure
227
+ threads.each(&:kill)
228
+ end
229
+ end
230
+
231
+ def in_processes(options = {}, &block)
232
+ count, options = extract_count_from_options(options)
233
+ count ||= processor_count
234
+ map(0...count, options.merge(in_processes: count), &block)
235
+ end
236
+
237
+ def each(array, options = {}, &block)
238
+ map(array, options.merge(preserve_results: false), &block)
239
+ end
240
+
241
+ def any?(*args, &block)
242
+ raise "You must provide a block when calling #any?" if block.nil?
243
+ !each(*args) { |*a| raise Kill if block.call(*a) }
244
+ end
245
+
246
+ def all?(*args, &block)
247
+ raise "You must provide a block when calling #all?" if block.nil?
248
+ !!each(*args) { |*a| raise Kill unless block.call(*a) }
249
+ end
250
+
251
+ def each_with_index(array, options = {}, &block)
252
+ each(array, options.merge(with_index: true), &block)
253
+ end
254
+
255
+ def map(source, options = {}, &block)
256
+ options = options.dup
257
+ options[:mutex] = Mutex.new
258
+
259
+ if options[:in_processes] && options[:in_threads]
260
+ raise ArgumentError, "Please specify only one of `in_processes` or `in_threads`."
261
+ elsif RUBY_PLATFORM =~ (/java/) && !(options[:in_processes])
262
+ method = :in_threads
263
+ size = options[method] || processor_count
264
+ elsif options[:in_threads]
265
+ method = :in_threads
266
+ size = options[method]
267
+ else
268
+ method = :in_processes
269
+ if Process.respond_to?(:fork)
270
+ size = options[method] || processor_count
271
+ else
272
+ warn "Process.fork is not supported by this Ruby"
273
+ size = 0
274
+ end
275
+ end
276
+
277
+ job_factory = JobFactory.new(source, options[:mutex])
278
+ size = [job_factory.size, size].min
279
+
280
+ options[:return_results] = (options[:preserve_results] != false || !!options[:finish])
281
+ add_progress_bar!(job_factory, options)
282
+
283
+ result =
284
+ if size == 0
285
+ work_direct(job_factory, options, &block)
286
+ elsif method == :in_threads
287
+ work_in_threads(job_factory, options.merge(count: size), &block)
288
+ else
289
+ work_in_processes(job_factory, options.merge(count: size), &block)
290
+ end
291
+
292
+ return result.value if result.is_a?(Break)
293
+ raise result if result.is_a?(Exception)
294
+ options[:return_results] ? result : source
295
+ end
296
+
297
+ def map_with_index(array, options = {}, &block)
298
+ map(array, options.merge(with_index: true), &block)
299
+ end
300
+
301
+ def flat_map(*args, &block)
302
+ map(*args, &block).flatten(1)
303
+ end
304
+
305
+ def worker_number
306
+ Thread.current[:parallel_worker_number]
307
+ end
308
+
309
+ # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed
310
+ def worker_number=(worker_num)
311
+ Thread.current[:parallel_worker_number] = worker_num
312
+ end
313
+
314
+ private
315
+
316
+ def add_progress_bar!(job_factory, options)
317
+ if progress_options = options[:progress]
318
+ raise "Progressbar can only be used with array like items" if job_factory.size == Float::INFINITY
319
+ require 'ruby-progressbar'
320
+
321
+ if progress_options == true
322
+ progress_options = { title: "Progress" }
323
+ elsif progress_options.respond_to? :to_str
324
+ progress_options = { title: progress_options.to_str }
325
+ end
326
+
327
+ progress_options = {
328
+ total: job_factory.size,
329
+ format: '%t |%E | %B | %a'
330
+ }.merge(progress_options)
331
+
332
+ progress = ProgressBar.create(progress_options)
333
+ old_finish = options[:finish]
334
+ options[:finish] = lambda do |item, i, result|
335
+ old_finish.call(item, i, result) if old_finish
336
+ progress.increment
337
+ end
338
+ end
339
+ end
340
+
341
+ def work_direct(job_factory, options, &block)
342
+ self.worker_number = 0
343
+ results = []
344
+ exception = nil
345
+ begin
346
+ while set = job_factory.next
347
+ item, index = set
348
+ results << with_instrumentation(item, index, options) do
349
+ call_with_index(item, index, options, &block)
350
+ end
351
+ end
352
+ rescue StandardError
353
+ exception = $!
354
+ end
355
+ exception || results
356
+ ensure
357
+ self.worker_number = nil
358
+ end
359
+
360
+ def work_in_threads(job_factory, options, &block)
361
+ raise "interrupt_signal is no longer supported for threads" if options[:interrupt_signal]
362
+ results = []
363
+ results_mutex = Mutex.new # arrays are not thread-safe on jRuby
364
+ exception = nil
365
+
366
+ in_threads(options) do |worker_num|
367
+ self.worker_number = worker_num
368
+ # as long as there are more jobs, work on one of them
369
+ while !exception && set = job_factory.next
370
+ begin
371
+ item, index = set
372
+ result = with_instrumentation item, index, options do
373
+ call_with_index(item, index, options, &block)
374
+ end
375
+ results_mutex.synchronize { results[index] = result }
376
+ rescue StandardError
377
+ exception = $!
378
+ end
379
+ end
380
+ end
381
+
382
+ exception || results
383
+ end
384
+
385
+ def work_in_processes(job_factory, options, &blk)
386
+ workers = create_workers(job_factory, options, &blk)
387
+ results = []
388
+ results_mutex = Mutex.new # arrays are not thread-safe
389
+ exception = nil
390
+
391
+ UserInterruptHandler.kill_on_ctrl_c(workers.map(&:pid), options) do
392
+ in_threads(options) do |i|
393
+ worker = workers[i]
394
+ worker.thread = Thread.current
395
+ worked = false
396
+
397
+ begin
398
+ loop do
399
+ break if exception
400
+ item, index = job_factory.next
401
+ break unless index
402
+
403
+ if options[:isolation]
404
+ worker = replace_worker(job_factory, workers, i, options, blk) if worked
405
+ worked = true
406
+ worker.thread = Thread.current
407
+ end
408
+
409
+ begin
410
+ result = with_instrumentation item, index, options do
411
+ worker.work(job_factory.pack(item, index))
412
+ end
413
+ results_mutex.synchronize { results[index] = result } # arrays are not threads safe on jRuby
414
+ rescue StandardError => e
415
+ exception = e
416
+ if exception.is_a?(Kill)
417
+ (workers - [worker]).each do |w|
418
+ w.thread&.kill
419
+ UserInterruptHandler.kill(w.pid)
420
+ end
421
+ end
422
+ end
423
+ end
424
+ ensure
425
+ worker.stop
426
+ end
427
+ end
428
+ end
429
+ exception || results
430
+ end
431
+
432
+ def replace_worker(job_factory, workers, index, options, blk)
433
+ options[:mutex].synchronize do
434
+ # old worker is no longer used ... stop it
435
+ worker = workers[index]
436
+ worker.stop
437
+
438
+ # create a new replacement worker
439
+ running = workers - [worker]
440
+ workers[index] = worker(job_factory, options.merge(started_workers: running, worker_number: index), &blk)
441
+ end
442
+ end
443
+
444
+ def create_workers(job_factory, options, &block)
445
+ workers = []
446
+ Array.new(options[:count]).each_with_index do |_, i|
447
+ workers << worker(job_factory, options.merge(started_workers: workers, worker_number: i), &block)
448
+ end
449
+ workers
450
+ end
451
+
452
+ def worker(job_factory, options, &block)
453
+ child_read, parent_write = IO.pipe
454
+ parent_read, child_write = IO.pipe
455
+
456
+ pid = Process.fork do
457
+ self.worker_number = options[:worker_number]
458
+
459
+ begin
460
+ options.delete(:started_workers).each(&:close_pipes)
461
+
462
+ parent_write.close
463
+ parent_read.close
464
+
465
+ process_incoming_jobs(child_read, child_write, job_factory, options, &block)
466
+ ensure
467
+ child_read.close
468
+ child_write.close
469
+ end
470
+ end
471
+
472
+ child_read.close
473
+ child_write.close
474
+
475
+ Worker.new(parent_read, parent_write, pid)
476
+ end
477
+
478
+ def process_incoming_jobs(read, write, job_factory, options, &block)
479
+ until read.eof?
480
+ data = Marshal.load(read)
481
+ item, index = job_factory.unpack(data)
482
+
483
+ result =
484
+ begin
485
+ call_with_index(item, index, options, &block)
486
+ # https://github.com/rspec/rspec-support/blob/673133cdd13b17077b3d88ece8d7380821f8d7dc/lib/rspec/support.rb#L132-L140
487
+ rescue NoMemoryError, SignalException, Interrupt, SystemExit # rubocop:disable Lint/ShadowedException
488
+ raise $!
489
+ rescue Exception # # rubocop:disable Lint/RescueException
490
+ ExceptionWrapper.new($!)
491
+ end
492
+
493
+ begin
494
+ Marshal.dump(result, write)
495
+ rescue Errno::EPIPE
496
+ return # parent thread already dead
497
+ end
498
+ end
499
+ end
500
+
501
+ # options is either a Integer or a Hash with :count
502
+ def extract_count_from_options(options)
503
+ if options.is_a?(Hash)
504
+ count = options[:count]
505
+ else
506
+ count = options
507
+ options = {}
508
+ end
509
+ [count, options]
510
+ end
511
+
512
+ def call_with_index(item, index, options, &block)
513
+ args = [item]
514
+ args << index if options[:with_index]
515
+ results = block.call(*args)
516
+ if options[:return_results]
517
+ results
518
+ else
519
+ nil # avoid GC overhead of passing large results around
520
+ end
521
+ end
522
+
523
+ def with_instrumentation(item, index, options)
524
+ on_start = options[:start]
525
+ on_finish = options[:finish]
526
+ options[:mutex].synchronize { on_start.call(item, index) } if on_start
527
+ result = yield
528
+ options[:mutex].synchronize { on_finish.call(item, index, result) } if on_finish
529
+ result unless options[:preserve_results] == false
530
+ end
531
+ end
532
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.