brakeman 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of brakeman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +17 -0
- data/bundle/load.rb +7 -8
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/lib/ruby2ruby.rb +34 -36
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/History.rdoc +47 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/Manifest.txt +5 -4
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/compare/normalize.rb +29 -2
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/debugging.md +18 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_extensions.rb +0 -7
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby20_parser.rb +6874 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby20_parser.y +284 -201
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby21_parser.rb +6952 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby21_parser.y +281 -197
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby22_parser.rb +6983 -0
- 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
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby23_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby23_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby24_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby24_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby25_parser.rb +6981 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby25_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.rb +6999 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.y +2469 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rb +116 -118
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex +10 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex.rb +8 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_parser.rb +5 -7
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser.yy +2571 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser_extras.rb +1360 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/munge.rb +216 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/ripper.rb +23 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +6 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +19 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +54 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +5 -0
- 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
- 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
- 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
- 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
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +1412 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +179 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +323 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +30 -0
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/CHANGES.md +5 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/LICENSE.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/README.md +0 -0
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/deep.rb +0 -0
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/load.rb +0 -0
- 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
- 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
- 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
- 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
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/resolver.rb +0 -0
- 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
- data/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +39 -0
- 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
- 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
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform.rb +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/version.rb +1 -1
- 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
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/safe_yaml.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/pt_testcase.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp.rb +4 -4
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/strict_sexp.rb +3 -3
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/unique.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/CHANGES +6 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/EXPRESSIONS.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/LICENSE +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/README.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/string_splitter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/map.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/dispatcher.rb +2 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/rails.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/utils.rb +0 -0
- data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/temple.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/CHANGELOG.md +4 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/README.md +10 -10
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.5.0/data/display_width.marshal.gz +0 -0
- 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
- 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
- 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
- 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
- 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
- data/lib/brakeman/checks/base_check.rb +16 -0
- data/lib/brakeman/checks/check_content_tag.rb +12 -0
- data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -6
- data/lib/brakeman/checks/check_evaluation.rb +0 -1
- data/lib/brakeman/checks/check_execute.rb +18 -0
- data/lib/brakeman/checks/check_send.rb +0 -1
- data/lib/brakeman/checks/check_session_manipulation.rb +0 -1
- data/lib/brakeman/checks/check_sql.rb +12 -3
- data/lib/brakeman/file_parser.rb +8 -4
- data/lib/brakeman/parsers/haml_embedded.rb +44 -0
- data/lib/brakeman/parsers/slim_embedded.rb +44 -0
- data/lib/brakeman/parsers/template_parser.rb +2 -4
- data/lib/brakeman/processors/alias_processor.rb +23 -1
- data/lib/brakeman/processors/lib/call_conversion_helper.rb +4 -0
- data/lib/brakeman/processors/slim_template_processor.rb +16 -0
- data/lib/brakeman/processors/template_alias_processor.rb +2 -2
- data/lib/brakeman/scanner.rb +11 -10
- data/lib/brakeman/tracker.rb +5 -1
- data/lib/brakeman/tracker/config.rb +32 -7
- data/lib/brakeman/util.rb +17 -0
- data/lib/brakeman/version.rb +1 -1
- metadata +157 -320
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby20_parser.rb +0 -6687
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby21_parser.rb +0 -6767
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.rb +0 -6803
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.y +0 -2376
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby23_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby24_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby25_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CODE_OF_CONDUCT.md +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CONTRIBUTING.md +0 -148
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/MIT-LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/README.md +0 -227
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/REVISION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_DATE +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_NAME +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/sass-spec-ref.sh +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/update_watch.rb +0 -13
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/init.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/base.rb +0 -88
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/chain.rb +0 -34
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/filesystem.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/memory.rb +0 -46
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/null.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/callbacks.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/css.rb +0 -408
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/deprecation.rb +0 -55
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/engine.rb +0 -1226
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/environment.rb +0 -215
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/error.rb +0 -198
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/base.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_convert.rb +0 -283
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb +0 -440
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/features.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers.rb +0 -23
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/base.rb +0 -182
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/deprecated_path.rb +0 -51
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/filesystem.rb +0 -219
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger.rb +0 -17
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/base.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/delayed.rb +0 -50
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/log_level.rb +0 -45
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/media.rb +0 -210
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb +0 -582
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/configuration.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/generic.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/merb.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rack.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rails.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/staleness_checker.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/railtie.rb +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/repl.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/root.rb +0 -7
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script.rb +0 -66
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_lexer.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_parser.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_variable_warning.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/functions.rb +0 -2693
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/lexer.rb +0 -464
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/parser.rb +0 -832
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree.rb +0 -16
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/funcall.rb +0 -313
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/interpolation.rb +0 -223
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/list_literal.rb +0 -104
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/literal.rb +0 -49
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/map_literal.rb +0 -64
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/node.rb +0 -127
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/operation.rb +0 -156
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/selector.rb +0 -26
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/string_interpolation.rb +0 -125
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/unary_operation.rb +0 -69
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/variable.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value.rb +0 -11
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/arg_list.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/base.rb +0 -241
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/bool.rb +0 -35
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/color.rb +0 -698
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/helpers.rb +0 -272
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/list.rb +0 -113
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/map.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/null.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/number.rb +0 -563
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/string.rb +0 -138
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss.rb +0 -14
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/css_parser.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/parser.rb +0 -1254
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/rx.rb +0 -140
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/static_parser.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/abstract_sequence.rb +0 -111
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/comma_sequence.rb +0 -191
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/pseudo.rb +0 -266
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb +0 -636
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple.rb +0 -117
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple_sequence.rb +0 -344
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/shared.rb +0 -76
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/map.rb +0 -213
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/position.rb +0 -39
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/range.rb +0 -41
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/stack.rb +0 -120
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/supports.rb +0 -225
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/at_root_node.rb +0 -83
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/charset_node.rb +0 -22
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/comment_node.rb +0 -82
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/content_node.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/css_import_node.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/debug_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/directive_node.rb +0 -59
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/each_node.rb +0 -24
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/error_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/extend_node.rb +0 -43
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/for_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/function_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/if_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/import_node.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/keyframe_rule_node.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/media_node.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_def_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/node.rb +0 -240
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/prop_node.rb +0 -170
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/return_node.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/root_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/rule_node.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/supports_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/trace_node.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/variable_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb +0 -72
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/check_nesting.rb +0 -173
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/convert.rb +0 -351
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/cssize.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/deep_copy.rb +0 -107
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/extend.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb +0 -564
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/set_options.rb +0 -139
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/to_css.rb +0 -409
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/warn_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/while_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util.rb +0 -1375
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/cross_platform_random.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/multibyte_string_scanner.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/normalized_map.rb +0 -129
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/ordered_hash.rb +0 -192
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/subset_map.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/test.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/version.rb +0 -124
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/rails/init.rb +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CHANGELOG.md +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CONTRIBUTING.md +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Gemfile +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Guardfile +0 -8
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/README.md +0 -349
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Rakefile +0 -5
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Vagrantfile +0 -96
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb +0 -54
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapter.rb +0 -327
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/listener.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/listen.gemspec +0 -28
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen_spec.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/spec_helper.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/platform_helper.rb +0 -15
- data/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.4.1/data/display_width.marshal.gz +0 -0
@@ -1,408 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../sass'
|
2
|
-
require 'sass/tree/node'
|
3
|
-
require 'sass/scss/css_parser'
|
4
|
-
|
5
|
-
module Sass
|
6
|
-
# This class converts CSS documents into Sass or SCSS templates.
|
7
|
-
# It works by parsing the CSS document into a {Sass::Tree} structure,
|
8
|
-
# and then applying various transformations to the structure
|
9
|
-
# to produce more concise and idiomatic Sass/SCSS.
|
10
|
-
#
|
11
|
-
# Example usage:
|
12
|
-
#
|
13
|
-
# Sass::CSS.new("p { color: blue }").render(:sass) #=> "p\n color: blue"
|
14
|
-
# Sass::CSS.new("p { color: blue }").render(:scss) #=> "p {\n color: blue; }"
|
15
|
-
class CSS
|
16
|
-
# @param template [String] The CSS stylesheet.
|
17
|
-
# This stylesheet can be encoded using any encoding
|
18
|
-
# that can be converted to Unicode.
|
19
|
-
# If the stylesheet contains an `@charset` declaration,
|
20
|
-
# that overrides the Ruby encoding
|
21
|
-
# (see {file:SASS_REFERENCE.md#Encodings the encoding documentation})
|
22
|
-
# @option options :old [Boolean] (false)
|
23
|
-
# Whether or not to output old property syntax
|
24
|
-
# (`:color blue` as opposed to `color: blue`).
|
25
|
-
# This is only meaningful when generating Sass code,
|
26
|
-
# rather than SCSS.
|
27
|
-
# @option options :indent [String] (" ")
|
28
|
-
# The string to use for indenting each line. Defaults to two spaces.
|
29
|
-
def initialize(template, options = {})
|
30
|
-
if template.is_a? IO
|
31
|
-
template = template.read
|
32
|
-
end
|
33
|
-
|
34
|
-
@options = options.merge(:_convert => true)
|
35
|
-
# Backwards compatibility
|
36
|
-
@options[:old] = true if @options[:alternate] == false
|
37
|
-
@template = template
|
38
|
-
@checked_encoding = false
|
39
|
-
end
|
40
|
-
|
41
|
-
# Converts the CSS template into Sass or SCSS code.
|
42
|
-
#
|
43
|
-
# @param fmt [Symbol] `:sass` or `:scss`, designating the format to return.
|
44
|
-
# @return [String] The resulting Sass or SCSS code
|
45
|
-
# @raise [Sass::SyntaxError] if there's an error parsing the CSS template
|
46
|
-
def render(fmt = :sass)
|
47
|
-
check_encoding!
|
48
|
-
build_tree.send("to_#{fmt}", @options).strip + "\n"
|
49
|
-
rescue Sass::SyntaxError => err
|
50
|
-
err.modify_backtrace(:filename => @options[:filename] || '(css)')
|
51
|
-
raise err
|
52
|
-
end
|
53
|
-
|
54
|
-
# Returns the original encoding of the document,
|
55
|
-
# or `nil` under Ruby 1.8.
|
56
|
-
#
|
57
|
-
# @return [Encoding, nil]
|
58
|
-
# @raise [Encoding::UndefinedConversionError] if the source encoding
|
59
|
-
# cannot be converted to UTF-8
|
60
|
-
# @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
|
61
|
-
def source_encoding
|
62
|
-
check_encoding!
|
63
|
-
@original_encoding
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def check_encoding!
|
69
|
-
return if @checked_encoding
|
70
|
-
@checked_encoding = true
|
71
|
-
@template, @original_encoding = Sass::Util.check_sass_encoding(@template)
|
72
|
-
end
|
73
|
-
|
74
|
-
# Parses the CSS template and applies various transformations
|
75
|
-
#
|
76
|
-
# @return [Tree::Node] The root node of the parsed tree
|
77
|
-
def build_tree
|
78
|
-
root = Sass::SCSS::CssParser.new(@template, @options[:filename], nil).parse
|
79
|
-
parse_selectors(root)
|
80
|
-
expand_commas(root)
|
81
|
-
nest_seqs(root)
|
82
|
-
parent_ref_rules(root)
|
83
|
-
flatten_rules(root)
|
84
|
-
bubble_subject(root)
|
85
|
-
fold_commas(root)
|
86
|
-
dump_selectors(root)
|
87
|
-
root
|
88
|
-
end
|
89
|
-
|
90
|
-
# Parse all the selectors in the document and assign them to
|
91
|
-
# {Sass::Tree::RuleNode#parsed_rules}.
|
92
|
-
#
|
93
|
-
# @param root [Tree::Node] The parent node
|
94
|
-
def parse_selectors(root)
|
95
|
-
root.children.each do |child|
|
96
|
-
next parse_selectors(child) if child.is_a?(Tree::DirectiveNode)
|
97
|
-
next unless child.is_a?(Tree::RuleNode)
|
98
|
-
parser = Sass::SCSS::CssParser.new(child.rule.first, child.filename, nil, child.line)
|
99
|
-
child.parsed_rules = parser.parse_selector
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
# Transform
|
104
|
-
#
|
105
|
-
# foo, bar, baz
|
106
|
-
# color: blue
|
107
|
-
#
|
108
|
-
# into
|
109
|
-
#
|
110
|
-
# foo
|
111
|
-
# color: blue
|
112
|
-
# bar
|
113
|
-
# color: blue
|
114
|
-
# baz
|
115
|
-
# color: blue
|
116
|
-
#
|
117
|
-
# @param root [Tree::Node] The parent node
|
118
|
-
def expand_commas(root)
|
119
|
-
root.children.map! do |child|
|
120
|
-
# child.parsed_rules.members.size > 1 iff the rule contains a comma
|
121
|
-
unless child.is_a?(Tree::RuleNode) && child.parsed_rules.members.size > 1
|
122
|
-
expand_commas(child) if child.is_a?(Tree::DirectiveNode)
|
123
|
-
next child
|
124
|
-
end
|
125
|
-
child.parsed_rules.members.map do |seq|
|
126
|
-
node = Tree::RuleNode.new([])
|
127
|
-
node.parsed_rules = make_cseq(seq)
|
128
|
-
node.children = child.children
|
129
|
-
node
|
130
|
-
end
|
131
|
-
end
|
132
|
-
root.children.flatten!
|
133
|
-
end
|
134
|
-
|
135
|
-
# Make rules use nesting so that
|
136
|
-
#
|
137
|
-
# foo
|
138
|
-
# color: green
|
139
|
-
# foo bar
|
140
|
-
# color: red
|
141
|
-
# foo baz
|
142
|
-
# color: blue
|
143
|
-
#
|
144
|
-
# becomes
|
145
|
-
#
|
146
|
-
# foo
|
147
|
-
# color: green
|
148
|
-
# bar
|
149
|
-
# color: red
|
150
|
-
# baz
|
151
|
-
# color: blue
|
152
|
-
#
|
153
|
-
# @param root [Tree::Node] The parent node
|
154
|
-
def nest_seqs(root)
|
155
|
-
current_rule = nil
|
156
|
-
root.children.map! do |child|
|
157
|
-
unless child.is_a?(Tree::RuleNode)
|
158
|
-
nest_seqs(child) if child.is_a?(Tree::DirectiveNode)
|
159
|
-
next child
|
160
|
-
end
|
161
|
-
|
162
|
-
seq = first_seq(child)
|
163
|
-
seq.members.reject! {|sseq| sseq == "\n"}
|
164
|
-
first, rest = seq.members.first, seq.members[1..-1]
|
165
|
-
|
166
|
-
if current_rule.nil? || first_sseq(current_rule) != first
|
167
|
-
current_rule = Tree::RuleNode.new([])
|
168
|
-
current_rule.parsed_rules = make_seq(first)
|
169
|
-
end
|
170
|
-
|
171
|
-
if rest.empty?
|
172
|
-
current_rule.children += child.children
|
173
|
-
else
|
174
|
-
child.parsed_rules = make_seq(*rest)
|
175
|
-
current_rule << child
|
176
|
-
end
|
177
|
-
|
178
|
-
current_rule
|
179
|
-
end
|
180
|
-
root.children.compact!
|
181
|
-
root.children.uniq!
|
182
|
-
|
183
|
-
root.children.each {|v| nest_seqs(v)}
|
184
|
-
end
|
185
|
-
|
186
|
-
# Make rules use parent refs so that
|
187
|
-
#
|
188
|
-
# foo
|
189
|
-
# color: green
|
190
|
-
# foo.bar
|
191
|
-
# color: blue
|
192
|
-
#
|
193
|
-
# becomes
|
194
|
-
#
|
195
|
-
# foo
|
196
|
-
# color: green
|
197
|
-
# &.bar
|
198
|
-
# color: blue
|
199
|
-
#
|
200
|
-
# @param root [Tree::Node] The parent node
|
201
|
-
def parent_ref_rules(root)
|
202
|
-
current_rule = nil
|
203
|
-
root.children.map! do |child|
|
204
|
-
unless child.is_a?(Tree::RuleNode)
|
205
|
-
parent_ref_rules(child) if child.is_a?(Tree::DirectiveNode)
|
206
|
-
next child
|
207
|
-
end
|
208
|
-
|
209
|
-
sseq = first_sseq(child)
|
210
|
-
next child unless sseq.is_a?(Sass::Selector::SimpleSequence)
|
211
|
-
|
212
|
-
firsts, rest = [sseq.members.first], sseq.members[1..-1]
|
213
|
-
firsts.push rest.shift if firsts.first.is_a?(Sass::Selector::Parent)
|
214
|
-
|
215
|
-
last_simple_subject = rest.empty? && sseq.subject?
|
216
|
-
if current_rule.nil? || first_sseq(current_rule).members != firsts ||
|
217
|
-
!!first_sseq(current_rule).subject? != !!last_simple_subject
|
218
|
-
current_rule = Tree::RuleNode.new([])
|
219
|
-
current_rule.parsed_rules = make_sseq(last_simple_subject, *firsts)
|
220
|
-
end
|
221
|
-
|
222
|
-
if rest.empty?
|
223
|
-
current_rule.children += child.children
|
224
|
-
else
|
225
|
-
rest.unshift Sass::Selector::Parent.new
|
226
|
-
child.parsed_rules = make_sseq(sseq.subject?, *rest)
|
227
|
-
current_rule << child
|
228
|
-
end
|
229
|
-
|
230
|
-
current_rule
|
231
|
-
end
|
232
|
-
root.children.compact!
|
233
|
-
root.children.uniq!
|
234
|
-
|
235
|
-
root.children.each {|v| parent_ref_rules(v)}
|
236
|
-
end
|
237
|
-
|
238
|
-
# Flatten rules so that
|
239
|
-
#
|
240
|
-
# foo
|
241
|
-
# bar
|
242
|
-
# color: red
|
243
|
-
#
|
244
|
-
# becomes
|
245
|
-
#
|
246
|
-
# foo bar
|
247
|
-
# color: red
|
248
|
-
#
|
249
|
-
# and
|
250
|
-
#
|
251
|
-
# foo
|
252
|
-
# &.bar
|
253
|
-
# color: blue
|
254
|
-
#
|
255
|
-
# becomes
|
256
|
-
#
|
257
|
-
# foo.bar
|
258
|
-
# color: blue
|
259
|
-
#
|
260
|
-
# @param root [Tree::Node] The parent node
|
261
|
-
def flatten_rules(root)
|
262
|
-
root.children.each do |child|
|
263
|
-
case child
|
264
|
-
when Tree::RuleNode
|
265
|
-
flatten_rule(child)
|
266
|
-
when Tree::DirectiveNode
|
267
|
-
flatten_rules(child)
|
268
|
-
end
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
# Flattens a single rule.
|
273
|
-
#
|
274
|
-
# @param rule [Tree::RuleNode] The candidate for flattening
|
275
|
-
# @see #flatten_rules
|
276
|
-
def flatten_rule(rule)
|
277
|
-
while rule.children.size == 1 && rule.children.first.is_a?(Tree::RuleNode)
|
278
|
-
child = rule.children.first
|
279
|
-
|
280
|
-
if first_simple_sel(child).is_a?(Sass::Selector::Parent)
|
281
|
-
rule.parsed_rules = child.parsed_rules.resolve_parent_refs(rule.parsed_rules)
|
282
|
-
else
|
283
|
-
rule.parsed_rules = make_seq(*(first_seq(rule).members + first_seq(child).members))
|
284
|
-
end
|
285
|
-
|
286
|
-
rule.children = child.children
|
287
|
-
end
|
288
|
-
|
289
|
-
flatten_rules(rule)
|
290
|
-
end
|
291
|
-
|
292
|
-
def bubble_subject(root)
|
293
|
-
root.children.each do |child|
|
294
|
-
bubble_subject(child) if child.is_a?(Tree::RuleNode) || child.is_a?(Tree::DirectiveNode)
|
295
|
-
next unless child.is_a?(Tree::RuleNode) && !child.children.empty?
|
296
|
-
next unless child.children.all? do |c|
|
297
|
-
next unless c.is_a?(Tree::RuleNode)
|
298
|
-
first_simple_sel(c).is_a?(Sass::Selector::Parent) && first_sseq(c).subject?
|
299
|
-
end
|
300
|
-
first_sseq(child).subject = true
|
301
|
-
child.children.each {|c| first_sseq(c).subject = false}
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
|
-
# Transform
|
306
|
-
#
|
307
|
-
# foo
|
308
|
-
# bar
|
309
|
-
# color: blue
|
310
|
-
# baz
|
311
|
-
# color: blue
|
312
|
-
#
|
313
|
-
# into
|
314
|
-
#
|
315
|
-
# foo
|
316
|
-
# bar, baz
|
317
|
-
# color: blue
|
318
|
-
#
|
319
|
-
# @param root [Tree::Node] The parent node
|
320
|
-
def fold_commas(root)
|
321
|
-
prev_rule = nil
|
322
|
-
root.children.map! do |child|
|
323
|
-
unless child.is_a?(Tree::RuleNode)
|
324
|
-
fold_commas(child) if child.is_a?(Tree::DirectiveNode)
|
325
|
-
next child
|
326
|
-
end
|
327
|
-
|
328
|
-
if prev_rule && prev_rule.children.map {|c| c.to_sass} == child.children.map {|c| c.to_sass}
|
329
|
-
prev_rule.parsed_rules.members << first_seq(child)
|
330
|
-
next nil
|
331
|
-
end
|
332
|
-
|
333
|
-
fold_commas(child)
|
334
|
-
prev_rule = child
|
335
|
-
child
|
336
|
-
end
|
337
|
-
root.children.compact!
|
338
|
-
end
|
339
|
-
|
340
|
-
# Dump all the parsed {Sass::Tree::RuleNode} selectors to strings.
|
341
|
-
#
|
342
|
-
# @param root [Tree::Node] The parent node
|
343
|
-
def dump_selectors(root)
|
344
|
-
root.children.each do |child|
|
345
|
-
next dump_selectors(child) if child.is_a?(Tree::DirectiveNode)
|
346
|
-
next unless child.is_a?(Tree::RuleNode)
|
347
|
-
child.rule = [child.parsed_rules.to_s]
|
348
|
-
dump_selectors(child)
|
349
|
-
end
|
350
|
-
end
|
351
|
-
|
352
|
-
# Create a {Sass::Selector::CommaSequence}.
|
353
|
-
#
|
354
|
-
# @param seqs [Array<Sass::Selector::Sequence>]
|
355
|
-
# @return [Sass::Selector::CommaSequence]
|
356
|
-
def make_cseq(*seqs)
|
357
|
-
Sass::Selector::CommaSequence.new(seqs)
|
358
|
-
end
|
359
|
-
|
360
|
-
# Create a {Sass::Selector::CommaSequence} containing only a single
|
361
|
-
# {Sass::Selector::Sequence}.
|
362
|
-
#
|
363
|
-
# @param sseqs [Array<Sass::Selector::Sequence, String>]
|
364
|
-
# @return [Sass::Selector::CommaSequence]
|
365
|
-
def make_seq(*sseqs)
|
366
|
-
make_cseq(Sass::Selector::Sequence.new(sseqs))
|
367
|
-
end
|
368
|
-
|
369
|
-
# Create a {Sass::Selector::CommaSequence} containing only a single
|
370
|
-
# {Sass::Selector::Sequence} which in turn contains only a single
|
371
|
-
# {Sass::Selector::SimpleSequence}.
|
372
|
-
#
|
373
|
-
# @param subject [Boolean] Whether this is a subject selector
|
374
|
-
# @param sseqs [Array<Sass::Selector::Sequence, String>]
|
375
|
-
# @return [Sass::Selector::CommaSequence]
|
376
|
-
def make_sseq(subject, *sseqs)
|
377
|
-
make_seq(Sass::Selector::SimpleSequence.new(sseqs, subject))
|
378
|
-
end
|
379
|
-
|
380
|
-
# Return the first {Sass::Selector::Sequence} in a {Sass::Tree::RuleNode}.
|
381
|
-
#
|
382
|
-
# @param rule [Sass::Tree::RuleNode]
|
383
|
-
# @return [Sass::Selector::Sequence]
|
384
|
-
def first_seq(rule)
|
385
|
-
rule.parsed_rules.members.first
|
386
|
-
end
|
387
|
-
|
388
|
-
# Return the first {Sass::Selector::SimpleSequence} in a
|
389
|
-
# {Sass::Tree::RuleNode}.
|
390
|
-
#
|
391
|
-
# @param rule [Sass::Tree::RuleNode]
|
392
|
-
# @return [Sass::Selector::SimpleSequence, String]
|
393
|
-
def first_sseq(rule)
|
394
|
-
first_seq(rule).members.first
|
395
|
-
end
|
396
|
-
|
397
|
-
# Return the first {Sass::Selector::Simple} in a {Sass::Tree::RuleNode},
|
398
|
-
# unless the rule begins with a combinator.
|
399
|
-
#
|
400
|
-
# @param rule [Sass::Tree::RuleNode]
|
401
|
-
# @return [Sass::Selector::Simple?]
|
402
|
-
def first_simple_sel(rule)
|
403
|
-
sseq = first_sseq(rule)
|
404
|
-
return unless sseq.is_a?(Sass::Selector::SimpleSequence)
|
405
|
-
sseq.members.first
|
406
|
-
end
|
407
|
-
end
|
408
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
# A deprecation warning that should only be printed once for a given line in a
|
3
|
-
# given file.
|
4
|
-
#
|
5
|
-
# A global Deprecation instance should be created for each type of deprecation
|
6
|
-
# warning, and `warn` should be called each time a warning is needed.
|
7
|
-
class Deprecation
|
8
|
-
@@allow_double_warnings = false
|
9
|
-
|
10
|
-
# Runs a block in which double deprecation warnings for the same location
|
11
|
-
# are allowed.
|
12
|
-
def self.allow_double_warnings
|
13
|
-
old_allow_double_warnings = @@allow_double_warnings
|
14
|
-
@@allow_double_warnings = true
|
15
|
-
yield
|
16
|
-
ensure
|
17
|
-
@@allow_double_warnings = old_allow_double_warnings
|
18
|
-
end
|
19
|
-
|
20
|
-
def initialize
|
21
|
-
# A set of filename, line pairs for which warnings have been emitted.
|
22
|
-
@seen = Set.new
|
23
|
-
end
|
24
|
-
|
25
|
-
# Prints `message` as a deprecation warning associated with `filename`,
|
26
|
-
# `line`, and optionally `column`.
|
27
|
-
#
|
28
|
-
# This ensures that only one message will be printed for each line of a
|
29
|
-
# given file.
|
30
|
-
#
|
31
|
-
# @overload warn(filename, line, message)
|
32
|
-
# @param filename [String, nil]
|
33
|
-
# @param line [Number]
|
34
|
-
# @param message [String]
|
35
|
-
# @overload warn(filename, line, column, message)
|
36
|
-
# @param filename [String, nil]
|
37
|
-
# @param line [Number]
|
38
|
-
# @param column [Number]
|
39
|
-
# @param message [String]
|
40
|
-
def warn(filename, line, column_or_message, message = nil)
|
41
|
-
return if !@@allow_double_warnings && @seen.add?([filename, line]).nil?
|
42
|
-
if message
|
43
|
-
column = column_or_message
|
44
|
-
else
|
45
|
-
message = column_or_message
|
46
|
-
end
|
47
|
-
|
48
|
-
location = "line #{line}"
|
49
|
-
location << ", column #{column}" if column
|
50
|
-
location << " of #{filename}" if filename
|
51
|
-
|
52
|
-
Sass::Util.sass_warn("DEPRECATION WARNING on #{location}:\n#{message}")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|