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.
- 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,76 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
# This module contains functionality that's shared between Haml and Sass.
|
3
|
-
module Shared
|
4
|
-
extend self
|
5
|
-
|
6
|
-
# Scans through a string looking for the interoplation-opening `#{`
|
7
|
-
# and, when it's found, yields the scanner to the calling code
|
8
|
-
# so it can handle it properly.
|
9
|
-
#
|
10
|
-
# The scanner will have any backslashes immediately in front of the `#{`
|
11
|
-
# as the second capture group (`scan[2]`),
|
12
|
-
# and the text prior to that as the first (`scan[1]`).
|
13
|
-
#
|
14
|
-
# @yieldparam scan [StringScanner] The scanner scanning through the string
|
15
|
-
# @return [String] The text remaining in the scanner after all `#{`s have been processed
|
16
|
-
def handle_interpolation(str)
|
17
|
-
scan = Sass::Util::MultibyteStringScanner.new(str)
|
18
|
-
yield scan while scan.scan(/(.*?)(\\*)\#\{/m)
|
19
|
-
scan.rest
|
20
|
-
end
|
21
|
-
|
22
|
-
# Moves a scanner through a balanced pair of characters.
|
23
|
-
# For example:
|
24
|
-
#
|
25
|
-
# Foo (Bar (Baz bang) bop) (Bang (bop bip))
|
26
|
-
# ^ ^
|
27
|
-
# from to
|
28
|
-
#
|
29
|
-
# @param scanner [StringScanner] The string scanner to move
|
30
|
-
# @param start [Character] The character opening the balanced pair.
|
31
|
-
# A `Fixnum` in 1.8, a `String` in 1.9
|
32
|
-
# @param finish [Character] The character closing the balanced pair.
|
33
|
-
# A `Fixnum` in 1.8, a `String` in 1.9
|
34
|
-
# @param count [Integer] The number of opening characters matched
|
35
|
-
# before calling this method
|
36
|
-
# @return [(String, String)] The string matched within the balanced pair
|
37
|
-
# and the rest of the string.
|
38
|
-
# `["Foo (Bar (Baz bang) bop)", " (Bang (bop bip))"]` in the example above.
|
39
|
-
def balance(scanner, start, finish, count = 0)
|
40
|
-
str = ''
|
41
|
-
scanner = Sass::Util::MultibyteStringScanner.new(scanner) unless scanner.is_a? StringScanner
|
42
|
-
regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE)
|
43
|
-
while scanner.scan(regexp)
|
44
|
-
str << scanner.matched
|
45
|
-
count += 1 if scanner.matched[-1] == start
|
46
|
-
count -= 1 if scanner.matched[-1] == finish
|
47
|
-
return [str, scanner.rest] if count == 0
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Formats a string for use in error messages about indentation.
|
52
|
-
#
|
53
|
-
# @param indentation [String] The string used for indentation
|
54
|
-
# @param was [Boolean] Whether or not to add `"was"` or `"were"`
|
55
|
-
# (depending on how many characters were in `indentation`)
|
56
|
-
# @return [String] The name of the indentation (e.g. `"12 spaces"`, `"1 tab"`)
|
57
|
-
def human_indentation(indentation, was = false)
|
58
|
-
if !indentation.include?(?\t)
|
59
|
-
noun = 'space'
|
60
|
-
elsif !indentation.include?(?\s)
|
61
|
-
noun = 'tab'
|
62
|
-
else
|
63
|
-
return indentation.inspect + (was ? ' was' : '')
|
64
|
-
end
|
65
|
-
|
66
|
-
singular = indentation.length == 1
|
67
|
-
if was
|
68
|
-
was = singular ? ' was' : ' were'
|
69
|
-
else
|
70
|
-
was = ''
|
71
|
-
end
|
72
|
-
|
73
|
-
"#{indentation.length} #{noun}#{'s' unless singular}#{was}"
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,213 +0,0 @@
|
|
1
|
-
module Sass::Source
|
2
|
-
class Map
|
3
|
-
# A mapping from one source range to another. Indicates that `input` was
|
4
|
-
# compiled to `output`.
|
5
|
-
#
|
6
|
-
# @!attribute input
|
7
|
-
# @return [Sass::Source::Range] The source range in the input document.
|
8
|
-
#
|
9
|
-
# @!attribute output
|
10
|
-
# @return [Sass::Source::Range] The source range in the output document.
|
11
|
-
class Mapping < Struct.new(:input, :output)
|
12
|
-
# @return [String] A string representation of the mapping.
|
13
|
-
def inspect
|
14
|
-
"#{input.inspect} => #{output.inspect}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# The mapping data ordered by the location in the target.
|
19
|
-
#
|
20
|
-
# @return [Array<Mapping>]
|
21
|
-
attr_reader :data
|
22
|
-
|
23
|
-
def initialize
|
24
|
-
@data = []
|
25
|
-
end
|
26
|
-
|
27
|
-
# Adds a new mapping from one source range to another. Multiple invocations
|
28
|
-
# of this method should have each `output` range come after all previous ranges.
|
29
|
-
#
|
30
|
-
# @param input [Sass::Source::Range]
|
31
|
-
# The source range in the input document.
|
32
|
-
# @param output [Sass::Source::Range]
|
33
|
-
# The source range in the output document.
|
34
|
-
def add(input, output)
|
35
|
-
@data.push(Mapping.new(input, output))
|
36
|
-
end
|
37
|
-
|
38
|
-
# Shifts all output source ranges forward one or more lines.
|
39
|
-
#
|
40
|
-
# @param delta [Integer] The number of lines to shift the ranges forward.
|
41
|
-
def shift_output_lines(delta)
|
42
|
-
return if delta == 0
|
43
|
-
@data.each do |m|
|
44
|
-
m.output.start_pos.line += delta
|
45
|
-
m.output.end_pos.line += delta
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Shifts any output source ranges that lie on the first line forward one or
|
50
|
-
# more characters on that line.
|
51
|
-
#
|
52
|
-
# @param delta [Integer] The number of characters to shift the ranges
|
53
|
-
# forward.
|
54
|
-
def shift_output_offsets(delta)
|
55
|
-
return if delta == 0
|
56
|
-
@data.each do |m|
|
57
|
-
break if m.output.start_pos.line > 1
|
58
|
-
m.output.start_pos.offset += delta
|
59
|
-
m.output.end_pos.offset += delta if m.output.end_pos.line > 1
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# Returns the standard JSON representation of the source map.
|
64
|
-
#
|
65
|
-
# If the `:css_uri` option isn't specified, the `:css_path` and
|
66
|
-
# `:sourcemap_path` options must both be specified. Any options may also be
|
67
|
-
# specified alongside the `:css_uri` option. If `:css_uri` isn't specified,
|
68
|
-
# it will be inferred from `:css_path` and `:sourcemap_path` using the
|
69
|
-
# assumption that the local file system has the same layout as the server.
|
70
|
-
#
|
71
|
-
# Regardless of which options are passed to this method, source stylesheets
|
72
|
-
# that are imported using a non-default importer will only be linked to in
|
73
|
-
# the source map if their importers implement
|
74
|
-
# \{Sass::Importers::Base#public\_url\}.
|
75
|
-
#
|
76
|
-
# @option options :css_uri [String]
|
77
|
-
# The publicly-visible URI of the CSS output file.
|
78
|
-
# @option options :css_path [String]
|
79
|
-
# The local path of the CSS output file.
|
80
|
-
# @option options :sourcemap_path [String]
|
81
|
-
# The (eventual) local path of the sourcemap file.
|
82
|
-
# @option options :type [Symbol]
|
83
|
-
# `:auto` (default), `:file`, or `:inline`.
|
84
|
-
# @return [String] The JSON string.
|
85
|
-
# @raise [ArgumentError] If neither `:css_uri` nor `:css_path` and
|
86
|
-
# `:sourcemap_path` are specified.
|
87
|
-
# @comment
|
88
|
-
# rubocop:disable MethodLength
|
89
|
-
def to_json(options)
|
90
|
-
css_uri, css_path, sourcemap_path =
|
91
|
-
options[:css_uri], options[:css_path], options[:sourcemap_path]
|
92
|
-
unless css_uri || (css_path && sourcemap_path)
|
93
|
-
raise ArgumentError.new("Sass::Source::Map#to_json requires either " \
|
94
|
-
"the :css_uri option or both the :css_path and :soucemap_path options.")
|
95
|
-
end
|
96
|
-
css_path &&= Sass::Util.pathname(Sass::Util.absolute_path(css_path))
|
97
|
-
sourcemap_path &&= Sass::Util.pathname(Sass::Util.absolute_path(sourcemap_path))
|
98
|
-
css_uri ||= Sass::Util.file_uri_from_path(
|
99
|
-
Sass::Util.relative_path_from(css_path, sourcemap_path.dirname))
|
100
|
-
|
101
|
-
result = "{\n"
|
102
|
-
write_json_field(result, "version", 3, true)
|
103
|
-
|
104
|
-
source_uri_to_id = {}
|
105
|
-
id_to_source_uri = {}
|
106
|
-
id_to_contents = {} if options[:type] == :inline
|
107
|
-
next_source_id = 0
|
108
|
-
line_data = []
|
109
|
-
segment_data_for_line = []
|
110
|
-
|
111
|
-
# These track data necessary for the delta coding.
|
112
|
-
previous_target_line = nil
|
113
|
-
previous_target_offset = 1
|
114
|
-
previous_source_line = 1
|
115
|
-
previous_source_offset = 1
|
116
|
-
previous_source_id = 0
|
117
|
-
|
118
|
-
@data.each do |m|
|
119
|
-
file, importer = m.input.file, m.input.importer
|
120
|
-
|
121
|
-
next unless importer
|
122
|
-
|
123
|
-
if options[:type] == :inline
|
124
|
-
source_uri = file
|
125
|
-
else
|
126
|
-
sourcemap_dir = sourcemap_path && sourcemap_path.dirname.to_s
|
127
|
-
sourcemap_dir = nil if options[:type] == :file
|
128
|
-
source_uri = importer.public_url(file, sourcemap_dir)
|
129
|
-
next unless source_uri
|
130
|
-
end
|
131
|
-
|
132
|
-
current_source_id = source_uri_to_id[source_uri]
|
133
|
-
unless current_source_id
|
134
|
-
current_source_id = next_source_id
|
135
|
-
next_source_id += 1
|
136
|
-
|
137
|
-
source_uri_to_id[source_uri] = current_source_id
|
138
|
-
id_to_source_uri[current_source_id] = source_uri
|
139
|
-
|
140
|
-
if options[:type] == :inline
|
141
|
-
id_to_contents[current_source_id] =
|
142
|
-
importer.find(file, {}).instance_variable_get('@template')
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
[
|
147
|
-
[m.input.start_pos, m.output.start_pos],
|
148
|
-
[m.input.end_pos, m.output.end_pos]
|
149
|
-
].each do |source_pos, target_pos|
|
150
|
-
if previous_target_line != target_pos.line
|
151
|
-
line_data.push(segment_data_for_line.join(",")) unless segment_data_for_line.empty?
|
152
|
-
(target_pos.line - 1 - (previous_target_line || 0)).times {line_data.push("")}
|
153
|
-
previous_target_line = target_pos.line
|
154
|
-
previous_target_offset = 1
|
155
|
-
segment_data_for_line = []
|
156
|
-
end
|
157
|
-
|
158
|
-
# `segment` is a data chunk for a single position mapping.
|
159
|
-
segment = ""
|
160
|
-
|
161
|
-
# Field 1: zero-based starting offset.
|
162
|
-
segment << Sass::Util.encode_vlq(target_pos.offset - previous_target_offset)
|
163
|
-
previous_target_offset = target_pos.offset
|
164
|
-
|
165
|
-
# Field 2: zero-based index into the "sources" list.
|
166
|
-
segment << Sass::Util.encode_vlq(current_source_id - previous_source_id)
|
167
|
-
previous_source_id = current_source_id
|
168
|
-
|
169
|
-
# Field 3: zero-based starting line in the original source.
|
170
|
-
segment << Sass::Util.encode_vlq(source_pos.line - previous_source_line)
|
171
|
-
previous_source_line = source_pos.line
|
172
|
-
|
173
|
-
# Field 4: zero-based starting offset in the original source.
|
174
|
-
segment << Sass::Util.encode_vlq(source_pos.offset - previous_source_offset)
|
175
|
-
previous_source_offset = source_pos.offset
|
176
|
-
|
177
|
-
segment_data_for_line.push(segment)
|
178
|
-
|
179
|
-
previous_target_line = target_pos.line
|
180
|
-
end
|
181
|
-
end
|
182
|
-
line_data.push(segment_data_for_line.join(","))
|
183
|
-
write_json_field(result, "mappings", line_data.join(";"))
|
184
|
-
|
185
|
-
source_names = []
|
186
|
-
(0...next_source_id).each {|id| source_names.push(id_to_source_uri[id].to_s)}
|
187
|
-
write_json_field(result, "sources", source_names)
|
188
|
-
|
189
|
-
if options[:type] == :inline
|
190
|
-
write_json_field(result, "sourcesContent",
|
191
|
-
(0...next_source_id).map {|id| id_to_contents[id]})
|
192
|
-
end
|
193
|
-
|
194
|
-
write_json_field(result, "names", [])
|
195
|
-
write_json_field(result, "file", css_uri)
|
196
|
-
|
197
|
-
result << "\n}"
|
198
|
-
result
|
199
|
-
end
|
200
|
-
# @comment
|
201
|
-
# rubocop:enable MethodLength
|
202
|
-
|
203
|
-
private
|
204
|
-
|
205
|
-
def write_json_field(out, name, value, is_first = false)
|
206
|
-
out << (is_first ? "" : ",\n") <<
|
207
|
-
"\"" <<
|
208
|
-
Sass::Util.json_escape_string(name) <<
|
209
|
-
"\": " <<
|
210
|
-
Sass::Util.json_value_of(value)
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Sass::Source
|
2
|
-
class Position
|
3
|
-
# The one-based line of the document associated with the position.
|
4
|
-
#
|
5
|
-
# @return [Integer]
|
6
|
-
attr_accessor :line
|
7
|
-
|
8
|
-
# The one-based offset in the line of the document associated with the
|
9
|
-
# position.
|
10
|
-
#
|
11
|
-
# @return [Integer]
|
12
|
-
attr_accessor :offset
|
13
|
-
|
14
|
-
# @param line [Integer] The source line
|
15
|
-
# @param offset [Integer] The source offset
|
16
|
-
def initialize(line, offset)
|
17
|
-
@line = line
|
18
|
-
@offset = offset
|
19
|
-
end
|
20
|
-
|
21
|
-
# @return [String] A string representation of the source position.
|
22
|
-
def inspect
|
23
|
-
"#{line.inspect}:#{offset.inspect}"
|
24
|
-
end
|
25
|
-
|
26
|
-
# @param str [String] The string to move through.
|
27
|
-
# @return [Position] The source position after proceeding forward through
|
28
|
-
# `str`.
|
29
|
-
def after(str)
|
30
|
-
newlines = str.count("\n")
|
31
|
-
Position.new(line + newlines,
|
32
|
-
if newlines == 0
|
33
|
-
offset + str.length
|
34
|
-
else
|
35
|
-
str.length - str.rindex("\n") - 1
|
36
|
-
end)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Sass::Source
|
2
|
-
class Range
|
3
|
-
# The starting position of the range in the document (inclusive).
|
4
|
-
#
|
5
|
-
# @return [Sass::Source::Position]
|
6
|
-
attr_accessor :start_pos
|
7
|
-
|
8
|
-
# The ending position of the range in the document (exclusive).
|
9
|
-
#
|
10
|
-
# @return [Sass::Source::Position]
|
11
|
-
attr_accessor :end_pos
|
12
|
-
|
13
|
-
# The file in which this source range appears. This can be nil if the file
|
14
|
-
# is unknown or not yet generated.
|
15
|
-
#
|
16
|
-
# @return [String]
|
17
|
-
attr_accessor :file
|
18
|
-
|
19
|
-
# The importer that imported the file in which this source range appears.
|
20
|
-
# This is nil for target ranges.
|
21
|
-
#
|
22
|
-
# @return [Sass::Importers::Base]
|
23
|
-
attr_accessor :importer
|
24
|
-
|
25
|
-
# @param start_pos [Sass::Source::Position] See \{#start_pos}
|
26
|
-
# @param end_pos [Sass::Source::Position] See \{#end_pos}
|
27
|
-
# @param file [String] See \{#file}
|
28
|
-
# @param importer [Sass::Importers::Base] See \{#importer}
|
29
|
-
def initialize(start_pos, end_pos, file, importer = nil)
|
30
|
-
@start_pos = start_pos
|
31
|
-
@end_pos = end_pos
|
32
|
-
@file = file
|
33
|
-
@importer = importer
|
34
|
-
end
|
35
|
-
|
36
|
-
# @return [String] A string representation of the source range.
|
37
|
-
def inspect
|
38
|
-
"(#{start_pos.inspect} to #{end_pos.inspect}#{" in #{@file}" if @file})"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
# A class representing the stack when compiling a Sass file.
|
3
|
-
class Stack
|
4
|
-
# TODO: use this to generate stack information for Sass::SyntaxErrors.
|
5
|
-
|
6
|
-
# A single stack frame.
|
7
|
-
class Frame
|
8
|
-
# The filename of the file in which this stack frame was created.
|
9
|
-
#
|
10
|
-
# @return [String]
|
11
|
-
attr_reader :filename
|
12
|
-
|
13
|
-
# The line number on which this stack frame was created.
|
14
|
-
#
|
15
|
-
# @return [String]
|
16
|
-
attr_reader :line
|
17
|
-
|
18
|
-
# The type of this stack frame. This can be `:import`, `:mixin`, or
|
19
|
-
# `:base`.
|
20
|
-
#
|
21
|
-
# `:base` indicates that this is the bottom-most frame, meaning that it
|
22
|
-
# represents a single line of code rather than a nested context. The stack
|
23
|
-
# will only ever have one base frame, and it will always be the most
|
24
|
-
# deeply-nested frame.
|
25
|
-
#
|
26
|
-
# @return [Symbol?]
|
27
|
-
attr_reader :type
|
28
|
-
|
29
|
-
# The name of the stack frame. For mixin frames, this is the mixin name;
|
30
|
-
# otherwise, it's `nil`.
|
31
|
-
#
|
32
|
-
# @return [String?]
|
33
|
-
attr_reader :name
|
34
|
-
|
35
|
-
def initialize(filename, line, type, name = nil)
|
36
|
-
@filename = filename
|
37
|
-
@line = line
|
38
|
-
@type = type
|
39
|
-
@name = name
|
40
|
-
end
|
41
|
-
|
42
|
-
# Whether this frame represents an import.
|
43
|
-
#
|
44
|
-
# @return [Boolean]
|
45
|
-
def is_import?
|
46
|
-
type == :import
|
47
|
-
end
|
48
|
-
|
49
|
-
# Whether this frame represents a mixin.
|
50
|
-
#
|
51
|
-
# @return [Boolean]
|
52
|
-
def is_mixin?
|
53
|
-
type == :mixin
|
54
|
-
end
|
55
|
-
|
56
|
-
# Whether this is the base frame.
|
57
|
-
#
|
58
|
-
# @return [Boolean]
|
59
|
-
def is_base?
|
60
|
-
type == :base
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# The stack frames. The last frame is the most deeply-nested.
|
65
|
-
#
|
66
|
-
# @return [Array<Frame>]
|
67
|
-
attr_reader :frames
|
68
|
-
|
69
|
-
def initialize
|
70
|
-
@frames = []
|
71
|
-
end
|
72
|
-
|
73
|
-
# Pushes a base frame onto the stack.
|
74
|
-
#
|
75
|
-
# @param filename [String] See \{Frame#filename}.
|
76
|
-
# @param line [String] See \{Frame#line}.
|
77
|
-
# @yield [] A block in which the new frame is on the stack.
|
78
|
-
def with_base(filename, line)
|
79
|
-
with_frame(filename, line, :base) {yield}
|
80
|
-
end
|
81
|
-
|
82
|
-
# Pushes an import frame onto the stack.
|
83
|
-
#
|
84
|
-
# @param filename [String] See \{Frame#filename}.
|
85
|
-
# @param line [String] See \{Frame#line}.
|
86
|
-
# @yield [] A block in which the new frame is on the stack.
|
87
|
-
def with_import(filename, line)
|
88
|
-
with_frame(filename, line, :import) {yield}
|
89
|
-
end
|
90
|
-
|
91
|
-
# Pushes a mixin frame onto the stack.
|
92
|
-
#
|
93
|
-
# @param filename [String] See \{Frame#filename}.
|
94
|
-
# @param line [String] See \{Frame#line}.
|
95
|
-
# @param name [String] See \{Frame#name}.
|
96
|
-
# @yield [] A block in which the new frame is on the stack.
|
97
|
-
def with_mixin(filename, line, name)
|
98
|
-
with_frame(filename, line, :mixin, name) {yield}
|
99
|
-
end
|
100
|
-
|
101
|
-
def to_s
|
102
|
-
Sass::Util.enum_with_index(Sass::Util.enum_cons(frames.reverse + [nil], 2)).
|
103
|
-
map do |(frame, caller), i|
|
104
|
-
"#{i == 0 ? 'on' : 'from'} line #{frame.line}" +
|
105
|
-
" of #{frame.filename || 'an unknown file'}" +
|
106
|
-
(caller && caller.name ? ", in `#{caller.name}'" : "")
|
107
|
-
end.join("\n")
|
108
|
-
end
|
109
|
-
|
110
|
-
private
|
111
|
-
|
112
|
-
def with_frame(filename, line, type, name = nil)
|
113
|
-
@frames.pop if @frames.last && @frames.last.type == :base
|
114
|
-
@frames.push(Frame.new(filename, line, type, name))
|
115
|
-
yield
|
116
|
-
ensure
|
117
|
-
@frames.pop unless type == :base && @frames.last && @frames.last.type != :base
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|