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,582 +0,0 @@
1
- require 'fileutils'
2
-
3
- require 'sass'
4
- # XXX CE: is this still necessary now that we have the compiler class?
5
- require 'sass/callbacks'
6
- require 'sass/plugin/configuration'
7
- require 'sass/plugin/staleness_checker'
8
-
9
- module Sass::Plugin
10
- # The Compiler class handles compilation of multiple files and/or directories,
11
- # including checking which CSS files are out-of-date and need to be updated
12
- # and calling Sass to perform the compilation on those files.
13
- #
14
- # {Sass::Plugin} uses this class to update stylesheets for a single application.
15
- # Unlike {Sass::Plugin}, though, the Compiler class has no global state,
16
- # and so multiple instances may be created and used independently.
17
- #
18
- # If you need to compile a Sass string into CSS,
19
- # please see the {Sass::Engine} class.
20
- #
21
- # Unlike {Sass::Plugin}, this class doesn't keep track of
22
- # whether or how many times a stylesheet should be updated.
23
- # Therefore, the following `Sass::Plugin` options are ignored by the Compiler:
24
- #
25
- # * `:never_update`
26
- # * `:always_check`
27
- class Compiler
28
- include Configuration
29
- extend Sass::Callbacks
30
-
31
- # Creates a new compiler.
32
- #
33
- # @param opts [{Symbol => Object}]
34
- # See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
35
- def initialize(opts = {})
36
- @watched_files = Set.new
37
- options.merge!(opts)
38
- end
39
-
40
- # Register a callback to be run before stylesheets are mass-updated.
41
- # This is run whenever \{#update\_stylesheets} is called,
42
- # unless the \{file:SASS_REFERENCE.md#never_update-option `:never_update` option}
43
- # is enabled.
44
- #
45
- # @yield [files]
46
- # @yieldparam files [<(String, String, String)>]
47
- # Individual files to be updated. Files in directories specified are included in this list.
48
- # The first element of each pair is the source file,
49
- # the second is the target CSS file,
50
- # the third is the target sourcemap file.
51
- define_callback :updating_stylesheets
52
-
53
- # Register a callback to be run after stylesheets are mass-updated.
54
- # This is run whenever \{#update\_stylesheets} is called,
55
- # unless the \{file:SASS_REFERENCE.md#never_update-option `:never_update` option}
56
- # is enabled.
57
- #
58
- # @yield [updated_files]
59
- # @yieldparam updated_files [<(String, String)>]
60
- # Individual files that were updated.
61
- # The first element of each pair is the source file, the second is the target CSS file.
62
- define_callback :updated_stylesheets
63
-
64
- # Register a callback to be run after a single stylesheet is updated.
65
- # The callback is only run if the stylesheet is really updated;
66
- # if the CSS file is fresh, this won't be run.
67
- #
68
- # Even if the \{file:SASS_REFERENCE.md#full_exception-option `:full_exception` option}
69
- # is enabled, this callback won't be run
70
- # when an exception CSS file is being written.
71
- # To run an action for those files, use \{#on\_compilation\_error}.
72
- #
73
- # @yield [template, css, sourcemap]
74
- # @yieldparam template [String]
75
- # The location of the Sass/SCSS file being updated.
76
- # @yieldparam css [String]
77
- # The location of the CSS file being generated.
78
- # @yieldparam sourcemap [String]
79
- # The location of the sourcemap being generated, if any.
80
- define_callback :updated_stylesheet
81
-
82
- # Register a callback to be run when compilation starts.
83
- #
84
- # In combination with on_updated_stylesheet, this could be used
85
- # to collect compilation statistics like timing or to take a
86
- # diff of the changes to the output file.
87
- #
88
- # @yield [template, css, sourcemap]
89
- # @yieldparam template [String]
90
- # The location of the Sass/SCSS file being updated.
91
- # @yieldparam css [String]
92
- # The location of the CSS file being generated.
93
- # @yieldparam sourcemap [String]
94
- # The location of the sourcemap being generated, if any.
95
- define_callback :compilation_starting
96
-
97
- # Register a callback to be run when Sass decides not to update a stylesheet.
98
- # In particular, the callback is run when Sass finds that
99
- # the template file and none of its dependencies
100
- # have been modified since the last compilation.
101
- #
102
- # Note that this is **not** run when the
103
- # \{file:SASS_REFERENCE.md#never-update_option `:never_update` option} is set,
104
- # nor when Sass decides not to compile a partial.
105
- #
106
- # @yield [template, css]
107
- # @yieldparam template [String]
108
- # The location of the Sass/SCSS file not being updated.
109
- # @yieldparam css [String]
110
- # The location of the CSS file not being generated.
111
- define_callback :not_updating_stylesheet
112
-
113
- # Register a callback to be run when there's an error
114
- # compiling a Sass file.
115
- # This could include not only errors in the Sass document,
116
- # but also errors accessing the file at all.
117
- #
118
- # @yield [error, template, css]
119
- # @yieldparam error [Exception] The exception that was raised.
120
- # @yieldparam template [String]
121
- # The location of the Sass/SCSS file being updated.
122
- # @yieldparam css [String]
123
- # The location of the CSS file being generated.
124
- define_callback :compilation_error
125
-
126
- # Register a callback to be run when Sass creates a directory
127
- # into which to put CSS files.
128
- #
129
- # Note that even if multiple levels of directories need to be created,
130
- # the callback may only be run once.
131
- # For example, if "foo/" exists and "foo/bar/baz/" needs to be created,
132
- # this may only be run for "foo/bar/baz/".
133
- # This is not a guarantee, however;
134
- # it may also be run for "foo/bar/".
135
- #
136
- # @yield [dirname]
137
- # @yieldparam dirname [String]
138
- # The location of the directory that was created.
139
- define_callback :creating_directory
140
-
141
- # Register a callback to be run when Sass detects
142
- # that a template has been modified.
143
- # This is only run when using \{#watch}.
144
- #
145
- # @yield [template]
146
- # @yieldparam template [String]
147
- # The location of the template that was modified.
148
- define_callback :template_modified
149
-
150
- # Register a callback to be run when Sass detects
151
- # that a new template has been created.
152
- # This is only run when using \{#watch}.
153
- #
154
- # @yield [template]
155
- # @yieldparam template [String]
156
- # The location of the template that was created.
157
- define_callback :template_created
158
-
159
- # Register a callback to be run when Sass detects
160
- # that a template has been deleted.
161
- # This is only run when using \{#watch}.
162
- #
163
- # @yield [template]
164
- # @yieldparam template [String]
165
- # The location of the template that was deleted.
166
- define_callback :template_deleted
167
-
168
- # Register a callback to be run when Sass deletes a CSS file.
169
- # This happens when the corresponding Sass/SCSS file has been deleted
170
- # and when the compiler cleans the output files.
171
- #
172
- # @yield [filename]
173
- # @yieldparam filename [String]
174
- # The location of the CSS file that was deleted.
175
- define_callback :deleting_css
176
-
177
- # Register a callback to be run when Sass deletes a sourcemap file.
178
- # This happens when the corresponding Sass/SCSS file has been deleted
179
- # and when the compiler cleans the output files.
180
- #
181
- # @yield [filename]
182
- # @yieldparam filename [String]
183
- # The location of the sourcemap file that was deleted.
184
- define_callback :deleting_sourcemap
185
-
186
- # Updates out-of-date stylesheets.
187
- #
188
- # Checks each Sass/SCSS file in
189
- # {file:SASS_REFERENCE.md#template_location-option `:template_location`}
190
- # to see if it's been modified more recently than the corresponding CSS file
191
- # in {file:SASS_REFERENCE.md#css_location-option `:css_location`}.
192
- # If it has, it updates the CSS file.
193
- #
194
- # @param individual_files [Array<(String, String[, String])>]
195
- # A list of files to check for updates
196
- # **in addition to those specified by the
197
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
198
- # The first string in each pair is the location of the Sass/SCSS file,
199
- # the second is the location of the CSS file that it should be compiled to.
200
- # The third string, if provided, is the location of the Sourcemap file.
201
- def update_stylesheets(individual_files = [])
202
- Sass::Plugin.checked_for_updates = true
203
- staleness_checker = StalenessChecker.new(engine_options)
204
-
205
- files = file_list(individual_files)
206
- run_updating_stylesheets(files)
207
-
208
- updated_stylesheets = []
209
- files.each do |file, css, sourcemap|
210
- # TODO: Does staleness_checker need to check the sourcemap file as well?
211
- if options[:always_update] || staleness_checker.stylesheet_needs_update?(css, file)
212
- # XXX For consistency, this should return the sourcemap too, but it would
213
- # XXX be an API change.
214
- updated_stylesheets << [file, css]
215
- update_stylesheet(file, css, sourcemap)
216
- else
217
- run_not_updating_stylesheet(file, css, sourcemap)
218
- end
219
- end
220
- run_updated_stylesheets(updated_stylesheets)
221
- end
222
-
223
- # Construct a list of files that might need to be compiled
224
- # from the provided individual_files and the template_locations.
225
- #
226
- # Note: this method does not cache the results as they can change
227
- # across invocations when sass files are added or removed.
228
- #
229
- # @param individual_files [Array<(String, String[, String])>]
230
- # A list of files to check for updates
231
- # **in addition to those specified by the
232
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
233
- # The first string in each pair is the location of the Sass/SCSS file,
234
- # the second is the location of the CSS file that it should be compiled to.
235
- # The third string, if provided, is the location of the Sourcemap file.
236
- # @return [Array<(String, String, String)>]
237
- # A list of [sass_file, css_file, sourcemap_file] tuples similar
238
- # to what was passed in, but expanded to include the current state
239
- # of the directories being updated.
240
- def file_list(individual_files = [])
241
- files = individual_files.map do |tuple|
242
- if engine_options[:sourcemap] == :none
243
- tuple[0..1]
244
- elsif tuple.size < 3
245
- [tuple[0], tuple[1], Sass::Util.sourcemap_name(tuple[1])]
246
- else
247
- tuple.dup
248
- end
249
- end
250
-
251
- template_location_array.each do |template_location, css_location|
252
- Sass::Util.glob(File.join(template_location, "**", "[^_]*.s[ca]ss")).sort.each do |file|
253
- # Get the relative path to the file
254
- name = Sass::Util.relative_path_from(file, template_location).to_s
255
- css = css_filename(name, css_location)
256
- sourcemap = Sass::Util.sourcemap_name(css) unless engine_options[:sourcemap] == :none
257
- files << [file, css, sourcemap]
258
- end
259
- end
260
- files
261
- end
262
-
263
- # Watches the template directory (or directories)
264
- # and updates the CSS files whenever the related Sass/SCSS files change.
265
- # `watch` never returns.
266
- #
267
- # Whenever a change is detected to a Sass/SCSS file in
268
- # {file:SASS_REFERENCE.md#template_location-option `:template_location`},
269
- # the corresponding CSS file in {file:SASS_REFERENCE.md#css_location-option `:css_location`}
270
- # will be recompiled.
271
- # The CSS files of any Sass/SCSS files that import the changed file will also be recompiled.
272
- #
273
- # Before the watching starts in earnest, `watch` calls \{#update\_stylesheets}.
274
- #
275
- # Note that `watch` uses the [Listen](http://github.com/guard/listen) library
276
- # to monitor the filesystem for changes.
277
- # Listen isn't loaded until `watch` is run.
278
- # The version of Listen distributed with Sass is loaded by default,
279
- # but if another version has already been loaded that will be used instead.
280
- #
281
- # @param individual_files [Array<(String, String[, String])>]
282
- # A list of files to check for updates
283
- # **in addition to those specified by the
284
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
285
- # The first string in each pair is the location of the Sass/SCSS file,
286
- # the second is the location of the CSS file that it should be compiled to.
287
- # The third string, if provided, is the location of the Sourcemap file.
288
- # @param options [Hash] The options that control how watching works.
289
- # @option options [Boolean] :skip_initial_update
290
- # Don't do an initial update when starting the watcher when true
291
- def watch(individual_files = [], options = {})
292
- @inferred_directories = []
293
- options, individual_files = individual_files, [] if individual_files.is_a?(Hash)
294
- update_stylesheets(individual_files) unless options[:skip_initial_update]
295
-
296
- directories = watched_paths
297
- individual_files.each do |(source, _, _)|
298
- source = File.expand_path(source)
299
- @watched_files << Sass::Util.realpath(source).to_s
300
- @inferred_directories << File.dirname(source)
301
- end
302
-
303
- directories += @inferred_directories
304
- directories = remove_redundant_directories(directories)
305
-
306
- # A Listen version prior to 2.0 will write a test file to a directory to
307
- # see if a watcher supports watching that directory. That breaks horribly
308
- # on read-only directories, so we filter those out.
309
- unless Sass::Util.listen_geq_2?
310
- directories = directories.select {|d| File.directory?(d) && File.writable?(d)}
311
- end
312
-
313
- # TODO: Keep better track of what depends on what
314
- # so we don't have to run a global update every time anything changes.
315
- # XXX The :additional_watch_paths option exists for Compass to use until
316
- # a deprecated feature is removed. It may be removed without warning.
317
- listener_args = directories +
318
- Array(options[:additional_watch_paths]) +
319
- [{:relative_paths => false}]
320
-
321
- # The native windows listener is much slower than the polling option, according to
322
- # https://github.com/nex3/sass/commit/a3031856b22bc834a5417dedecb038b7be9b9e3e
323
- poll = @options[:poll] || Sass::Util.windows?
324
- if poll && Sass::Util.listen_geq_2?
325
- # In Listen 2.0.0 and on, :force_polling is an option. In earlier
326
- # versions, it's a method on the listener (called below).
327
- listener_args.last[:force_polling] = true
328
- end
329
-
330
- listener = create_listener(*listener_args) do |modified, added, removed|
331
- on_file_changed(individual_files, modified, added, removed)
332
- yield(modified, added, removed) if block_given?
333
- end
334
-
335
- if poll && !Sass::Util.listen_geq_2?
336
- # In Listen 2.0.0 and on, :force_polling is an option (set above). In
337
- # earlier versions, it's a method on the listener.
338
- listener.force_polling(true)
339
- end
340
-
341
- listen_to(listener)
342
- end
343
-
344
- # Non-destructively modifies \{#options} so that default values are properly set,
345
- # and returns the result.
346
- #
347
- # @param additional_options [{Symbol => Object}] An options hash with which to merge \{#options}
348
- # @return [{Symbol => Object}] The modified options hash
349
- def engine_options(additional_options = {})
350
- opts = options.merge(additional_options)
351
- opts[:load_paths] = load_paths(opts)
352
- options[:sourcemap] = :auto if options[:sourcemap] == true
353
- options[:sourcemap] = :none if options[:sourcemap] == false
354
- opts
355
- end
356
-
357
- # Compass expects this to exist
358
- def stylesheet_needs_update?(css_file, template_file)
359
- StalenessChecker.stylesheet_needs_update?(css_file, template_file)
360
- end
361
-
362
- # Remove all output files that would be created by calling update_stylesheets, if they exist.
363
- #
364
- # This method runs the deleting_css and deleting_sourcemap callbacks for
365
- # the files that are deleted.
366
- #
367
- # @param individual_files [Array<(String, String[, String])>]
368
- # A list of files to check for updates
369
- # **in addition to those specified by the
370
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
371
- # The first string in each pair is the location of the Sass/SCSS file,
372
- # the second is the location of the CSS file that it should be compiled to.
373
- # The third string, if provided, is the location of the Sourcemap file.
374
- def clean(individual_files = [])
375
- file_list(individual_files).each do |(_, css_file, sourcemap_file)|
376
- if File.exist?(css_file)
377
- run_deleting_css css_file
378
- File.delete(css_file)
379
- end
380
- if sourcemap_file && File.exist?(sourcemap_file)
381
- run_deleting_sourcemap sourcemap_file
382
- File.delete(sourcemap_file)
383
- end
384
- end
385
- nil
386
- end
387
-
388
- private
389
-
390
- def create_listener(*args, &block)
391
- Sass::Util.load_listen!
392
- if Sass::Util.listen_geq_2?
393
- # Work around guard/listen#243.
394
- options = args.pop if args.last.is_a?(Hash)
395
- args.map do |dir|
396
- Listen.to(dir, options, &block)
397
- end
398
- else
399
- Listen::Listener.new(*args, &block)
400
- end
401
- end
402
-
403
- def listen_to(listener)
404
- if Sass::Util.listen_geq_2?
405
- listener.map {|l| l.start}
406
- sleep
407
- else
408
- listener.start!
409
- end
410
- rescue Interrupt
411
- # Squelch Interrupt for clean exit from Listen::Listener
412
- end
413
-
414
- def remove_redundant_directories(directories)
415
- dedupped = []
416
- directories.each do |new_directory|
417
- # no need to add a directory that is already watched.
418
- next if dedupped.any? do |existing_directory|
419
- child_of_directory?(existing_directory, new_directory)
420
- end
421
- # get rid of any sub directories of this new directory
422
- dedupped.reject! do |existing_directory|
423
- child_of_directory?(new_directory, existing_directory)
424
- end
425
- dedupped << new_directory
426
- end
427
- dedupped
428
- end
429
-
430
- def on_file_changed(individual_files, modified, added, removed)
431
- recompile_required = false
432
-
433
- modified.uniq.each do |f|
434
- next unless watched_file?(f)
435
- recompile_required = true
436
- run_template_modified(relative_to_pwd(f))
437
- end
438
-
439
- added.uniq.each do |f|
440
- next unless watched_file?(f)
441
- recompile_required = true
442
- run_template_created(relative_to_pwd(f))
443
- end
444
-
445
- removed.uniq.each do |f|
446
- next unless watched_file?(f)
447
- run_template_deleted(relative_to_pwd(f))
448
- if (files = individual_files.find {|(source, _, _)| File.expand_path(source) == f})
449
- recompile_required = true
450
- # This was a file we were watching explicitly and compiling to a particular location.
451
- # Delete the corresponding file.
452
- try_delete_css files[1]
453
- else
454
- next unless watched_file?(f)
455
- recompile_required = true
456
- # Look for the sass directory that contained the sass file
457
- # And try to remove the css file that corresponds to it
458
- template_location_array.each do |(sass_dir, css_dir)|
459
- sass_dir = File.expand_path(sass_dir)
460
- next unless child_of_directory?(sass_dir, f)
461
- remainder = f[(sass_dir.size + 1)..-1]
462
- try_delete_css(css_filename(remainder, css_dir))
463
- break
464
- end
465
- end
466
- end
467
-
468
- return unless recompile_required
469
-
470
- # In case a file we're watching is removed and then recreated we
471
- # prune out the non-existant files here.
472
- watched_files_remaining = individual_files.select {|(source, _, _)| File.exist?(source)}
473
- update_stylesheets(watched_files_remaining)
474
- end
475
-
476
- def update_stylesheet(filename, css, sourcemap)
477
- dir = File.dirname(css)
478
- unless File.exist?(dir)
479
- run_creating_directory dir
480
- FileUtils.mkdir_p dir
481
- end
482
-
483
- begin
484
- File.read(filename) unless File.readable?(filename) # triggers an error for handling
485
- engine_opts = engine_options(:css_filename => css,
486
- :filename => filename,
487
- :sourcemap_filename => sourcemap)
488
- mapping = nil
489
- run_compilation_starting(filename, css, sourcemap)
490
- engine = Sass::Engine.for_file(filename, engine_opts)
491
- if sourcemap
492
- rendered, mapping = engine.render_with_sourcemap(File.basename(sourcemap))
493
- else
494
- rendered = engine.render
495
- end
496
- rescue StandardError => e
497
- compilation_error_occured = true
498
- run_compilation_error e, filename, css, sourcemap
499
- raise e unless options[:full_exception]
500
- rendered = Sass::SyntaxError.exception_to_css(e, options[:line] || 1)
501
- end
502
-
503
- write_file(css, rendered)
504
- if mapping
505
- write_file(
506
- sourcemap,
507
- mapping.to_json(
508
- :css_path => css, :sourcemap_path => sourcemap, :type => options[:sourcemap]))
509
- end
510
- run_updated_stylesheet(filename, css, sourcemap) unless compilation_error_occured
511
- end
512
-
513
- def write_file(fileName, content)
514
- flag = 'w'
515
- flag = 'wb' if Sass::Util.windows? && options[:unix_newlines]
516
- File.open(fileName, flag) do |file|
517
- file.set_encoding(content.encoding) unless Sass::Util.ruby1_8?
518
- file.print(content)
519
- end
520
- end
521
-
522
- def try_delete_css(css)
523
- if File.exist?(css)
524
- run_deleting_css css
525
- File.delete css
526
- end
527
- map = Sass::Util.sourcemap_name(css)
528
-
529
- return unless File.exist?(map)
530
-
531
- run_deleting_sourcemap map
532
- File.delete map
533
- end
534
-
535
- def watched_file?(file)
536
- @watched_files.include?(file) ||
537
- normalized_load_paths.any? {|lp| lp.watched_file?(file)} ||
538
- @inferred_directories.any? {|d| sass_file_in_directory?(d, file)}
539
- end
540
-
541
- def sass_file_in_directory?(directory, filename)
542
- filename =~ /\.s[ac]ss$/ && filename.start_with?(directory + File::SEPARATOR)
543
- end
544
-
545
- def watched_paths
546
- @watched_paths ||= normalized_load_paths.map {|lp| lp.directories_to_watch}.compact.flatten
547
- end
548
-
549
- def normalized_load_paths
550
- @normalized_load_paths ||=
551
- Sass::Engine.normalize_options(:load_paths => load_paths)[:load_paths]
552
- end
553
-
554
- def load_paths(opts = options)
555
- (opts[:load_paths] || []) + template_locations
556
- end
557
-
558
- def template_locations
559
- template_location_array.to_a.map {|l| l.first}
560
- end
561
-
562
- def css_locations
563
- template_location_array.to_a.map {|l| l.last}
564
- end
565
-
566
- def css_filename(name, path)
567
- "#{path}#{File::SEPARATOR unless path.end_with?(File::SEPARATOR)}#{name}".
568
- gsub(/\.s[ac]ss$/, '.css')
569
- end
570
-
571
- def relative_to_pwd(f)
572
- Sass::Util.relative_path_from(f, Dir.pwd).to_s
573
- rescue ArgumentError # when a relative path cannot be computed
574
- f
575
- end
576
-
577
- def child_of_directory?(parent, child)
578
- parent_dir = parent.end_with?(File::SEPARATOR) ? parent : (parent + File::SEPARATOR)
579
- child.start_with?(parent_dir) || parent == child
580
- end
581
- end
582
- end