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,272 +0,0 @@
|
|
1
|
-
module Sass::Script::Value
|
2
|
-
# Provides helper functions for creating sass values from within ruby methods.
|
3
|
-
# @since `3.3.0`
|
4
|
-
# @comment
|
5
|
-
# rubocop:disable ModuleLength
|
6
|
-
module Helpers
|
7
|
-
# Construct a Sass Boolean.
|
8
|
-
#
|
9
|
-
# @param value [Object] A ruby object that will be tested for truthiness.
|
10
|
-
# @return [Sass::Script::Value::Bool] whether the ruby value is truthy.
|
11
|
-
def bool(value)
|
12
|
-
Bool.new(value)
|
13
|
-
end
|
14
|
-
|
15
|
-
# Construct a Sass Color from a hex color string.
|
16
|
-
#
|
17
|
-
# @param value [::String] A string representing a hex color.
|
18
|
-
# The leading hash ("#") is optional.
|
19
|
-
# @param alpha [::Number] The alpha channel. A number between 0 and 1.
|
20
|
-
# @return [Sass::Script::Value::Color] the color object
|
21
|
-
def hex_color(value, alpha = nil)
|
22
|
-
Color.from_hex(value, alpha)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Construct a Sass Color from hsl values.
|
26
|
-
#
|
27
|
-
# @param hue [::Number] The hue of the color in degrees.
|
28
|
-
# A non-negative number, usually less than 360.
|
29
|
-
# @param saturation [::Number] The saturation of the color.
|
30
|
-
# Must be between 0 and 100 inclusive.
|
31
|
-
# @param lightness [::Number] The lightness of the color.
|
32
|
-
# Must be between 0 and 100 inclusive.
|
33
|
-
# @param alpha [::Number] The alpha channel. A number between 0 and 1.
|
34
|
-
#
|
35
|
-
# @return [Sass::Script::Value::Color] the color object
|
36
|
-
def hsl_color(hue, saturation, lightness, alpha = nil)
|
37
|
-
attrs = {:hue => hue, :saturation => saturation, :lightness => lightness}
|
38
|
-
attrs[:alpha] = alpha if alpha
|
39
|
-
Color.new(attrs)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Construct a Sass Color from rgb values.
|
43
|
-
#
|
44
|
-
# @param red [::Number] The red component. Must be between 0 and 255 inclusive.
|
45
|
-
# @param green [::Number] The green component. Must be between 0 and 255 inclusive.
|
46
|
-
# @param blue [::Number] The blue component. Must be between 0 and 255 inclusive.
|
47
|
-
# @param alpha [::Number] The alpha channel. A number between 0 and 1.
|
48
|
-
#
|
49
|
-
# @return [Sass::Script::Value::Color] the color object
|
50
|
-
def rgb_color(red, green, blue, alpha = nil)
|
51
|
-
attrs = {:red => red, :green => green, :blue => blue}
|
52
|
-
attrs[:alpha] = alpha if alpha
|
53
|
-
Color.new(attrs)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Construct a Sass Number from a ruby number.
|
57
|
-
#
|
58
|
-
# @param number [::Number] A numeric value.
|
59
|
-
# @param unit_string [::String] A unit string of the form
|
60
|
-
# `numeral_unit1 * numeral_unit2 ... / denominator_unit1 * denominator_unit2 ...`
|
61
|
-
# this is the same format that is returned by
|
62
|
-
# {Sass::Script::Value::Number#unit_str the `unit_str` method}
|
63
|
-
#
|
64
|
-
# @see Sass::Script::Value::Number#unit_str
|
65
|
-
#
|
66
|
-
# @return [Sass::Script::Value::Number] The sass number representing the given ruby number.
|
67
|
-
def number(number, unit_string = nil)
|
68
|
-
Number.new(number, *parse_unit_string(unit_string))
|
69
|
-
end
|
70
|
-
|
71
|
-
# @overload list(*elements, separator)
|
72
|
-
# Create a space-separated list from the arguments given.
|
73
|
-
# @param elements [Array<Sass::Script::Value::Base>] Each argument will be a list element.
|
74
|
-
# @param separator [Symbol] Either :space or :comma.
|
75
|
-
# @return [Sass::Script::Value::List] The space separated list.
|
76
|
-
#
|
77
|
-
# @overload list(array, separator)
|
78
|
-
# Create a space-separated list from the array given.
|
79
|
-
# @param array [Array<Sass::Script::Value::Base>] A ruby array of Sass values
|
80
|
-
# to make into a list.
|
81
|
-
# @return [Sass::Script::Value::List] The space separated list.
|
82
|
-
def list(*elements)
|
83
|
-
unless elements.last.is_a?(Symbol)
|
84
|
-
raise ArgumentError.new("A list type of :space or :comma must be specified.")
|
85
|
-
end
|
86
|
-
separator = elements.pop
|
87
|
-
if elements.size == 1 && elements.first.is_a?(Array)
|
88
|
-
elements = elements.first
|
89
|
-
end
|
90
|
-
Sass::Script::Value::List.new(elements, separator)
|
91
|
-
end
|
92
|
-
|
93
|
-
# Construct a Sass map.
|
94
|
-
#
|
95
|
-
# @param hash [Hash<Sass::Script::Value::Base,
|
96
|
-
# Sass::Script::Value::Base>] A Ruby map to convert to a Sass map.
|
97
|
-
# @return [Sass::Script::Value::Map] The map.
|
98
|
-
def map(hash)
|
99
|
-
Map.new(hash)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Create a sass null value.
|
103
|
-
#
|
104
|
-
# @return [Sass::Script::Value::Null]
|
105
|
-
def null
|
106
|
-
Sass::Script::Value::Null.new
|
107
|
-
end
|
108
|
-
|
109
|
-
# Create a quoted string.
|
110
|
-
#
|
111
|
-
# @param str [::String] A ruby string.
|
112
|
-
# @return [Sass::Script::Value::String] A quoted string.
|
113
|
-
def quoted_string(str)
|
114
|
-
Sass::Script::String.new(str, :string)
|
115
|
-
end
|
116
|
-
|
117
|
-
# Create an unquoted string.
|
118
|
-
#
|
119
|
-
# @param str [::String] A ruby string.
|
120
|
-
# @return [Sass::Script::Value::String] An unquoted string.
|
121
|
-
def unquoted_string(str)
|
122
|
-
Sass::Script::String.new(str, :identifier)
|
123
|
-
end
|
124
|
-
alias_method :identifier, :unquoted_string
|
125
|
-
|
126
|
-
# Parses a user-provided selector.
|
127
|
-
#
|
128
|
-
# @param value [Sass::Script::Value::String, Sass::Script::Value::List]
|
129
|
-
# The selector to parse. This can be either a string, a list of
|
130
|
-
# strings, or a list of lists of strings as returned by `&`.
|
131
|
-
# @param name [Symbol, nil]
|
132
|
-
# If provided, the name of the selector argument. This is used
|
133
|
-
# for error reporting.
|
134
|
-
# @param allow_parent_ref [Boolean]
|
135
|
-
# Whether the parsed selector should allow parent references.
|
136
|
-
# @return [Sass::Selector::CommaSequence] The parsed selector.
|
137
|
-
# @throw [ArgumentError] if the parse failed for any reason.
|
138
|
-
def parse_selector(value, name = nil, allow_parent_ref = false)
|
139
|
-
str = normalize_selector(value, name)
|
140
|
-
begin
|
141
|
-
Sass::SCSS::StaticParser.new(str, nil, nil, 1, 1, allow_parent_ref).parse_selector
|
142
|
-
rescue Sass::SyntaxError => e
|
143
|
-
err = "#{value.inspect} is not a valid selector: #{e}"
|
144
|
-
err = "$#{name.to_s.tr('_', '-')}: #{err}" if name
|
145
|
-
raise ArgumentError.new(err)
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
# Parses a user-provided complex selector.
|
150
|
-
#
|
151
|
-
# A complex selector can contain combinators but cannot contain commas.
|
152
|
-
#
|
153
|
-
# @param value [Sass::Script::Value::String, Sass::Script::Value::List]
|
154
|
-
# The selector to parse. This can be either a string or a list of
|
155
|
-
# strings.
|
156
|
-
# @param name [Symbol, nil]
|
157
|
-
# If provided, the name of the selector argument. This is used
|
158
|
-
# for error reporting.
|
159
|
-
# @param allow_parent_ref [Boolean]
|
160
|
-
# Whether the parsed selector should allow parent references.
|
161
|
-
# @return [Sass::Selector::Sequence] The parsed selector.
|
162
|
-
# @throw [ArgumentError] if the parse failed for any reason.
|
163
|
-
def parse_complex_selector(value, name = nil, allow_parent_ref = false)
|
164
|
-
selector = parse_selector(value, name, allow_parent_ref)
|
165
|
-
return seq if selector.members.length == 1
|
166
|
-
|
167
|
-
err = "#{value.inspect} is not a complex selector"
|
168
|
-
err = "$#{name.to_s.tr('_', '-')}: #{err}" if name
|
169
|
-
raise ArgumentError.new(err)
|
170
|
-
end
|
171
|
-
|
172
|
-
# Parses a user-provided compound selector.
|
173
|
-
#
|
174
|
-
# A compound selector cannot contain combinators or commas.
|
175
|
-
#
|
176
|
-
# @param value [Sass::Script::Value::String] The selector to parse.
|
177
|
-
# @param name [Symbol, nil]
|
178
|
-
# If provided, the name of the selector argument. This is used
|
179
|
-
# for error reporting.
|
180
|
-
# @param allow_parent_ref [Boolean]
|
181
|
-
# Whether the parsed selector should allow parent references.
|
182
|
-
# @return [Sass::Selector::SimpleSequence] The parsed selector.
|
183
|
-
# @throw [ArgumentError] if the parse failed for any reason.
|
184
|
-
def parse_compound_selector(value, name = nil, allow_parent_ref = false)
|
185
|
-
assert_type value, :String, name
|
186
|
-
selector = parse_selector(value, name, allow_parent_ref)
|
187
|
-
seq = selector.members.first
|
188
|
-
sseq = seq.members.first
|
189
|
-
if selector.members.length == 1 && seq.members.length == 1 &&
|
190
|
-
sseq.is_a?(Sass::Selector::SimpleSequence)
|
191
|
-
return sseq
|
192
|
-
end
|
193
|
-
|
194
|
-
err = "#{value.inspect} is not a compound selector"
|
195
|
-
err = "$#{name.to_s.tr('_', '-')}: #{err}" if name
|
196
|
-
raise ArgumentError.new(err)
|
197
|
-
end
|
198
|
-
|
199
|
-
# Returns true when the literal is a string containing a calc()
|
200
|
-
#
|
201
|
-
# @param literal [Sass::Script::Value::Base] The value to check
|
202
|
-
# @return boolean
|
203
|
-
def calc?(literal)
|
204
|
-
literal.is_a?(Sass::Script::Value::String) && literal.value =~ /calc\(/
|
205
|
-
end
|
206
|
-
|
207
|
-
private
|
208
|
-
|
209
|
-
# Converts a user-provided selector into string form or throws an
|
210
|
-
# ArgumentError if it's in an invalid format.
|
211
|
-
def normalize_selector(value, name)
|
212
|
-
if (str = selector_to_str(value))
|
213
|
-
return str
|
214
|
-
end
|
215
|
-
|
216
|
-
err = "#{value.inspect} is not a valid selector: it must be a string,\n" +
|
217
|
-
"a list of strings, or a list of lists of strings"
|
218
|
-
err = "$#{name.to_s.tr('_', '-')}: #{err}" if name
|
219
|
-
raise ArgumentError.new(err)
|
220
|
-
end
|
221
|
-
|
222
|
-
# Converts a user-provided selector into string form or returns
|
223
|
-
# `nil` if it's in an invalid format.
|
224
|
-
def selector_to_str(value)
|
225
|
-
return value.value if value.is_a?(Sass::Script::String)
|
226
|
-
return unless value.is_a?(Sass::Script::List)
|
227
|
-
|
228
|
-
if value.separator == :comma
|
229
|
-
return value.to_a.map do |complex|
|
230
|
-
next complex.value if complex.is_a?(Sass::Script::String)
|
231
|
-
return unless complex.is_a?(Sass::Script::List) && complex.separator == :space
|
232
|
-
return unless (str = selector_to_str(complex))
|
233
|
-
str
|
234
|
-
end.join(', ')
|
235
|
-
end
|
236
|
-
|
237
|
-
value.to_a.map do |compound|
|
238
|
-
return unless compound.is_a?(Sass::Script::String)
|
239
|
-
compound.value
|
240
|
-
end.join(' ')
|
241
|
-
end
|
242
|
-
|
243
|
-
# @private
|
244
|
-
VALID_UNIT = /#{Sass::SCSS::RX::NMSTART}#{Sass::SCSS::RX::NMCHAR}|%*/
|
245
|
-
|
246
|
-
# @example
|
247
|
-
# parse_unit_string("em*px/in*%") # => [["em", "px], ["in", "%"]]
|
248
|
-
#
|
249
|
-
# @param unit_string [String] A string adhering to the output of a number with complex
|
250
|
-
# units. E.g. "em*px/in*%"
|
251
|
-
# @return [Array<Array<String>>] A list of numerator units and a list of denominator units.
|
252
|
-
def parse_unit_string(unit_string)
|
253
|
-
denominator_units = numerator_units = Sass::Script::Value::Number::NO_UNITS
|
254
|
-
return numerator_units, denominator_units unless unit_string && unit_string.length > 0
|
255
|
-
num_over_denominator = unit_string.split(%r{ */ *})
|
256
|
-
unless (1..2).include?(num_over_denominator.size)
|
257
|
-
raise ArgumentError.new("Malformed unit string: #{unit_string}")
|
258
|
-
end
|
259
|
-
numerator_units = num_over_denominator[0].split(/ *\* */)
|
260
|
-
denominator_units = (num_over_denominator[1] || "").split(/ *\* */)
|
261
|
-
[[numerator_units, "numerator"], [denominator_units, "denominator"]].each do |units, name|
|
262
|
-
if unit_string =~ %r{/} && units.size == 0
|
263
|
-
raise ArgumentError.new("Malformed unit string: #{unit_string}")
|
264
|
-
end
|
265
|
-
if units.any? {|unit| unit !~ VALID_UNIT}
|
266
|
-
raise ArgumentError.new("Malformed #{name} in unit string: #{unit_string}")
|
267
|
-
end
|
268
|
-
end
|
269
|
-
[numerator_units, denominator_units]
|
270
|
-
end
|
271
|
-
end
|
272
|
-
end
|
@@ -1,113 +0,0 @@
|
|
1
|
-
module Sass::Script::Value
|
2
|
-
# A SassScript object representing a CSS list.
|
3
|
-
# This includes both comma-separated lists and space-separated lists.
|
4
|
-
class List < Base
|
5
|
-
# The Ruby array containing the contents of the list.
|
6
|
-
#
|
7
|
-
# @return [Array<Value>]
|
8
|
-
attr_reader :value
|
9
|
-
alias_method :to_a, :value
|
10
|
-
|
11
|
-
# The operator separating the values of the list.
|
12
|
-
# Either `:comma` or `:space`.
|
13
|
-
#
|
14
|
-
# @return [Symbol]
|
15
|
-
attr_reader :separator
|
16
|
-
|
17
|
-
# Creates a new list.
|
18
|
-
#
|
19
|
-
# @param value [Array<Value>] See \{#value}
|
20
|
-
# @param separator [Symbol] See \{#separator}
|
21
|
-
def initialize(value, separator)
|
22
|
-
super(value)
|
23
|
-
@separator = separator
|
24
|
-
end
|
25
|
-
|
26
|
-
# @see Value#options=
|
27
|
-
def options=(options)
|
28
|
-
super
|
29
|
-
value.each {|v| v.options = options}
|
30
|
-
end
|
31
|
-
|
32
|
-
# @see Value#eq
|
33
|
-
def eq(other)
|
34
|
-
Sass::Script::Value::Bool.new(
|
35
|
-
other.is_a?(List) && value == other.value &&
|
36
|
-
separator == other.separator)
|
37
|
-
end
|
38
|
-
|
39
|
-
def hash
|
40
|
-
@hash ||= [value, separator].hash
|
41
|
-
end
|
42
|
-
|
43
|
-
# @see Value#to_s
|
44
|
-
def to_s(opts = {})
|
45
|
-
raise Sass::SyntaxError.new("() isn't a valid CSS value.") if value.empty?
|
46
|
-
value.
|
47
|
-
reject {|e| e.is_a?(Null) || e.is_a?(List) && e.value.empty?}.
|
48
|
-
map {|e| e.to_s(opts)}.join(sep_str)
|
49
|
-
end
|
50
|
-
|
51
|
-
# @see Value#to_sass
|
52
|
-
def to_sass(opts = {})
|
53
|
-
return "()" if value.empty?
|
54
|
-
members = value.map do |v|
|
55
|
-
if element_needs_parens?(v)
|
56
|
-
"(#{v.to_sass(opts)})"
|
57
|
-
else
|
58
|
-
v.to_sass(opts)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
return "(#{members.first},)" if members.length == 1 && separator == :comma
|
62
|
-
members.join(sep_str(nil))
|
63
|
-
end
|
64
|
-
|
65
|
-
# @see Value#to_h
|
66
|
-
def to_h
|
67
|
-
return Sass::Util.ordered_hash if value.empty?
|
68
|
-
super
|
69
|
-
end
|
70
|
-
|
71
|
-
# @see Value#inspect
|
72
|
-
def inspect
|
73
|
-
"(#{value.map {|e| e.inspect}.join(sep_str(nil))})"
|
74
|
-
end
|
75
|
-
|
76
|
-
# Asserts an index is within the list.
|
77
|
-
#
|
78
|
-
# @private
|
79
|
-
#
|
80
|
-
# @param list [Sass::Script::Value::List] The list for which the index should be checked.
|
81
|
-
# @param n [Sass::Script::Value::Number] The index being checked.
|
82
|
-
def self.assert_valid_index(list, n)
|
83
|
-
if !n.int? || n.to_i == 0
|
84
|
-
raise ArgumentError.new("List index #{n} must be a non-zero integer")
|
85
|
-
elsif list.to_a.size == 0
|
86
|
-
raise ArgumentError.new("List index is #{n} but list has no items")
|
87
|
-
elsif n.to_i.abs > (size = list.to_a.size)
|
88
|
-
raise ArgumentError.new(
|
89
|
-
"List index is #{n} but list is only #{size} item#{'s' if size != 1} long")
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
private
|
94
|
-
|
95
|
-
def element_needs_parens?(element)
|
96
|
-
if element.is_a?(List)
|
97
|
-
return false if element.value.empty?
|
98
|
-
precedence = Sass::Script::Parser.precedence_of(separator)
|
99
|
-
return Sass::Script::Parser.precedence_of(element.separator) <= precedence
|
100
|
-
end
|
101
|
-
|
102
|
-
return false unless separator == :space
|
103
|
-
return false unless element.is_a?(Sass::Script::Tree::UnaryOperation)
|
104
|
-
element.operator == :minus || element.operator == :plus
|
105
|
-
end
|
106
|
-
|
107
|
-
def sep_str(opts = options)
|
108
|
-
return ' ' if separator == :space
|
109
|
-
return ',' if opts && opts[:style] == :compressed
|
110
|
-
', '
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
module Sass::Script::Value
|
2
|
-
# A SassScript object representing a map from keys to values. Both keys and
|
3
|
-
# values can be any SassScript object.
|
4
|
-
class Map < Base
|
5
|
-
# The Ruby hash containing the contents of this map.
|
6
|
-
#
|
7
|
-
# @return [Hash<Node, Node>]
|
8
|
-
attr_reader :value
|
9
|
-
alias_method :to_h, :value
|
10
|
-
|
11
|
-
# Creates a new map.
|
12
|
-
#
|
13
|
-
# @param hash [Hash<Node, Node>]
|
14
|
-
def initialize(hash)
|
15
|
-
super(Sass::Util.ordered_hash(hash))
|
16
|
-
end
|
17
|
-
|
18
|
-
# @see Value#options=
|
19
|
-
def options=(options)
|
20
|
-
super
|
21
|
-
value.each do |k, v|
|
22
|
-
k.options = options
|
23
|
-
v.options = options
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# @see Value#separator
|
28
|
-
def separator
|
29
|
-
:comma unless value.empty?
|
30
|
-
end
|
31
|
-
|
32
|
-
# @see Value#to_a
|
33
|
-
def to_a
|
34
|
-
value.map do |k, v|
|
35
|
-
list = List.new([k, v], :space)
|
36
|
-
list.options = options
|
37
|
-
list
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# @see Value#eq
|
42
|
-
def eq(other)
|
43
|
-
Bool.new(other.is_a?(Map) && value == other.value)
|
44
|
-
end
|
45
|
-
|
46
|
-
def hash
|
47
|
-
@hash ||= value.hash
|
48
|
-
end
|
49
|
-
|
50
|
-
# @see Value#to_s
|
51
|
-
def to_s(opts = {})
|
52
|
-
raise Sass::SyntaxError.new("#{inspect} isn't a valid CSS value.")
|
53
|
-
end
|
54
|
-
|
55
|
-
def to_sass(opts = {})
|
56
|
-
return "()" if value.empty?
|
57
|
-
|
58
|
-
to_sass = lambda do |value|
|
59
|
-
if value.is_a?(List) && value.separator == :comma
|
60
|
-
"(#{value.to_sass(opts)})"
|
61
|
-
else
|
62
|
-
value.to_sass(opts)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
"(#{value.map {|(k, v)| "#{to_sass[k]}: #{to_sass[v]}"}.join(', ')})"
|
67
|
-
end
|
68
|
-
alias_method :inspect, :to_sass
|
69
|
-
end
|
70
|
-
end
|