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,117 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
module Selector
|
3
|
-
# The abstract superclass for simple selectors
|
4
|
-
# (that is, those that don't compose multiple selectors).
|
5
|
-
class Simple
|
6
|
-
# The line of the Sass template on which this selector was declared.
|
7
|
-
#
|
8
|
-
# @return [Integer]
|
9
|
-
attr_accessor :line
|
10
|
-
|
11
|
-
# The name of the file in which this selector was declared,
|
12
|
-
# or `nil` if it was not declared in a file (e.g. on stdin).
|
13
|
-
#
|
14
|
-
# @return [String, nil]
|
15
|
-
attr_accessor :filename
|
16
|
-
|
17
|
-
# @see #to_s
|
18
|
-
#
|
19
|
-
# @return [String]
|
20
|
-
def inspect
|
21
|
-
to_s
|
22
|
-
end
|
23
|
-
|
24
|
-
# Returns the selector string.
|
25
|
-
#
|
26
|
-
# @param opts [Hash] rendering options.
|
27
|
-
# @option opts [Symbol] :style The css rendering style.
|
28
|
-
# @return [String]
|
29
|
-
def to_s(opts = {})
|
30
|
-
Sass::Util.abstract(self)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Returns a hash code for this selector object.
|
34
|
-
#
|
35
|
-
# By default, this is based on the value of \{#to\_a},
|
36
|
-
# so if that contains information irrelevant to the identity of the selector,
|
37
|
-
# this should be overridden.
|
38
|
-
#
|
39
|
-
# @return [Integer]
|
40
|
-
def hash
|
41
|
-
@_hash ||= equality_key.hash
|
42
|
-
end
|
43
|
-
|
44
|
-
# Checks equality between this and another object.
|
45
|
-
#
|
46
|
-
# By default, this is based on the value of \{#to\_a},
|
47
|
-
# so if that contains information irrelevant to the identity of the selector,
|
48
|
-
# this should be overridden.
|
49
|
-
#
|
50
|
-
# @param other [Object] The object to test equality against
|
51
|
-
# @return [Boolean] Whether or not this is equal to `other`
|
52
|
-
def eql?(other)
|
53
|
-
other.class == self.class && other.hash == hash && other.equality_key == equality_key
|
54
|
-
end
|
55
|
-
alias_method :==, :eql?
|
56
|
-
|
57
|
-
# Unifies this selector with a {SimpleSequence}'s {SimpleSequence#members members array},
|
58
|
-
# returning another `SimpleSequence` members array
|
59
|
-
# that matches both this selector and the input selector.
|
60
|
-
#
|
61
|
-
# By default, this just appends this selector to the end of the array
|
62
|
-
# (or returns the original array if this selector already exists in it).
|
63
|
-
#
|
64
|
-
# @param sels [Array<Simple>] A {SimpleSequence}'s {SimpleSequence#members members array}
|
65
|
-
# @return [Array<Simple>, nil] A {SimpleSequence} {SimpleSequence#members members array}
|
66
|
-
# matching both `sels` and this selector,
|
67
|
-
# or `nil` if this is impossible (e.g. unifying `#foo` and `#bar`)
|
68
|
-
# @raise [Sass::SyntaxError] If this selector cannot be unified.
|
69
|
-
# This will only ever occur when a dynamic selector,
|
70
|
-
# such as {Parent} or {Interpolation}, is used in unification.
|
71
|
-
# Since these selectors should be resolved
|
72
|
-
# by the time extension and unification happen,
|
73
|
-
# this exception will only ever be raised as a result of programmer error
|
74
|
-
def unify(sels)
|
75
|
-
return sels.first.unify([self]) if sels.length == 1 && sels.first.is_a?(Universal)
|
76
|
-
return sels if sels.any? {|sel2| eql?(sel2)}
|
77
|
-
sels_with_ix = Sass::Util.enum_with_index(sels)
|
78
|
-
if !is_a?(Pseudo) || (sels.last.is_a?(Pseudo) && sels.last.type == :element)
|
79
|
-
_, i = sels_with_ix.find {|sel, _| sel.is_a?(Pseudo)}
|
80
|
-
end
|
81
|
-
return sels + [self] unless i
|
82
|
-
sels[0...i] + [self] + sels[i..-1]
|
83
|
-
end
|
84
|
-
|
85
|
-
protected
|
86
|
-
|
87
|
-
# Returns the key used for testing whether selectors are equal.
|
88
|
-
#
|
89
|
-
# This is a cached version of \{#to\_s}.
|
90
|
-
#
|
91
|
-
# @return [String]
|
92
|
-
def equality_key
|
93
|
-
@equality_key ||= to_s
|
94
|
-
end
|
95
|
-
|
96
|
-
# Unifies two namespaces,
|
97
|
-
# returning a namespace that works for both of them if possible.
|
98
|
-
#
|
99
|
-
# @param ns1 [String, nil] The first namespace.
|
100
|
-
# `nil` means none specified, e.g. `foo`.
|
101
|
-
# The empty string means no namespace specified, e.g. `|foo`.
|
102
|
-
# `"*"` means any namespace is allowed, e.g. `*|foo`.
|
103
|
-
# @param ns2 [String, nil] The second namespace. See `ns1`.
|
104
|
-
# @return [Array(String or nil, Boolean)]
|
105
|
-
# The first value is the unified namespace, or `nil` for no namespace.
|
106
|
-
# The second value is whether or not a namespace that works for both inputs
|
107
|
-
# could be found at all.
|
108
|
-
# If the second value is `false`, the first should be ignored.
|
109
|
-
def unify_namespaces(ns1, ns2)
|
110
|
-
return ns2, true if ns1 == '*'
|
111
|
-
return ns1, true if ns2 == '*'
|
112
|
-
return nil, false unless ns1 == ns2
|
113
|
-
[ns1, true]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
@@ -1,344 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
module Selector
|
3
|
-
# A unseparated sequence of selectors
|
4
|
-
# that all apply to a single element.
|
5
|
-
# For example, `.foo#bar[attr=baz]` is a simple sequence
|
6
|
-
# of the selectors `.foo`, `#bar`, and `[attr=baz]`.
|
7
|
-
class SimpleSequence < AbstractSequence
|
8
|
-
# The array of individual selectors.
|
9
|
-
#
|
10
|
-
# @return [Array<Simple>]
|
11
|
-
attr_accessor :members
|
12
|
-
|
13
|
-
# The extending selectors that caused this selector sequence to be
|
14
|
-
# generated. For example:
|
15
|
-
#
|
16
|
-
# a.foo { ... }
|
17
|
-
# b.bar {@extend a}
|
18
|
-
# c.baz {@extend b}
|
19
|
-
#
|
20
|
-
# The generated selector `b.foo.bar` has `{b.bar}` as its `sources` set,
|
21
|
-
# and the generated selector `c.foo.bar.baz` has `{b.bar, c.baz}` as its
|
22
|
-
# `sources` set.
|
23
|
-
#
|
24
|
-
# This is populated during the {Sequence#do_extend} process.
|
25
|
-
#
|
26
|
-
# @return {Set<Sequence>}
|
27
|
-
attr_accessor :sources
|
28
|
-
|
29
|
-
# This sequence source range.
|
30
|
-
#
|
31
|
-
# @return [Sass::Source::Range]
|
32
|
-
attr_accessor :source_range
|
33
|
-
|
34
|
-
# @see \{#subject?}
|
35
|
-
attr_writer :subject
|
36
|
-
|
37
|
-
# Returns the element or universal selector in this sequence,
|
38
|
-
# if it exists.
|
39
|
-
#
|
40
|
-
# @return [Element, Universal, nil]
|
41
|
-
def base
|
42
|
-
@base ||= (members.first if members.first.is_a?(Element) || members.first.is_a?(Universal))
|
43
|
-
end
|
44
|
-
|
45
|
-
def pseudo_elements
|
46
|
-
@pseudo_elements ||= members.select {|sel| sel.is_a?(Pseudo) && sel.type == :element}
|
47
|
-
end
|
48
|
-
|
49
|
-
def selector_pseudo_classes
|
50
|
-
@selector_pseudo_classes ||= members.
|
51
|
-
select {|sel| sel.is_a?(Pseudo) && sel.type == :class && sel.selector}.
|
52
|
-
group_by {|sel| sel.normalized_name}
|
53
|
-
end
|
54
|
-
|
55
|
-
# Returns the non-base, non-pseudo-element selectors in this sequence.
|
56
|
-
#
|
57
|
-
# @return [Set<Simple>]
|
58
|
-
def rest
|
59
|
-
@rest ||= Set.new(members - [base] - pseudo_elements)
|
60
|
-
end
|
61
|
-
|
62
|
-
# Whether or not this compound selector is the subject of the parent
|
63
|
-
# selector; that is, whether it is prepended with `$` and represents the
|
64
|
-
# actual element that will be selected.
|
65
|
-
#
|
66
|
-
# @return [Boolean]
|
67
|
-
def subject?
|
68
|
-
@subject
|
69
|
-
end
|
70
|
-
|
71
|
-
# @param selectors [Array<Simple>] See \{#members}
|
72
|
-
# @param subject [Boolean] See \{#subject?}
|
73
|
-
# @param source_range [Sass::Source::Range]
|
74
|
-
def initialize(selectors, subject, source_range = nil)
|
75
|
-
@members = selectors
|
76
|
-
@subject = subject
|
77
|
-
@sources = Set.new
|
78
|
-
@source_range = source_range
|
79
|
-
end
|
80
|
-
|
81
|
-
# Resolves the {Parent} selectors within this selector
|
82
|
-
# by replacing them with the given parent selector,
|
83
|
-
# handling commas appropriately.
|
84
|
-
#
|
85
|
-
# @param super_cseq [CommaSequence] The parent selector
|
86
|
-
# @return [CommaSequence] This selector, with parent references resolved
|
87
|
-
# @raise [Sass::SyntaxError] If a parent selector is invalid
|
88
|
-
def resolve_parent_refs(super_cseq)
|
89
|
-
resolved_members = @members.map do |sel|
|
90
|
-
next sel unless sel.is_a?(Pseudo) && sel.selector
|
91
|
-
sel.with_selector(sel.selector.resolve_parent_refs(super_cseq, false))
|
92
|
-
end.flatten
|
93
|
-
|
94
|
-
# Parent selector only appears as the first selector in the sequence
|
95
|
-
unless (parent = resolved_members.first).is_a?(Parent)
|
96
|
-
return CommaSequence.new([Sequence.new([SimpleSequence.new(resolved_members, subject?)])])
|
97
|
-
end
|
98
|
-
|
99
|
-
return super_cseq if @members.size == 1 && parent.suffix.nil?
|
100
|
-
|
101
|
-
CommaSequence.new(super_cseq.members.map do |super_seq|
|
102
|
-
members = super_seq.members.dup
|
103
|
-
newline = members.pop if members.last == "\n"
|
104
|
-
unless members.last.is_a?(SimpleSequence)
|
105
|
-
raise Sass::SyntaxError.new("Invalid parent selector for \"#{self}\": \"" +
|
106
|
-
super_seq.to_s + '"')
|
107
|
-
end
|
108
|
-
|
109
|
-
parent_sub = members.last.members
|
110
|
-
unless parent.suffix.nil?
|
111
|
-
parent_sub = parent_sub.dup
|
112
|
-
parent_sub[-1] = parent_sub.last.dup
|
113
|
-
case parent_sub.last
|
114
|
-
when Sass::Selector::Class, Sass::Selector::Id, Sass::Selector::Placeholder
|
115
|
-
parent_sub[-1] = parent_sub.last.class.new(parent_sub.last.name + parent.suffix)
|
116
|
-
when Sass::Selector::Element
|
117
|
-
parent_sub[-1] = parent_sub.last.class.new(
|
118
|
-
parent_sub.last.name + parent.suffix,
|
119
|
-
parent_sub.last.namespace)
|
120
|
-
when Sass::Selector::Pseudo
|
121
|
-
if parent_sub.last.arg || parent_sub.last.selector
|
122
|
-
raise Sass::SyntaxError.new("Invalid parent selector for \"#{self}\": \"" +
|
123
|
-
super_seq.to_s + '"')
|
124
|
-
end
|
125
|
-
parent_sub[-1] = Sass::Selector::Pseudo.new(
|
126
|
-
parent_sub.last.type,
|
127
|
-
parent_sub.last.name + parent.suffix,
|
128
|
-
nil, nil)
|
129
|
-
else
|
130
|
-
raise Sass::SyntaxError.new("Invalid parent selector for \"#{self}\": \"" +
|
131
|
-
super_seq.to_s + '"')
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
Sequence.new(members[0...-1] +
|
136
|
-
[SimpleSequence.new(parent_sub + resolved_members[1..-1], subject?)] +
|
137
|
-
[newline].compact)
|
138
|
-
end)
|
139
|
-
end
|
140
|
-
|
141
|
-
# Non-destructively extends this selector with the extensions specified in a hash
|
142
|
-
# (which should come from {Sass::Tree::Visitors::Cssize}).
|
143
|
-
#
|
144
|
-
# @param extends [{Selector::Simple =>
|
145
|
-
# Sass::Tree::Visitors::Cssize::Extend}]
|
146
|
-
# The extensions to perform on this selector
|
147
|
-
# @param parent_directives [Array<Sass::Tree::DirectiveNode>]
|
148
|
-
# The directives containing this selector.
|
149
|
-
# @param seen [Set<Array<Selector::Simple>>]
|
150
|
-
# The set of simple sequences that are currently being replaced.
|
151
|
-
# @param original [Boolean]
|
152
|
-
# Whether this is the original selector being extended, as opposed to
|
153
|
-
# the result of a previous extension that's being re-extended.
|
154
|
-
# @return [Array<Sequence>] A list of selectors generated
|
155
|
-
# by extending this selector with `extends`.
|
156
|
-
# @see CommaSequence#do_extend
|
157
|
-
def do_extend(extends, parent_directives, replace, seen)
|
158
|
-
seen_with_pseudo_selectors = seen.dup
|
159
|
-
|
160
|
-
modified_original = false
|
161
|
-
members = self.members.map do |sel|
|
162
|
-
next sel unless sel.is_a?(Pseudo) && sel.selector
|
163
|
-
next sel if seen.include?([sel])
|
164
|
-
extended = sel.selector.do_extend(extends, parent_directives, replace, seen, false)
|
165
|
-
next sel if extended == sel.selector
|
166
|
-
extended.members.reject! {|seq| seq.has_placeholder?}
|
167
|
-
|
168
|
-
# For `:not()`, we usually want to get rid of any complex
|
169
|
-
# selectors because that will cause the selector to fail to
|
170
|
-
# parse on all browsers at time of writing. We can keep them
|
171
|
-
# if either the original selector had a complex selector, or
|
172
|
-
# the result of extending has only complex selectors,
|
173
|
-
# because either way we aren't breaking anything that isn't
|
174
|
-
# already broken.
|
175
|
-
if sel.normalized_name == 'not' &&
|
176
|
-
(sel.selector.members.none? {|seq| seq.members.length > 1} &&
|
177
|
-
extended.members.any? {|seq| seq.members.length == 1})
|
178
|
-
extended.members.reject! {|seq| seq.members.length > 1}
|
179
|
-
end
|
180
|
-
|
181
|
-
modified_original = true
|
182
|
-
result = sel.with_selector(extended)
|
183
|
-
result.each {|new_sel| seen_with_pseudo_selectors << [new_sel]}
|
184
|
-
result
|
185
|
-
end.flatten
|
186
|
-
|
187
|
-
groups = Sass::Util.group_by_to_a(extends[members.to_set]) {|ex| ex.extender}
|
188
|
-
groups.map! do |seq, group|
|
189
|
-
sels = group.map {|e| e.target}.flatten
|
190
|
-
# If A {@extend B} and C {...},
|
191
|
-
# seq is A, sels is B, and self is C
|
192
|
-
|
193
|
-
self_without_sel = Sass::Util.array_minus(members, sels)
|
194
|
-
group.each {|e| e.result = :failed_to_unify unless e.result == :succeeded}
|
195
|
-
unified = seq.members.last.unify(SimpleSequence.new(self_without_sel, subject?))
|
196
|
-
next unless unified
|
197
|
-
group.each {|e| e.result = :succeeded}
|
198
|
-
group.each {|e| check_directives_match!(e, parent_directives)}
|
199
|
-
new_seq = Sequence.new(seq.members[0...-1] + [unified])
|
200
|
-
new_seq.add_sources!(sources + [seq])
|
201
|
-
[sels, new_seq]
|
202
|
-
end
|
203
|
-
groups.compact!
|
204
|
-
groups.map! do |sels, seq|
|
205
|
-
next [] if seen.include?(sels)
|
206
|
-
seq.do_extend(
|
207
|
-
extends, parent_directives, false, seen_with_pseudo_selectors + [sels], false)
|
208
|
-
end
|
209
|
-
groups.flatten!
|
210
|
-
|
211
|
-
if modified_original || !replace || groups.empty?
|
212
|
-
# First Law of Extend: the result of extending a selector should
|
213
|
-
# (almost) always contain the base selector.
|
214
|
-
#
|
215
|
-
# See https://github.com/nex3/sass/issues/324.
|
216
|
-
original = Sequence.new([SimpleSequence.new(members, @subject, source_range)])
|
217
|
-
original.add_sources! sources
|
218
|
-
groups.unshift original
|
219
|
-
end
|
220
|
-
groups.uniq!
|
221
|
-
groups
|
222
|
-
end
|
223
|
-
|
224
|
-
# Unifies this selector with another {SimpleSequence}, returning
|
225
|
-
# another `SimpleSequence` that is a subselector of both input
|
226
|
-
# selectors.
|
227
|
-
#
|
228
|
-
# @param other [SimpleSequence]
|
229
|
-
# @return [SimpleSequence, nil] A {SimpleSequence} matching both `sels` and this selector,
|
230
|
-
# or `nil` if this is impossible (e.g. unifying `#foo` and `#bar`)
|
231
|
-
# @raise [Sass::SyntaxError] If this selector cannot be unified.
|
232
|
-
# This will only ever occur when a dynamic selector,
|
233
|
-
# such as {Parent} or {Interpolation}, is used in unification.
|
234
|
-
# Since these selectors should be resolved
|
235
|
-
# by the time extension and unification happen,
|
236
|
-
# this exception will only ever be raised as a result of programmer error
|
237
|
-
def unify(other)
|
238
|
-
sseq = members.inject(other.members) do |member, sel|
|
239
|
-
return unless member
|
240
|
-
sel.unify(member)
|
241
|
-
end
|
242
|
-
return unless sseq
|
243
|
-
SimpleSequence.new(sseq, other.subject? || subject?)
|
244
|
-
end
|
245
|
-
|
246
|
-
# Returns whether or not this selector matches all elements
|
247
|
-
# that the given selector matches (as well as possibly more).
|
248
|
-
#
|
249
|
-
# @example
|
250
|
-
# (.foo).superselector?(.foo.bar) #=> true
|
251
|
-
# (.foo).superselector?(.bar) #=> false
|
252
|
-
# @param their_sseq [SimpleSequence]
|
253
|
-
# @param parents [Array<SimpleSequence, String>] The parent selectors of `their_sseq`, if any.
|
254
|
-
# @return [Boolean]
|
255
|
-
def superselector?(their_sseq, parents = [])
|
256
|
-
return false unless base.nil? || base.eql?(their_sseq.base)
|
257
|
-
return false unless pseudo_elements.eql?(their_sseq.pseudo_elements)
|
258
|
-
our_spcs = selector_pseudo_classes
|
259
|
-
their_spcs = their_sseq.selector_pseudo_classes
|
260
|
-
|
261
|
-
# Some psuedo-selectors can be subselectors of non-pseudo selectors.
|
262
|
-
# Pull those out here so we can efficiently check against them below.
|
263
|
-
their_subselector_pseudos = %w(matches any nth-child nth-last-child).
|
264
|
-
map {|name| their_spcs[name] || []}.flatten
|
265
|
-
|
266
|
-
# If `self`'s non-pseudo simple selectors aren't a subset of `their_sseq`'s,
|
267
|
-
# it's definitely not a superselector. This also considers being matched
|
268
|
-
# by `:matches` or `:any`.
|
269
|
-
return false unless rest.all? do |our_sel|
|
270
|
-
next true if our_sel.is_a?(Pseudo) && our_sel.selector
|
271
|
-
next true if their_sseq.rest.include?(our_sel)
|
272
|
-
their_subselector_pseudos.any? do |their_pseudo|
|
273
|
-
their_pseudo.selector.members.all? do |their_seq|
|
274
|
-
next false unless their_seq.members.length == 1
|
275
|
-
their_sseq = their_seq.members.first
|
276
|
-
next false unless their_sseq.is_a?(SimpleSequence)
|
277
|
-
their_sseq.rest.include?(our_sel)
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
|
-
our_spcs.all? do |_name, pseudos|
|
283
|
-
pseudos.all? {|pseudo| pseudo.superselector?(their_sseq, parents)}
|
284
|
-
end
|
285
|
-
end
|
286
|
-
|
287
|
-
# @see Simple#to_s
|
288
|
-
def to_s(opts = {})
|
289
|
-
res = @members.map {|m| m.to_s(opts)}.join
|
290
|
-
res << '!' if subject?
|
291
|
-
res
|
292
|
-
end
|
293
|
-
|
294
|
-
# Returns a string representation of the sequence.
|
295
|
-
# This is basically the selector string.
|
296
|
-
#
|
297
|
-
# @return [String]
|
298
|
-
def inspect
|
299
|
-
res = members.map {|m| m.inspect}.join
|
300
|
-
res << '!' if subject?
|
301
|
-
res
|
302
|
-
end
|
303
|
-
|
304
|
-
# Return a copy of this simple sequence with `sources` merged into the
|
305
|
-
# {SimpleSequence#sources} set.
|
306
|
-
#
|
307
|
-
# @param sources [Set<Sequence>]
|
308
|
-
# @return [SimpleSequence]
|
309
|
-
def with_more_sources(sources)
|
310
|
-
sseq = dup
|
311
|
-
sseq.members = members.dup
|
312
|
-
sseq.sources = self.sources | sources
|
313
|
-
sseq
|
314
|
-
end
|
315
|
-
|
316
|
-
private
|
317
|
-
|
318
|
-
def check_directives_match!(extend, parent_directives)
|
319
|
-
dirs1 = extend.directives.map {|d| d.resolved_value}
|
320
|
-
dirs2 = parent_directives.map {|d| d.resolved_value}
|
321
|
-
return if Sass::Util.subsequence?(dirs1, dirs2)
|
322
|
-
line = extend.node.line
|
323
|
-
filename = extend.node.filename
|
324
|
-
|
325
|
-
# TODO(nweiz): this should use the Sass stack trace of the extend node,
|
326
|
-
# not the selector.
|
327
|
-
raise Sass::SyntaxError.new(<<MESSAGE)
|
328
|
-
You may not @extend an outer selector from within #{extend.directives.last.name}.
|
329
|
-
You may only @extend selectors within the same directive.
|
330
|
-
From "@extend #{extend.target.join(', ')}" on line #{line}#{" of #{filename}" if filename}.
|
331
|
-
MESSAGE
|
332
|
-
end
|
333
|
-
|
334
|
-
def _hash
|
335
|
-
[base, rest.hash].hash
|
336
|
-
end
|
337
|
-
|
338
|
-
def _eql?(other)
|
339
|
-
other.base.eql?(base) && other.pseudo_elements == pseudo_elements &&
|
340
|
-
other.rest.eql?(rest) && other.subject? == subject?
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
end
|