brakeman 4.4.0 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of brakeman might be problematic. Click here for more details.

Files changed (362) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +17 -0
  3. data/bundle/load.rb +7 -8
  4. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/History.rdoc +8 -0
  5. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/Manifest.txt +0 -0
  6. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/README.rdoc +0 -0
  7. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/lib/ruby2ruby.rb +34 -36
  8. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/History.rdoc +47 -0
  9. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/Manifest.txt +5 -4
  10. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/README.rdoc +0 -0
  11. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/compare/normalize.rb +29 -2
  12. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/debugging.md +18 -0
  13. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_extensions.rb +0 -7
  14. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_stringscanner.rb +0 -0
  15. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby20_parser.rb +6874 -0
  16. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby20_parser.y +284 -201
  17. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby21_parser.rb +6952 -0
  18. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby21_parser.y +281 -197
  19. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby22_parser.rb +6983 -0
  20. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib/ruby_parser.yy → ruby_parser-3.13.0/lib/ruby22_parser.y} +280 -306
  21. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby23_parser.rb +6982 -0
  22. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby23_parser.y +282 -203
  23. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby24_parser.rb +6982 -0
  24. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby24_parser.y +282 -203
  25. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby25_parser.rb +6981 -0
  26. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby25_parser.y +282 -203
  27. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.rb +6999 -0
  28. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.y +2469 -0
  29. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rb +116 -118
  30. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex +10 -8
  31. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex.rb +8 -8
  32. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_parser.rb +5 -7
  33. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser.yy +2571 -0
  34. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser_extras.rb +1360 -0
  35. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/munge.rb +216 -0
  36. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/ripper.rb +23 -0
  37. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +6 -0
  38. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +19 -0
  39. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +54 -0
  40. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +5 -0
  41. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.rb +7 -6
  42. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.y +5 -4
  43. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.rb +7 -6
  44. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.y +5 -4
  45. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +1412 -0
  46. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +179 -0
  47. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +323 -0
  48. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +30 -0
  49. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby_parser_extras.rb +43 -33
  50. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/CHANGES.md +5 -0
  51. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/Gemfile +0 -0
  52. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/LICENSE.txt +0 -0
  53. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/README.md +0 -0
  54. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/bundle_install_all_ruby_versions.sh +0 -0
  55. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml.rb +0 -0
  56. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/deep.rb +0 -0
  57. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/libyaml_checker.rb +0 -0
  58. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/load.rb +0 -0
  59. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/date.rb +2 -0
  60. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/hexadecimal.rb +0 -0
  61. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/sexagesimal.rb +0 -0
  62. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_handler.rb +0 -0
  63. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_resolver.rb +0 -0
  64. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/resolver.rb +0 -0
  65. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
  66. data/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +39 -0
  67. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_hack.rb +0 -0
  68. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
  69. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_resolver.rb +0 -0
  70. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform.rb +0 -0
  71. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_boolean.rb +0 -0
  72. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_date.rb +0 -0
  73. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_float.rb +0 -0
  74. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_integer.rb +0 -0
  75. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_nil.rb +0 -0
  76. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_symbol.rb +0 -0
  77. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/transformation_map.rb +0 -0
  78. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/version.rb +1 -1
  79. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/run_specs_all_ruby_versions.sh +0 -0
  80. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/safe_yaml.gemspec +0 -0
  81. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/History.rdoc +8 -0
  82. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/Manifest.txt +0 -0
  83. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/README.rdoc +0 -0
  84. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/composite_sexp_processor.rb +0 -0
  85. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/pt_testcase.rb +2 -2
  86. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp.rb +4 -4
  87. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp_processor.rb +1 -1
  88. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/strict_sexp.rb +3 -3
  89. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/unique.rb +0 -0
  90. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/CHANGES +6 -0
  91. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/EXPRESSIONS.md +1 -1
  92. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/Gemfile +0 -0
  93. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/LICENSE +0 -0
  94. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/README.md +1 -1
  95. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple.rb +0 -0
  96. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/engine.rb +0 -0
  97. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/engine.rb +0 -0
  98. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/parser.rb +0 -0
  99. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/template.rb +0 -0
  100. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/trimming.rb +0 -0
  101. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/exceptions.rb +0 -0
  102. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filter.rb +0 -0
  103. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/code_merger.rb +0 -0
  104. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/control_flow.rb +0 -0
  105. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/dynamic_inliner.rb +0 -0
  106. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/encoding.rb +0 -0
  107. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/eraser.rb +0 -0
  108. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/escapable.rb +0 -0
  109. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/multi_flattener.rb +0 -0
  110. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/remove_bom.rb +0 -0
  111. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_analyzer.rb +0 -0
  112. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_merger.rb +0 -0
  113. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/string_splitter.rb +0 -0
  114. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/validator.rb +0 -0
  115. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generator.rb +0 -0
  116. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array.rb +0 -0
  117. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array_buffer.rb +0 -0
  118. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/erb.rb +0 -0
  119. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/rails_output_buffer.rb +0 -0
  120. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/string_buffer.rb +0 -0
  121. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/grammar.rb +0 -0
  122. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_merger.rb +0 -0
  123. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_remover.rb +0 -0
  124. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_sorter.rb +0 -0
  125. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/dispatcher.rb +0 -0
  126. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/fast.rb +0 -0
  127. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/filter.rb +0 -0
  128. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/pretty.rb +0 -0
  129. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/safe.rb +0 -0
  130. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/map.rb +0 -0
  131. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/dispatcher.rb +2 -1
  132. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/engine_dsl.rb +0 -0
  133. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/grammar_dsl.rb +0 -0
  134. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/options.rb +0 -0
  135. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/template.rb +0 -0
  136. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/parser.rb +0 -0
  137. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/static_analyzer.rb +0 -0
  138. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates.rb +0 -0
  139. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/rails.rb +2 -2
  140. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/tilt.rb +0 -0
  141. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/utils.rb +0 -0
  142. data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +3 -0
  143. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/temple.gemspec +0 -0
  144. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/CHANGELOG.md +4 -0
  145. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/MIT-LICENSE.txt +1 -1
  146. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/README.md +10 -10
  147. data/bundle/ruby/2.5.0/gems/unicode-display_width-1.5.0/data/display_width.marshal.gz +0 -0
  148. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width.rb +0 -0
  149. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/constants.rb +2 -2
  150. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/index.rb +0 -0
  151. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
  152. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/string_ext.rb +0 -0
  153. data/lib/brakeman/checks/base_check.rb +16 -0
  154. data/lib/brakeman/checks/check_content_tag.rb +12 -0
  155. data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -6
  156. data/lib/brakeman/checks/check_evaluation.rb +0 -1
  157. data/lib/brakeman/checks/check_execute.rb +18 -0
  158. data/lib/brakeman/checks/check_send.rb +0 -1
  159. data/lib/brakeman/checks/check_session_manipulation.rb +0 -1
  160. data/lib/brakeman/checks/check_sql.rb +12 -3
  161. data/lib/brakeman/file_parser.rb +8 -4
  162. data/lib/brakeman/parsers/haml_embedded.rb +44 -0
  163. data/lib/brakeman/parsers/slim_embedded.rb +44 -0
  164. data/lib/brakeman/parsers/template_parser.rb +2 -4
  165. data/lib/brakeman/processors/alias_processor.rb +23 -1
  166. data/lib/brakeman/processors/lib/call_conversion_helper.rb +4 -0
  167. data/lib/brakeman/processors/slim_template_processor.rb +16 -0
  168. data/lib/brakeman/processors/template_alias_processor.rb +2 -2
  169. data/lib/brakeman/scanner.rb +11 -10
  170. data/lib/brakeman/tracker.rb +5 -1
  171. data/lib/brakeman/tracker/config.rb +32 -7
  172. data/lib/brakeman/util.rb +17 -0
  173. data/lib/brakeman/version.rb +1 -1
  174. metadata +157 -320
  175. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby20_parser.rb +0 -6687
  176. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby21_parser.rb +0 -6767
  177. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.rb +0 -6803
  178. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.y +0 -2376
  179. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby23_parser.rb +0 -6818
  180. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby24_parser.rb +0 -6818
  181. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby25_parser.rb +0 -6818
  182. data/bundle/ruby/2.5.0/gems/sass-3.4.25/CODE_OF_CONDUCT.md +0 -10
  183. data/bundle/ruby/2.5.0/gems/sass-3.4.25/CONTRIBUTING.md +0 -148
  184. data/bundle/ruby/2.5.0/gems/sass-3.4.25/MIT-LICENSE +0 -20
  185. data/bundle/ruby/2.5.0/gems/sass-3.4.25/README.md +0 -227
  186. data/bundle/ruby/2.5.0/gems/sass-3.4.25/REVISION +0 -1
  187. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION +0 -1
  188. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_DATE +0 -1
  189. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_NAME +0 -1
  190. data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/sass-spec-ref.sh +0 -32
  191. data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/update_watch.rb +0 -13
  192. data/bundle/ruby/2.5.0/gems/sass-3.4.25/init.rb +0 -18
  193. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass.rb +0 -109
  194. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores.rb +0 -15
  195. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/base.rb +0 -88
  196. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/chain.rb +0 -34
  197. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/filesystem.rb +0 -60
  198. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/memory.rb +0 -46
  199. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/null.rb +0 -25
  200. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/callbacks.rb +0 -67
  201. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/css.rb +0 -408
  202. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/deprecation.rb +0 -55
  203. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/engine.rb +0 -1226
  204. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/environment.rb +0 -215
  205. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/error.rb +0 -198
  206. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec.rb +0 -9
  207. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/base.rb +0 -199
  208. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_convert.rb +0 -283
  209. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb +0 -440
  210. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/features.rb +0 -47
  211. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers.rb +0 -23
  212. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/base.rb +0 -182
  213. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/deprecated_path.rb +0 -51
  214. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/filesystem.rb +0 -219
  215. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger.rb +0 -17
  216. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/base.rb +0 -36
  217. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/delayed.rb +0 -50
  218. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/log_level.rb +0 -45
  219. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/media.rb +0 -210
  220. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin.rb +0 -134
  221. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb +0 -582
  222. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/configuration.rb +0 -134
  223. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/generic.rb +0 -15
  224. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/merb.rb +0 -48
  225. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rack.rb +0 -60
  226. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rails.rb +0 -47
  227. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/staleness_checker.rb +0 -199
  228. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/railtie.rb +0 -10
  229. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/repl.rb +0 -57
  230. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/root.rb +0 -7
  231. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script.rb +0 -66
  232. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_lexer.rb +0 -33
  233. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_parser.rb +0 -33
  234. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_variable_warning.rb +0 -52
  235. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/functions.rb +0 -2693
  236. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/lexer.rb +0 -464
  237. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/parser.rb +0 -832
  238. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree.rb +0 -16
  239. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/funcall.rb +0 -313
  240. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/interpolation.rb +0 -223
  241. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/list_literal.rb +0 -104
  242. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/literal.rb +0 -49
  243. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/map_literal.rb +0 -64
  244. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/node.rb +0 -127
  245. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/operation.rb +0 -156
  246. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/selector.rb +0 -26
  247. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/string_interpolation.rb +0 -125
  248. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/unary_operation.rb +0 -69
  249. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/variable.rb +0 -57
  250. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value.rb +0 -11
  251. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/arg_list.rb +0 -36
  252. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/base.rb +0 -241
  253. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/bool.rb +0 -35
  254. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/color.rb +0 -698
  255. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/helpers.rb +0 -272
  256. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/list.rb +0 -113
  257. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/map.rb +0 -70
  258. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/null.rb +0 -44
  259. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/number.rb +0 -563
  260. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/string.rb +0 -138
  261. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss.rb +0 -14
  262. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/css_parser.rb +0 -56
  263. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/parser.rb +0 -1254
  264. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/rx.rb +0 -140
  265. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/static_parser.rb +0 -373
  266. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector.rb +0 -323
  267. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/abstract_sequence.rb +0 -111
  268. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/comma_sequence.rb +0 -191
  269. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/pseudo.rb +0 -266
  270. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb +0 -636
  271. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple.rb +0 -117
  272. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple_sequence.rb +0 -344
  273. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/shared.rb +0 -76
  274. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/map.rb +0 -213
  275. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/position.rb +0 -39
  276. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/range.rb +0 -41
  277. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/stack.rb +0 -120
  278. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/supports.rb +0 -225
  279. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/at_root_node.rb +0 -83
  280. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/charset_node.rb +0 -22
  281. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/comment_node.rb +0 -82
  282. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/content_node.rb +0 -9
  283. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/css_import_node.rb +0 -68
  284. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/debug_node.rb +0 -18
  285. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/directive_node.rb +0 -59
  286. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/each_node.rb +0 -24
  287. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/error_node.rb +0 -18
  288. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/extend_node.rb +0 -43
  289. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/for_node.rb +0 -36
  290. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/function_node.rb +0 -44
  291. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/if_node.rb +0 -52
  292. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/import_node.rb +0 -75
  293. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/keyframe_rule_node.rb +0 -15
  294. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/media_node.rb +0 -48
  295. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_def_node.rb +0 -38
  296. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_node.rb +0 -52
  297. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/node.rb +0 -240
  298. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/prop_node.rb +0 -170
  299. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/return_node.rb +0 -19
  300. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/root_node.rb +0 -44
  301. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/rule_node.rb +0 -155
  302. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/supports_node.rb +0 -38
  303. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/trace_node.rb +0 -33
  304. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/variable_node.rb +0 -36
  305. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb +0 -72
  306. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/check_nesting.rb +0 -173
  307. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/convert.rb +0 -351
  308. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/cssize.rb +0 -373
  309. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/deep_copy.rb +0 -107
  310. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/extend.rb +0 -70
  311. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb +0 -564
  312. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/set_options.rb +0 -139
  313. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/to_css.rb +0 -409
  314. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/warn_node.rb +0 -18
  315. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/while_node.rb +0 -18
  316. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util.rb +0 -1375
  317. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/cross_platform_random.rb +0 -19
  318. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/multibyte_string_scanner.rb +0 -155
  319. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/normalized_map.rb +0 -129
  320. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/ordered_hash.rb +0 -192
  321. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/subset_map.rb +0 -109
  322. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/test.rb +0 -9
  323. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/version.rb +0 -124
  324. data/bundle/ruby/2.5.0/gems/sass-3.4.25/rails/init.rb +0 -1
  325. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CHANGELOG.md +0 -1
  326. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CONTRIBUTING.md +0 -38
  327. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Gemfile +0 -20
  328. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Guardfile +0 -8
  329. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/LICENSE +0 -20
  330. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/README.md +0 -349
  331. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Rakefile +0 -5
  332. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Vagrantfile +0 -96
  333. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb +0 -54
  334. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapter.rb +0 -327
  335. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
  336. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
  337. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/linux.rb +0 -81
  338. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/polling.rb +0 -58
  339. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/windows.rb +0 -91
  340. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/directory_record.rb +0 -406
  341. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/listener.rb +0 -323
  342. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/turnstile.rb +0 -32
  343. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/version.rb +0 -3
  344. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/listen.gemspec +0 -28
  345. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapter_spec.rb +0 -149
  346. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
  347. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
  348. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
  349. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
  350. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
  351. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
  352. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/listener_spec.rb +0 -258
  353. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
  354. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen_spec.rb +0 -67
  355. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/spec_helper.rb +0 -25
  356. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/adapter_helper.rb +0 -666
  357. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/directory_record_helper.rb +0 -57
  358. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/fixtures_helper.rb +0 -29
  359. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/listeners_helper.rb +0 -179
  360. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/platform_helper.rb +0 -15
  361. data/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/version.rb +0 -3
  362. data/bundle/ruby/2.5.0/gems/unicode-display_width-1.4.1/data/display_width.marshal.gz +0 -0
@@ -1,323 +0,0 @@
1
- require 'sass/selector/simple'
2
- require 'sass/selector/abstract_sequence'
3
- require 'sass/selector/comma_sequence'
4
- require 'sass/selector/pseudo'
5
- require 'sass/selector/sequence'
6
- require 'sass/selector/simple_sequence'
7
-
8
- module Sass
9
- # A namespace for nodes in the parse tree for selectors.
10
- #
11
- # {CommaSequence} is the toplevel selector,
12
- # representing a comma-separated sequence of {Sequence}s,
13
- # such as `foo bar, baz bang`.
14
- # {Sequence} is the next level,
15
- # representing {SimpleSequence}s separated by combinators (e.g. descendant or child),
16
- # such as `foo bar` or `foo > bar baz`.
17
- # {SimpleSequence} is a sequence of selectors that all apply to a single element,
18
- # such as `foo.bar[attr=val]`.
19
- # Finally, {Simple} is the superclass of the simplest selectors,
20
- # such as `.foo` or `#bar`.
21
- module Selector
22
- # The base used for calculating selector specificity. The spec says this
23
- # should be "sufficiently high"; it's extremely unlikely that any single
24
- # selector sequence will contain 1,000 simple selectors.
25
- SPECIFICITY_BASE = 1_000
26
-
27
- # A parent-referencing selector (`&` in Sass).
28
- # The function of this is to be replaced by the parent selector
29
- # in the nested hierarchy.
30
- class Parent < Simple
31
- # The identifier following the `&`. `nil` indicates no suffix.
32
- #
33
- # @return [String, nil]
34
- attr_reader :suffix
35
-
36
- # @param name [String, nil] See \{#suffix}
37
- def initialize(suffix = nil)
38
- @suffix = suffix
39
- end
40
-
41
- # @see Selector#to_s
42
- def to_s(opts = {})
43
- "&" + (@suffix || '')
44
- end
45
-
46
- # Always raises an exception.
47
- #
48
- # @raise [Sass::SyntaxError] Parent selectors should be resolved before unification
49
- # @see Selector#unify
50
- def unify(sels)
51
- raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.")
52
- end
53
- end
54
-
55
- # A class selector (e.g. `.foo`).
56
- class Class < Simple
57
- # The class name.
58
- #
59
- # @return [String]
60
- attr_reader :name
61
-
62
- # @param name [String] The class name
63
- def initialize(name)
64
- @name = name
65
- end
66
-
67
- # @see Selector#to_s
68
- def to_s(opts = {})
69
- "." + @name
70
- end
71
-
72
- # @see AbstractSequence#specificity
73
- def specificity
74
- SPECIFICITY_BASE
75
- end
76
- end
77
-
78
- # An id selector (e.g. `#foo`).
79
- class Id < Simple
80
- # The id name.
81
- #
82
- # @return [String]
83
- attr_reader :name
84
-
85
- # @param name [String] The id name
86
- def initialize(name)
87
- @name = name
88
- end
89
-
90
- # @see Selector#to_s
91
- def to_s(opts = {})
92
- "#" + @name
93
- end
94
-
95
- # Returns `nil` if `sels` contains an {Id} selector
96
- # with a different name than this one.
97
- #
98
- # @see Selector#unify
99
- def unify(sels)
100
- return if sels.any? {|sel2| sel2.is_a?(Id) && name != sel2.name}
101
- super
102
- end
103
-
104
- # @see AbstractSequence#specificity
105
- def specificity
106
- SPECIFICITY_BASE**2
107
- end
108
- end
109
-
110
- # A placeholder selector (e.g. `%foo`).
111
- # This exists to be replaced via `@extend`.
112
- # Rulesets using this selector will not be printed, but can be extended.
113
- # Otherwise, this acts just like a class selector.
114
- class Placeholder < Simple
115
- # The placeholder name.
116
- #
117
- # @return [String]
118
- attr_reader :name
119
-
120
- # @param name [String] The placeholder name
121
- def initialize(name)
122
- @name = name
123
- end
124
-
125
- # @see Selector#to_s
126
- def to_s(opts = {})
127
- "%" + @name
128
- end
129
-
130
- # @see AbstractSequence#specificity
131
- def specificity
132
- SPECIFICITY_BASE
133
- end
134
- end
135
-
136
- # A universal selector (`*` in CSS).
137
- class Universal < Simple
138
- # The selector namespace. `nil` means the default namespace, `""` means no
139
- # namespace, `"*"` means any namespace.
140
- #
141
- # @return [String, nil]
142
- attr_reader :namespace
143
-
144
- # @param namespace [String, nil] See \{#namespace}
145
- def initialize(namespace)
146
- @namespace = namespace
147
- end
148
-
149
- # @see Selector#to_s
150
- def to_s(opts = {})
151
- @namespace ? "#{@namespace}|*" : "*"
152
- end
153
-
154
- # Unification of a universal selector is somewhat complicated,
155
- # especially when a namespace is specified.
156
- # If there is no namespace specified
157
- # or any namespace is specified (namespace `"*"`),
158
- # then `sel` is returned without change
159
- # (unless it's empty, in which case `"*"` is required).
160
- #
161
- # If a namespace is specified
162
- # but `sel` does not specify a namespace,
163
- # then the given namespace is applied to `sel`,
164
- # either by adding this {Universal} selector
165
- # or applying this namespace to an existing {Element} selector.
166
- #
167
- # If both this selector *and* `sel` specify namespaces,
168
- # those namespaces are unified via {Simple#unify_namespaces}
169
- # and the unified namespace is used, if possible.
170
- #
171
- # @todo There are lots of cases that this documentation specifies;
172
- # make sure we thoroughly test **all of them**.
173
- # @todo Keep track of whether a default namespace has been declared
174
- # and handle namespace-unspecified selectors accordingly.
175
- # @todo If any branch of a CommaSequence ends up being just `"*"`,
176
- # then all other branches should be eliminated
177
- #
178
- # @see Selector#unify
179
- def unify(sels)
180
- name =
181
- case sels.first
182
- when Universal; :universal
183
- when Element; sels.first.name
184
- else
185
- return [self] + sels unless namespace.nil? || namespace == '*'
186
- return sels unless sels.empty?
187
- return [self]
188
- end
189
-
190
- ns, accept = unify_namespaces(namespace, sels.first.namespace)
191
- return unless accept
192
- [name == :universal ? Universal.new(ns) : Element.new(name, ns)] + sels[1..-1]
193
- end
194
-
195
- # @see AbstractSequence#specificity
196
- def specificity
197
- 0
198
- end
199
- end
200
-
201
- # An element selector (e.g. `h1`).
202
- class Element < Simple
203
- # The element name.
204
- #
205
- # @return [String]
206
- attr_reader :name
207
-
208
- # The selector namespace. `nil` means the default namespace, `""` means no
209
- # namespace, `"*"` means any namespace.
210
- #
211
- # @return [String, nil]
212
- attr_reader :namespace
213
-
214
- # @param name [String] The element name
215
- # @param namespace [String, nil] See \{#namespace}
216
- def initialize(name, namespace)
217
- @name = name
218
- @namespace = namespace
219
- end
220
-
221
- # @see Selector#to_s
222
- def to_s(opts = {})
223
- @namespace ? "#{@namespace}|#{@name}" : @name
224
- end
225
-
226
- # Unification of an element selector is somewhat complicated,
227
- # especially when a namespace is specified.
228
- # First, if `sel` contains another {Element} with a different \{#name},
229
- # then the selectors can't be unified and `nil` is returned.
230
- #
231
- # Otherwise, if `sel` doesn't specify a namespace,
232
- # or it specifies any namespace (via `"*"`),
233
- # then it's returned with this element selector
234
- # (e.g. `.foo` becomes `a.foo` or `svg|a.foo`).
235
- # Similarly, if this selector doesn't specify a namespace,
236
- # the namespace from `sel` is used.
237
- #
238
- # If both this selector *and* `sel` specify namespaces,
239
- # those namespaces are unified via {Simple#unify_namespaces}
240
- # and the unified namespace is used, if possible.
241
- #
242
- # @todo There are lots of cases that this documentation specifies;
243
- # make sure we thoroughly test **all of them**.
244
- # @todo Keep track of whether a default namespace has been declared
245
- # and handle namespace-unspecified selectors accordingly.
246
- #
247
- # @see Selector#unify
248
- def unify(sels)
249
- case sels.first
250
- when Universal;
251
- when Element; return unless name == sels.first.name
252
- else return [self] + sels
253
- end
254
-
255
- ns, accept = unify_namespaces(namespace, sels.first.namespace)
256
- return unless accept
257
- [Element.new(name, ns)] + sels[1..-1]
258
- end
259
-
260
- # @see AbstractSequence#specificity
261
- def specificity
262
- 1
263
- end
264
- end
265
-
266
- # An attribute selector (e.g. `[href^="http://"]`).
267
- class Attribute < Simple
268
- # The attribute name.
269
- #
270
- # @return [Array<String, Sass::Script::Tree::Node>]
271
- attr_reader :name
272
-
273
- # The attribute namespace. `nil` means the default namespace, `""` means
274
- # no namespace, `"*"` means any namespace.
275
- #
276
- # @return [String, nil]
277
- attr_reader :namespace
278
-
279
- # The matching operator, e.g. `"="` or `"^="`.
280
- #
281
- # @return [String]
282
- attr_reader :operator
283
-
284
- # The right-hand side of the operator.
285
- #
286
- # @return [String]
287
- attr_reader :value
288
-
289
- # Flags for the attribute selector (e.g. `i`).
290
- #
291
- # @return [String]
292
- attr_reader :flags
293
-
294
- # @param name [String] The attribute name
295
- # @param namespace [String, nil] See \{#namespace}
296
- # @param operator [String] The matching operator, e.g. `"="` or `"^="`
297
- # @param value [String] See \{#value}
298
- # @param flags [String] See \{#flags}
299
- def initialize(name, namespace, operator, value, flags)
300
- @name = name
301
- @namespace = namespace
302
- @operator = operator
303
- @value = value
304
- @flags = flags
305
- end
306
-
307
- # @see Selector#to_s
308
- def to_s(opts = {})
309
- res = "["
310
- res << @namespace << "|" if @namespace
311
- res << @name
312
- res << @operator << @value if @value
313
- res << " " << @flags if @flags
314
- res << "]"
315
- end
316
-
317
- # @see AbstractSequence#specificity
318
- def specificity
319
- SPECIFICITY_BASE
320
- end
321
- end
322
- end
323
- end
@@ -1,111 +0,0 @@
1
- module Sass
2
- module Selector
3
- # The abstract parent class of the various selector sequence classes.
4
- #
5
- # All subclasses should implement a `members` method that returns an array
6
- # of object that respond to `#line=` and `#filename=`, as well as a `to_s`
7
- # method that returns the string representation of the selector.
8
- class AbstractSequence
9
- # The line of the Sass template on which this selector was declared.
10
- #
11
- # @return [Integer]
12
- attr_reader :line
13
-
14
- # The name of the file in which this selector was declared.
15
- #
16
- # @return [String, nil]
17
- attr_reader :filename
18
-
19
- # Sets the line of the Sass template on which this selector was declared.
20
- # This also sets the line for all child selectors.
21
- #
22
- # @param line [Integer]
23
- # @return [Integer]
24
- def line=(line)
25
- members.each {|m| m.line = line}
26
- @line = line
27
- end
28
-
29
- # Sets the name of the file in which this selector was declared,
30
- # or `nil` if it was not declared in a file (e.g. on stdin).
31
- # This also sets the filename for all child selectors.
32
- #
33
- # @param filename [String, nil]
34
- # @return [String, nil]
35
- def filename=(filename)
36
- members.each {|m| m.filename = filename}
37
- @filename = filename
38
- end
39
-
40
- # Returns a hash code for this sequence.
41
- #
42
- # Subclasses should define `#_hash` rather than overriding this method,
43
- # which automatically handles memoizing the result.
44
- #
45
- # @return [Integer]
46
- def hash
47
- @_hash ||= _hash
48
- end
49
-
50
- # Checks equality between this and another object.
51
- #
52
- # Subclasses should define `#_eql?` rather than overriding this method,
53
- # which handles checking class equality and hash equality.
54
- #
55
- # @param other [Object] The object to test equality against
56
- # @return [Boolean] Whether or not this is equal to `other`
57
- def eql?(other)
58
- other.class == self.class && other.hash == hash && _eql?(other)
59
- end
60
- alias_method :==, :eql?
61
-
62
- # Whether or not this selector sequence contains a placeholder selector.
63
- # Checks recursively.
64
- def has_placeholder?
65
- @has_placeholder ||= members.any? do |m|
66
- next m.has_placeholder? if m.is_a?(AbstractSequence)
67
- next m.selector && m.selector.has_placeholder? if m.is_a?(Pseudo)
68
- m.is_a?(Placeholder)
69
- end
70
- end
71
-
72
- # Returns the selector string.
73
- #
74
- # @param opts [Hash] rendering options.
75
- # @option opts [Symbol] :style The css rendering style.
76
- # @return [String]
77
- def to_s(opts = {})
78
- Sass::Util.abstract(self)
79
- end
80
-
81
- # Returns the specificity of the selector.
82
- #
83
- # The base is given by {Sass::Selector::SPECIFICITY_BASE}. This can be a
84
- # number or a range representing possible specificities.
85
- #
86
- # @return [Integer, Range]
87
- def specificity
88
- _specificity(members)
89
- end
90
-
91
- protected
92
-
93
- def _specificity(arr)
94
- min = 0
95
- max = 0
96
- arr.each do |m|
97
- next if m.is_a?(String)
98
- spec = m.specificity
99
- if spec.is_a?(Range)
100
- min += spec.begin
101
- max += spec.end
102
- else
103
- min += spec
104
- max += spec
105
- end
106
- end
107
- min == max ? min : (min..max)
108
- end
109
- end
110
- end
111
- end
@@ -1,191 +0,0 @@
1
- module Sass
2
- module Selector
3
- # A comma-separated sequence of selectors.
4
- class CommaSequence < AbstractSequence
5
- @@compound_extend_deprecation = Sass::Deprecation.new
6
-
7
- # The comma-separated selector sequences
8
- # represented by this class.
9
- #
10
- # @return [Array<Sequence>]
11
- attr_reader :members
12
-
13
- # @param seqs [Array<Sequence>] See \{#members}
14
- def initialize(seqs)
15
- @members = seqs
16
- end
17
-
18
- # Resolves the {Parent} selectors within this selector
19
- # by replacing them with the given parent selector,
20
- # handling commas appropriately.
21
- #
22
- # @param super_cseq [CommaSequence] The parent selector
23
- # @param implicit_parent [Boolean] Whether the the parent
24
- # selector should automatically be prepended to the resolved
25
- # selector if it contains no parent refs.
26
- # @return [CommaSequence] This selector, with parent references resolved
27
- # @raise [Sass::SyntaxError] If a parent selector is invalid
28
- def resolve_parent_refs(super_cseq, implicit_parent = true)
29
- if super_cseq.nil?
30
- if contains_parent_ref?
31
- raise Sass::SyntaxError.new(
32
- "Base-level rules cannot contain the parent-selector-referencing character '&'.")
33
- end
34
- return self
35
- end
36
-
37
- CommaSequence.new(Sass::Util.flatten_vertically(@members.map do |seq|
38
- seq.resolve_parent_refs(super_cseq, implicit_parent).members
39
- end))
40
- end
41
-
42
- # Returns whether there's a {Parent} selector anywhere in this sequence.
43
- #
44
- # @return [Boolean]
45
- def contains_parent_ref?
46
- @members.any? {|sel| sel.contains_parent_ref?}
47
- end
48
-
49
- # Non-destrucively extends this selector with the extensions specified in a hash
50
- # (which should come from {Sass::Tree::Visitors::Cssize}).
51
- #
52
- # @todo Link this to the reference documentation on `@extend`
53
- # when such a thing exists.
54
- #
55
- # @param extends [Sass::Util::SubsetMap{Selector::Simple =>
56
- # Sass::Tree::Visitors::Cssize::Extend}]
57
- # The extensions to perform on this selector
58
- # @param parent_directives [Array<Sass::Tree::DirectiveNode>]
59
- # The directives containing this selector.
60
- # @param replace [Boolean]
61
- # Whether to replace the original selector entirely or include
62
- # it in the result.
63
- # @param seen [Set<Array<Selector::Simple>>]
64
- # The set of simple sequences that are currently being replaced.
65
- # @param original [Boolean]
66
- # Whether this is the original selector being extended, as opposed to
67
- # the result of a previous extension that's being re-extended.
68
- # @return [CommaSequence] A copy of this selector,
69
- # with extensions made according to `extends`
70
- def do_extend(extends, parent_directives = [], replace = false, seen = Set.new,
71
- original = true)
72
- CommaSequence.new(members.map do |seq|
73
- seq.do_extend(extends, parent_directives, replace, seen, original)
74
- end.flatten)
75
- end
76
-
77
- # Returns whether or not this selector matches all elements
78
- # that the given selector matches (as well as possibly more).
79
- #
80
- # @example
81
- # (.foo).superselector?(.foo.bar) #=> true
82
- # (.foo).superselector?(.bar) #=> false
83
- # @param cseq [CommaSequence]
84
- # @return [Boolean]
85
- def superselector?(cseq)
86
- cseq.members.all? {|seq1| members.any? {|seq2| seq2.superselector?(seq1)}}
87
- end
88
-
89
- # Populates a subset map that can then be used to extend
90
- # selectors. This registers an extension with this selector as
91
- # the extender and `extendee` as the extendee.
92
- #
93
- # @param extends [Sass::Util::SubsetMap{Selector::Simple =>
94
- # Sass::Tree::Visitors::Cssize::Extend}]
95
- # The subset map representing the extensions to perform.
96
- # @param extendee [CommaSequence] The selector being extended.
97
- # @param extend_node [Sass::Tree::ExtendNode]
98
- # The node that caused this extension.
99
- # @param parent_directives [Array<Sass::Tree::DirectiveNode>]
100
- # The parent directives containing `extend_node`.
101
- # @param allow_compound_target [Boolean]
102
- # Whether `extendee` is allowed to contain compound selectors.
103
- # @raise [Sass::SyntaxError] if this extension is invalid.
104
- def populate_extends(extends, extendee, extend_node = nil, parent_directives = [],
105
- allow_compound_target = false)
106
- extendee.members.each do |seq|
107
- if seq.members.size > 1
108
- raise Sass::SyntaxError.new("Can't extend #{seq}: can't extend nested selectors")
109
- end
110
-
111
- sseq = seq.members.first
112
- if !sseq.is_a?(Sass::Selector::SimpleSequence)
113
- raise Sass::SyntaxError.new("Can't extend #{seq}: invalid selector")
114
- elsif sseq.members.any? {|ss| ss.is_a?(Sass::Selector::Parent)}
115
- raise Sass::SyntaxError.new("Can't extend #{seq}: can't extend parent selectors")
116
- end
117
-
118
- sel = sseq.members
119
- if !allow_compound_target && sel.length > 1
120
- @@compound_extend_deprecation.warn(sseq.filename, sseq.line, <<WARNING)
121
- Extending a compound selector, #{sseq}, is deprecated and will not be supported in a future release.
122
- See https://github.com/sass/sass/issues/1599 for details.
123
- WARNING
124
- end
125
-
126
- members.each do |member|
127
- unless member.members.last.is_a?(Sass::Selector::SimpleSequence)
128
- raise Sass::SyntaxError.new("#{member} can't extend: invalid selector")
129
- end
130
-
131
- extends[sel] = Sass::Tree::Visitors::Cssize::Extend.new(
132
- member, sel, extend_node, parent_directives, :not_found)
133
- end
134
- end
135
- end
136
-
137
- # Unifies this with another comma selector to produce a selector
138
- # that matches (a subset of) the intersection of the two inputs.
139
- #
140
- # @param other [CommaSequence]
141
- # @return [CommaSequence, nil] The unified selector, or nil if unification failed.
142
- # @raise [Sass::SyntaxError] If this selector cannot be unified.
143
- # This will only ever occur when a dynamic selector,
144
- # such as {Parent} or {Interpolation}, is used in unification.
145
- # Since these selectors should be resolved
146
- # by the time extension and unification happen,
147
- # this exception will only ever be raised as a result of programmer error
148
- def unify(other)
149
- results = members.map {|seq1| other.members.map {|seq2| seq1.unify(seq2)}}.flatten.compact
150
- results.empty? ? nil : CommaSequence.new(results.map {|cseq| cseq.members}.flatten)
151
- end
152
-
153
- # Returns a SassScript representation of this selector.
154
- #
155
- # @return [Sass::Script::Value::List]
156
- def to_sass_script
157
- Sass::Script::Value::List.new(members.map do |seq|
158
- Sass::Script::Value::List.new(seq.members.map do |component|
159
- next if component == "\n"
160
- Sass::Script::Value::String.new(component.to_s)
161
- end.compact, :space)
162
- end, :comma)
163
- end
164
-
165
- # Returns a string representation of the sequence.
166
- # This is basically the selector string.
167
- #
168
- # @return [String]
169
- def inspect
170
- members.map {|m| m.inspect}.join(", ")
171
- end
172
-
173
- # @see AbstractSequence#to_s
174
- def to_s(opts = {})
175
- @members.map {|m| m.to_s(opts)}.
176
- join(opts[:style] == :compressed ? "," : ", ").
177
- gsub(", \n", ",\n")
178
- end
179
-
180
- private
181
-
182
- def _hash
183
- members.hash
184
- end
185
-
186
- def _eql?(other)
187
- other.class == self.class && other.members.eql?(members)
188
- end
189
- end
190
- end
191
- end