brakeman 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +18 -0
- data/bin/brakeman +1 -1
- data/bundle/load.rb +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/CHANGES.txt +828 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/README.txt +102 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/Makefile +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/bench.rb +313 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/bench_context.yaml +141 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/_footer.html +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/_header.html +52 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_erb.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_erubis.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_eruby.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/bin/erubis +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/erubis +3468 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/erubis-run.rb +132 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/inline-require +179 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ActionView.html +105 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +209 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ERB.html +101 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis.html +362 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayBufferEnhancer.html +175 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayBufferEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayEnhancer.html +174 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic.html +112 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic/Converter.html +327 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic/Engine.html +130 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/BiPatternEnhancer.html +215 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/BiPatternEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CGenerator.html +386 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CommandOptionError.html +113 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Context.html +344 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Converter.html +283 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CppGenerator.html +382 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/DeleteIndentEnhancer.html +150 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/DeleteIndentEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ec.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ecpp.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ejava.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ejavascript.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Engine.html +305 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Eperl.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ephp.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErboutEnhancer.html +175 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErboutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErubisError.html +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Eruby.html +132 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapeEnhancer.html +165 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEc.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEcpp.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEjava.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEjavascript.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEperl.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEphp.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEruby.html +127 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEscheme.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Escheme.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Evaluator.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/FastEruby.html +131 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Generator.html +416 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/HeaderFooterEnhancer.html +267 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/HeaderFooterEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers.html +116 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +787 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsHelper.html +349 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +213 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/InterpolationEnhancer.html +305 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/InterpolationEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/JavaGenerator.html +359 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/JavascriptGenerator.html +386 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Main.html +341 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoTextEnhancer.html +159 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoTextEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NotSupportedError.html +119 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedEruby.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedXmlEruby.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI.html +125 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Converter.html +266 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ec.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ecpp.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ejava.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Engine.html +122 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Eperl.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ephp.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Eruby.html +155 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Escheme.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/TinyEruby.html +293 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PercentLineEnhancer.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PercentLineEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PerlGenerator.html +344 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PhpGenerator.html +350 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrefixedLineEnhancer.html +210 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrefixedLineEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PreprocessingEruby.html +183 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PreprocessingHelper.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintEnabledEnhancer.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintEnabledEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutEnhancer.html +244 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutSimplifiedEruby.html +121 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/RubyEvaluator.html +227 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/RubyGenerator.html +328 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SimplifiedEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SimplifyEnhancer.html +191 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutEnhancer.html +173 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutSimplifiedEruby.html +121 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringBufferEnhancer.html +174 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringBufferEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringIOEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/TinyEruby.html +298 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/XmlEruby.html +130 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/XmlHelper.html +255 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Kernel.html +155 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/created.rid +1 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/README_txt.html +247 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/context_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/converter_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ec_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ecpp_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ejava_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ejavascript_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/enhanced_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/eperl_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ephp_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/eruby_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/escheme_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/optimized_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine_rb.html +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/enhancer_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/error_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/evaluator_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/generator_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helper_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helpers/rails_form_helper_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helpers/rails_helper_rb.html +116 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/local-setting_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/main_rb.html +129 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/preprocessing_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/tiny_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/util_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis_rb.html +118 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_class_index.html +129 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_file_index.html +53 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_method_index.html +265 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/index.html +24 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/rdoc-style.css +208 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc/docstyle.css +209 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc/users-guide.html +3551 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/Makefile +58 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ec +42 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ecpp +33 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ejava +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ejs +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.eperl +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ephp +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.eruby +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.escheme +26 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/Makefile +54 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ec +42 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ejava +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ejs +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.eperl +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ephp +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.eruby +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.escheme +26 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis.rb +73 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/context.rb +83 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/converter.rb +357 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine.rb +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +113 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +110 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +119 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +95 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +99 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +125 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +127 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/enhancer.rb +723 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/error.rb +23 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb +88 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/generator.rb +85 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helper.rb +47 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +197 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +353 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/local-setting.rb +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/main.rb +516 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +58 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/tiny.rb +144 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/util.rb +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/setup.rb +1331 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/assert-text-equal.rb +44 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/Example.ejava +55 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/array_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/arraybuffer_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bipattern-example.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bipattern_example.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bufvar-example.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bufvar-example.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/context.rb +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/context.yaml +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/def_method.rb +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/def_method.result +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/escape_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ec +27 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ecpp +30 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ejs +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.eperl +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ephp +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.escheme +28 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.rb +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.rb +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.xhtml +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10_x.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.php +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.result +23 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.rhtml +21 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_C.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_N.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_U.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_php.result +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1_x.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.eruby +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.result +27 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2_trim.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2_x.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example31.result +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example32.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3_e.result +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.rb +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4_x.result +5 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.rb +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example6.rb +12 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example6.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example7.eruby +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example71.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example72.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8_ruby.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8_yaml.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example91.result +5 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example92.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_c.result +32 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_java.result +56 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_js.result +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_perl.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_php.result +19 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_scheme.result +30 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_scheme_display.result +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby-example.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby-example.result +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.rb +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.result +38 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.rhtml +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example.eruby +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example2.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example2.rhtml +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter_example.result +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter_example2.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/interpolation_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program1.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program1.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program2.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program2.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode-example.eruby +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode-php.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode_example.result +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/normal-eruby-test.eruby +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/normal_eruby_test.result +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-example.eruby +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-example.php +19 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-php.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext_example.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/percentline-example.rhtml +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/percentline_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline-example.rb +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline-example.rhtml +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenable_example.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenabled-example.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenabled-example.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printstatement_example.result +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/simplify_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stderr.log +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stdout_exmple.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stringbuffer_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/tail_260.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/tailnewline.rhtml +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/template1.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/template2.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-engines.rb +425 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-enhancers.rb +646 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-erubis.rb +887 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-index-cgi.rb +191 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-main.rb +752 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-users-guide.rb +73 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test.rb +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/testutil.rb +111 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/CHANGELOG.md +1363 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/FAQ.md +157 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/README.md +173 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/REFERENCE.md +1294 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/Rakefile +134 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/bin/haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml.rb +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/buffer.rb +345 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/compiler.rb +540 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/engine.rb +245 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/error.rb +61 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/exec.rb +329 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/filters.rb +404 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers.rb +664 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_extensions.rb +58 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb +147 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb +58 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/safe_erubis_template.rb +29 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/xss_mods.rb +104 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/options.rb +279 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/parser.rb +764 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/railtie.rb +22 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/sass_rails_filter.rb +33 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template.rb +32 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template/options.rb +16 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +41 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/util.rb +377 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/engine_test.rb +2013 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/_av_partial_1.erb +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/_av_partial_2.erb +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/action_view.erb +62 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/standard.erb +55 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/filters_test.rb +254 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.0.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.1.x +6 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.2.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-4.0.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/LICENSE +14 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/README.md +106 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/lua_haml_spec.lua +38 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/perl_haml_test.pl +81 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/ruby_haml_test.rb +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/tests.json +660 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/helper_test.rb +583 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/markaby/standard.mab +52 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/mocks/article.rb +6 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/parser_test.rb +105 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/content_for_layout.xhtml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/eval_suppressed.xhtml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/helpers.xhtml +70 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/helpful.xhtml +10 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/just_stuff.xhtml +70 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/list.xhtml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/nuke_inner_whitespace.xhtml +40 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/nuke_outer_whitespace.xhtml +148 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/original_engine.xhtml +20 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partial_layout.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partial_layout_erb.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partials.xhtml +21 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/render_layout.xhtml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/silent_script.xhtml +74 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/standard.xhtml +162 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/tag_parsing.xhtml +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/very_basic.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/whitespace_handling.xhtml +90 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/template_test.rb +354 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_1.haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_1_ugly.haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_2.haml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_2_ugly.haml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_layout.erb +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_layout_for_partial.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_partial.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_text_area.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_text_area_helper.html.haml +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/action_view.haml +47 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/action_view_ugly.haml +47 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/breakage.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/content_for_layout.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/eval_suppressed.haml +11 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/helpers.haml +55 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/helpful.haml +11 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/just_stuff.haml +85 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/list.haml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/nuke_inner_whitespace.haml +32 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/nuke_outer_whitespace.haml +144 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/original_engine.haml +17 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partial_layout.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partial_layout_erb.erb +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partialize.haml +1 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partials.haml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/render_layout.haml +2 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/silent_script.haml +45 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/standard.haml +43 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/standard_ugly.haml +43 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/tag_parsing.haml +21 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/very_basic.haml +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/whitespace_handling.haml +87 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/test_helper.rb +81 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/util_test.rb +63 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/AUTHORS +3 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/COPYING +339 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Changelog.md +415 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Gemfile +9 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/INSTALL +59 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/LICENSE +7 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/README.rdoc +74 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Rakefile +30 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/TODO +6 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/ansi_colors.rb +38 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/asking_for_arrays.rb +18 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/basic_usage.rb +75 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb +32 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb +12 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/limit.rb +12 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/menus.rb +65 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/overwrite.rb +19 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/page_and_wrap.rb +322 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/password.rb +7 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/repeat_entry.rb +21 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/trapping_eof.rb +22 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/using_readline.rb +17 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/highline.gemspec +37 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline.rb +1048 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/color_scheme.rb +134 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/compatibility.rb +16 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/import.rb +41 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/menu.rb +381 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/question.rb +480 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/simulate.rb +48 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/string_extensions.rb +111 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/style.rb +192 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/system_extensions.rb +254 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/version.rb +4 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/setup.rb +1360 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/highline.css +65 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/images/logo.png +0 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/index.html +58 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/string_methods.rb +32 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_color_scheme.rb +96 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_highline.rb +1402 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_import.rb +52 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_menu.rb +439 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_simulator.rb +23 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_extension.rb +33 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb +38 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_style.rb +578 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/History.txt +371 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/Manifest.txt +8 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/README.txt +87 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/Rakefile +92 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/bin/r2r_show +33 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/lib/ruby2ruby.rb +1159 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/test/test_ruby2ruby.rb +709 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/History.txt +882 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/Manifest.txt +29 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/README.txt +93 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/Rakefile +187 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/bin/ruby_parse +96 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/bin/ruby_parse_extract_error +156 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby18_parser.rb +5773 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby18_parser.y +1899 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby19_parser.rb +6171 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby19_parser.y +2109 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby20_parser.rb +6723 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby20_parser.y +2372 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby21_parser.rb +6764 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby21_parser.y +2382 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby22_parser.rb +6804 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby22_parser.y +2393 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby23_parser.rb +6905 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby23_parser.y +2425 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rb +1237 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rex +177 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rex.rb +317 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser.rb +7 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser.yy +2506 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser_extras.rb +1460 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_lexer.rb +2723 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_parser.rb +3502 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_parser_extras.rb +228 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/CHANGES.md +149 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/Gemfile +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/LICENSE.txt +22 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/README.md +191 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/Rakefile +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/bin/safe_yaml +75 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/bundle_install_all_ruby_versions.sh +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml.rb +94 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/deep.rb +34 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/libyaml_checker.rb +36 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/load.rb +181 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb +35 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/hexadecimal.rb +12 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/sexagesimal.rb +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/psych_handler.rb +99 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/psych_resolver.rb +52 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/resolver.rb +94 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb +29 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_hack.rb +36 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_node_monkeypatch.rb +43 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_resolver.rb +38 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform.rb +41 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_boolean.rb +21 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_date.rb +13 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_float.rb +33 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_integer.rb +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_nil.rb +18 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_symbol.rb +17 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/transformation_map.rb +47 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/run_specs_all_ruby_versions.sh +38 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/safe_yaml.gemspec +19 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/exploit.1.9.2.yaml +2 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/exploit.1.9.3.yaml +2 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/issue48.txt +20 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/issue49.yml +0 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/libyaml_checker_spec.rb +69 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/psych_resolver_spec.rb +10 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/resolver_specs.rb +278 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/safe_yaml_spec.rb +731 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/spec_helper.rb +42 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb +29 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/syck_resolver_spec.rb +10 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/base64_spec.rb +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_date_spec.rb +60 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_float_spec.rb +42 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_integer_spec.rb +64 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_symbol_spec.rb +51 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/yaml_spec.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/CODE_OF_CONDUCT.md +10 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/CONTRIBUTING.md +125 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/README.md +227 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/REVISION +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/Rakefile +432 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION_DATE +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION_NAME +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/sass +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/sass-convert +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/scss +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/extra/update_watch.rb +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/init.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass.rb +109 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/base.rb +88 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/chain.rb +34 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/filesystem.rb +60 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/memory.rb +46 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/null.rb +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/callbacks.rb +67 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/css.rb +408 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/engine.rb +1218 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/environment.rb +215 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/error.rb +198 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/base.rb +199 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_convert.rb +283 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_scss.rb +440 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/features.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers.rb +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/base.rb +182 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/deprecated_path.rb +51 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/filesystem.rb +219 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger.rb +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger/base.rb +30 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger/log_level.rb +45 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/media.rb +210 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin.rb +134 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb +582 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/configuration.rb +134 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/generic.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/merb.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/rack.rb +60 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/rails.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/staleness_checker.rb +199 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/railtie.rb +10 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/repl.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/root.rb +7 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script.rb +66 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_lexer.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_parser.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_variable_warning.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/functions.rb +2690 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/lexer.rb +464 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/parser.rb +825 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree.rb +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb +313 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/interpolation.rb +223 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb +104 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/literal.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/map_literal.rb +64 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/node.rb +127 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/operation.rb +129 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/selector.rb +26 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/string_interpolation.rb +125 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/unary_operation.rb +69 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/variable.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value.rb +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/arg_list.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/base.rb +241 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/bool.rb +35 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/color.rb +698 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/helpers.rb +272 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/list.rb +113 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/map.rb +70 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/null.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/number.rb +561 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/string.rb +145 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss.rb +14 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/css_parser.rb +56 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/parser.rb +1236 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/rx.rb +140 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/static_parser.rb +366 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector.rb +323 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/abstract_sequence.rb +111 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/comma_sequence.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/pseudo.rb +266 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/sequence.rb +636 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/simple.rb +116 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/simple_sequence.rb +344 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/shared.rb +76 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/map.rb +211 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/position.rb +39 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/range.rb +41 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/stack.rb +120 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/supports.rb +225 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/at_root_node.rb +83 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/charset_node.rb +22 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/comment_node.rb +82 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/content_node.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/css_import_node.rb +68 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/debug_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/directive_node.rb +59 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/each_node.rb +24 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/error_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/extend_node.rb +43 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/for_node.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/function_node.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/if_node.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb +75 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/keyframe_rule_node.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/media_node.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/mixin_def_node.rb +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/mixin_node.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/node.rb +240 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/prop_node.rb +170 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/return_node.rb +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/rule_node.rb +146 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/supports_node.rb +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/trace_node.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/variable_node.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb +72 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/check_nesting.rb +173 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/convert.rb +349 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/cssize.rb +373 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/deep_copy.rb +107 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/extend.rb +70 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb +563 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/set_options.rb +139 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/to_css.rb +409 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/warn_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/while_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util.rb +1350 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/cross_platform_random.rb +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/multibyte_string_scanner.rb +155 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/normalized_map.rb +129 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/ordered_hash.rb +192 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/subset_map.rb +109 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/test.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/version.rb +124 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/rails/init.rb +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass-spec.yml +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/cache_test.rb +131 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/callbacks_test.rb +61 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/compiler_test.rb +236 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/conversion_test.rb +2171 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/css2sass_test.rb +526 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/css_variable_test.rb +132 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/data/hsl-rgb.txt +319 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/encoding_test.rb +219 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/engine_test.rb +3441 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/exec_test.rb +96 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/extend_test.rb +1707 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/functions_test.rb +1974 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/importer_test.rb +421 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/logger_test.rb +58 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/mock_importer.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more1.css +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more_import.css +29 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/_more_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/more1.sass +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/more_import.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/plugin_test.rb +556 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/alt.css +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/basic.css +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/cached_import_option.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/compact.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/complex.css +86 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/compressed.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/expanded.css +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/filename_fn.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/if.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import.css +31 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset_1_8.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset_ibm866.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_content.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/line_numbers.css +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/mixins.css +95 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/multiline.css +24 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/nested.css +22 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/options.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/parent_ref.css +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/script.css +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/scss_import.css +31 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/scss_importee.css +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/subdir/subdir.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/units.css +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/warn.css +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/warn_imported.css +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/script_conversion_test.rb +357 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/script_test.rb +1422 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/css_test.rb +1281 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/rx_test.rb +160 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/scss_test.rb +4157 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/test_helper.rb +37 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/source_map_test.rb +1055 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/superselector_test.rb +210 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_cached_import_option_partial.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_double_import_loop2.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_filename_fn_import.scss +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_content.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_same_name_different_partiality.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/alt.sass +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/basic.sass +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork1.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork2.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork3.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork4.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork5.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/cached_import_option.scss +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/compact.sass +17 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/complex.sass +305 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/compressed.sass +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/double_import_loop1.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/expanded.sass +17 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/filename_fn.scss +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/if.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import.sass +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset.sass +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset_1_8.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_content.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/importee.less +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/importee.sass +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/line_numbers.sass +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/mixin_bork.sass +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/mixins.sass +76 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/multiline.sass +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested.sass +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork1.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork2.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork3.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork4.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_import.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/options.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/parent_ref.sass +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_ext.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_ext.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_partiality.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/script.sass +101 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/scss_import.scss +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/scss_importee.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/single_import_loop.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/import_up1.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/import_up2.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/subdir.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/units.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/warn.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/warn_imported.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/test_helper.rb +8 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/normalized_map_test.rb +51 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/subset_map_test.rb +91 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util_test.rb +438 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/value_helpers_test.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/test_helper.rb +110 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/CHANGELOG.md +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/CONTRIBUTING.md +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Gemfile +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Guardfile +8 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/README.md +349 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Rakefile +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Vagrantfile +96 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen.rb +54 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapter.rb +327 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/bsd.rb +75 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/darwin.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/linux.rb +81 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/polling.rb +58 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/windows.rb +91 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/directory_record.rb +406 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/listener.rb +323 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/turnstile.rb +32 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/listen.gemspec +28 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapter_spec.rb +149 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/bsd_spec.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/darwin_spec.rb +37 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/linux_spec.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/windows_spec.rb +30 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/directory_record_spec.rb +1250 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/listener_spec.rb +258 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen_spec.rb +67 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/spec_helper.rb +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/adapter_helper.rb +666 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/directory_record_helper.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/listeners_helper.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/platform_helper.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/History.txt +278 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/Manifest.txt +13 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/README.txt +64 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/Rakefile +12 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/composite_sexp_processor.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/pt_testcase.rb +3125 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/sexp.rb +338 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/sexp_processor.rb +695 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/unique.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_composite_sexp_processor.rb +69 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_environment.rb +94 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_sexp.rb +356 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_sexp_processor.rb +373 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/CHANGES +426 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/Gemfile +69 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/LICENSE +21 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/README.jp.md +1205 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/README.md +1205 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/Rakefile +100 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/context.rb +11 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/profile-parser.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/profile-render.rb +12 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/run-benchmarks.rb +119 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/run-diffbench.rb +21 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.erb +23 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.haml +18 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.slim +17 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/bin/slimrb +6 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/include.md +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/include.md +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/logic_less.md +137 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/smart.md +102 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/translator.md +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/logic_less.md +137 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/smart.md +103 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/translator.md +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim.rb +14 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/code_attributes.rb +67 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/command.rb +128 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/controls.rb +60 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/do_inserter.rb +33 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/embedded.rb +273 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/end_inserter.rb +62 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/engine.rb +41 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/erb_converter.rb +14 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/filter.rb +30 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/grammar.rb +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/include.rb +57 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/interpolation.rb +35 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less/context.rb +127 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less/filter.rb +80 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/parser.rb +527 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart.rb +8 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/escaper.rb +42 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/filter.rb +96 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/parser.rb +36 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/splat/builder.rb +101 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/splat/filter.rb +91 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/template.rb +19 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/translator.rb +118 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/version.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/slim.gemspec +24 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/helper.rb +211 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_blocks.rb +183 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_escaping.rb +150 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_evaluation.rb +180 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_output.rb +168 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_structure.rb +168 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_commands.rb +223 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_embedded_engines.rb +242 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_encoding.rb +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_erb_converter.rb +67 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_attributes.rb +268 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_escaping.rb +65 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_structure.rb +537 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_parser_errors.rb +148 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_pretty.rb +166 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_ruby_errors.rb +207 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_slim_template.rb +77 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_tabs.rb +169 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_text_interpolation.rb +79 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_thread_options.rb +18 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_unicode.rb +16 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/recursive.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/slimfile.slim +3 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/subdir/test.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/textfile +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/test_include.rb +24 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/TESTS.md +1290 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/helper.rb +15 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/run.rb +92 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/logic_less/test_logic_less.rb +295 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/Rakefile +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/application_controller.rb +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/entries_controller.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/slim_controller.rb +40 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/helpers/application_helper.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/models/entry.rb +16 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/entries/edit.html.slim +3 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/layouts/application.html.slim +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/_partial.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/content_for.html.slim +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/erb.html.erb +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/form_for.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/helper.html.slim +4 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/integers.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/no_layout.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/normal.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/partial.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/splat.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/thread_options.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/variables.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/xml.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config.ru +4 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/application.rb +44 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/boot.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/environment.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/environments/test.rb +34 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/inflections.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/mime_types.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/secret_token.rb +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/session_store.rb +8 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/locales/en.yml +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/routes.rb +60 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/script/rails +6 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/test/helper.rb +31 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/test/test_slim.rb +90 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/smart/test_smart_text.rb +296 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/translator/test_translator.rb +76 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/CHANGES +235 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/EXPRESSIONS.md +261 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/Gemfile +3 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/README.md +267 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/Rakefile +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple.rb +64 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/engine.rb +67 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/engine.rb +15 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/parser.rb +40 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/template.rb +11 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/trimming.rb +23 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/exceptions.rb +13 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filter.rb +9 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/code_merger.rb +30 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/control_flow.rb +42 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/dynamic_inliner.rb +71 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/encoding.rb +24 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/eraser.rb +22 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/escapable.rb +40 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/multi_flattener.rb +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/remove_bom.rb +13 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/static_merger.rb +37 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/validator.rb +15 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generator.rb +88 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/array.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/array_buffer.rb +28 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/erb.rb +32 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/rails_output_buffer.rb +35 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/string_buffer.rb +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/grammar.rb +57 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_merger.rb +47 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_remover.rb +35 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_sorter.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/dispatcher.rb +31 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/fast.rb +130 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/filter.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/pretty.rb +103 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/safe.rb +23 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/map.rb +105 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/dispatcher.rb +158 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/engine_dsl.rb +145 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/grammar_dsl.rb +170 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/options.rb +87 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/template.rb +28 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/parser.rb +8 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates.rb +11 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates/rails.rb +26 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates/tilt.rb +46 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/utils.rb +90 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/temple.gemspec +29 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_code_merger.rb +38 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_control_flow.rb +90 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_dynamic_inliner.rb +95 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_eraser.rb +55 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_escapable.rb +49 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_multi_flattener.rb +33 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_static_merger.rb +41 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/helper.rb +30 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_merger.rb +76 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_remover.rb +43 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_sorter.rb +48 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_fast.rb +97 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_pretty.rb +55 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/mixins/test_dispatcher.rb +70 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/mixins/test_grammar_dsl.rb +86 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_engine.rb +189 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_erb.rb +61 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_filter.rb +29 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_generator.rb +158 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_grammar.rb +47 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_map.rb +39 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_utils.rb +39 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Gemfile +4 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/History.rdoc +48 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Manifest +27 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/README.rdoc +240 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Rakefile +9 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Todo.rdoc +14 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/examples/examples.rb +83 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table.rb +26 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/cell.rb +92 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/import.rb +3 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/row.rb +48 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/separator.rb +14 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/style.rb +62 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/table.rb +226 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/table_helper.rb +9 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/version.rb +5 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/terminal-table.gemspec +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/CHANGELOG.md +84 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/COPYING +18 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/Gemfile +64 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/HACKING +16 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/README.md +226 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/Rakefile +105 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/bin/tilt +122 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/docs/TEMPLATES.md +524 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/docs/common.css +14 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt.rb +159 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/asciidoc.rb +27 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/babel.rb +15 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/bluecloth.rb +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/builder.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/coffee.rb +58 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/creole.rb +25 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/csv.rb +65 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/erb.rb +57 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/erubis.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/etanni.rb +27 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/haml.rb +58 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/kramdown.rb +25 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/less.rb +30 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/liquid.rb +38 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/mapping.rb +265 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/markaby.rb +45 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/maruku.rb +22 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/nokogiri.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/plain.rb +16 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/prawn.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/radius.rb +48 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/rdiscount.rb +39 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/rdoc.rb +40 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/redcarpet.rb +83 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/redcloth.rb +23 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/sass.rb +41 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/string.rb +21 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/template.rb +295 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/wikicloth.rb +22 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/yajl.rb +87 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/man/index.txt +2 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/man/tilt.1.ronn +59 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/locals.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/markaby.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/markaby_other_static.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/render_twice.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/scope.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/yielding.mab +2 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/test_helper.rb +64 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_asciidoctor_test.rb +50 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_babeltemplate.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_blueclothtemplate_test.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_buildertemplate_test.rb +59 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_cache_test.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_coffeescripttemplate_test.rb +141 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_compilesite_test.rb +51 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_creoletemplate_test.rb +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_csv_test.rb +77 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_erbtemplate_test.rb +239 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_erubistemplate_test.rb +151 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_etannitemplate_test.rb +174 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_hamltemplate_test.rb +166 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_kramdown_test.rb +20 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_lesstemplate_test.less +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_lesstemplate_test.rb +42 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_liquidtemplate_test.rb +78 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_mapping_test.rb +229 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_markaby_test.rb +88 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_markdown_test.rb +177 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_marukutemplate_test.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_metadata_test.rb +42 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_nokogiritemplate_test.rb +87 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_prawntemplate.prawn +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_prawntemplate_test.rb +75 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_radiustemplate_test.rb +75 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_rdiscounttemplate_test.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_rdoctemplate_test.rb +29 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_redcarpettemplate_test.rb +54 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_redclothtemplate_test.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_sasstemplate_test.rb +41 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_stringtemplate_test.rb +171 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_template_test.rb +308 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_test.rb +60 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_wikiclothtemplate_test.rb +32 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_yajltemplate_test.rb +101 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/tilt.gemspec +114 -0
- data/lib/brakeman.rb +9 -1
- data/lib/brakeman/call_index.rb +1 -1
- data/lib/brakeman/checks/check_content_tag.rb +1 -1
- data/lib/brakeman/checks/check_cross_site_scripting.rb +1 -1
- data/lib/brakeman/checks/check_execute.rb +4 -0
- data/lib/brakeman/checks/check_forgery_setting.rb +3 -2
- data/lib/brakeman/checks/check_link_to.rb +1 -1
- data/lib/brakeman/checks/check_link_to_href.rb +2 -2
- data/lib/brakeman/checks/check_mass_assignment.rb +1 -1
- data/lib/brakeman/checks/check_redirect.rb +6 -0
- data/lib/brakeman/checks/check_secrets.rb +40 -0
- data/lib/brakeman/checks/check_sql.rb +1 -1
- data/lib/brakeman/processor.rb +6 -6
- data/lib/brakeman/processors/alias_processor.rb +29 -3
- data/lib/brakeman/processors/base_processor.rb +35 -4
- data/lib/brakeman/processors/controller_alias_processor.rb +4 -4
- data/lib/brakeman/processors/haml_template_processor.rb +1 -1
- data/lib/brakeman/processors/lib/basic_processor.rb +18 -0
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +3 -2
- data/lib/brakeman/processors/lib/rails2_route_processor.rb +2 -1
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +3 -2
- data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -1
- data/lib/brakeman/processors/template_alias_processor.rb +4 -4
- data/lib/brakeman/processors/template_processor.rb +1 -0
- data/lib/brakeman/report/report_codeclimate.rb +2 -1
- data/lib/brakeman/scanner.rb +1 -1
- data/lib/brakeman/tracker.rb +11 -1
- data/lib/brakeman/tracker/constants.rb +101 -0
- data/lib/brakeman/util.rb +4 -0
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning_codes.rb +1 -0
- data/lib/ruby_parser/bm_sexp.rb +6 -0
- metadata +1171 -162
@@ -0,0 +1,10 @@
|
|
1
|
+
# Rails 3.0.0.beta.2+, < 3.1
|
2
|
+
if defined?(ActiveSupport) && Sass::Util.has?(:public_method, ActiveSupport, :on_load) &&
|
3
|
+
!Sass::Util.ap_geq?('3.1.0.beta')
|
4
|
+
require 'sass/plugin/configuration'
|
5
|
+
ActiveSupport.on_load(:before_configuration) do
|
6
|
+
require 'sass'
|
7
|
+
require 'sass/plugin'
|
8
|
+
require 'sass/plugin/rails'
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'readline'
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# Runs a SassScript read-eval-print loop.
|
5
|
+
# It presents a prompt on the terminal,
|
6
|
+
# reads in SassScript expressions,
|
7
|
+
# evaluates them,
|
8
|
+
# and prints the result.
|
9
|
+
class Repl
|
10
|
+
# @param options [{Symbol => Object}] An options hash.
|
11
|
+
def initialize(options = {})
|
12
|
+
@options = options
|
13
|
+
end
|
14
|
+
|
15
|
+
# Starts the read-eval-print loop.
|
16
|
+
def run
|
17
|
+
environment = Environment.new
|
18
|
+
@line = 0
|
19
|
+
loop do
|
20
|
+
@line += 1
|
21
|
+
unless (text = Readline.readline('>> '))
|
22
|
+
puts
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
26
|
+
Readline::HISTORY << text
|
27
|
+
parse_input(environment, text)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def parse_input(environment, text)
|
34
|
+
case text
|
35
|
+
when Script::MATCH
|
36
|
+
name = $1
|
37
|
+
guarded = !!$3
|
38
|
+
val = Script::Parser.parse($2, @line, text.size - ($3 || '').size - $2.size)
|
39
|
+
|
40
|
+
unless guarded && environment.var(name)
|
41
|
+
environment.set_var(name, val.perform(environment))
|
42
|
+
end
|
43
|
+
|
44
|
+
p environment.var(name)
|
45
|
+
else
|
46
|
+
p Script::Parser.parse(text, @line, 0).perform(environment)
|
47
|
+
end
|
48
|
+
rescue Sass::SyntaxError => e
|
49
|
+
puts "SyntaxError: #{e.message}"
|
50
|
+
if @options[:trace]
|
51
|
+
e.backtrace.each do |line|
|
52
|
+
puts "\tfrom #{line}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'sass/scss/rx'
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# SassScript is code that's embedded in Sass documents
|
5
|
+
# to allow for property values to be computed from variables.
|
6
|
+
#
|
7
|
+
# This module contains code that handles the parsing and evaluation of SassScript.
|
8
|
+
module Script
|
9
|
+
# The regular expression used to parse variables.
|
10
|
+
MATCH = /^\$(#{Sass::SCSS::RX::IDENT})\s*:\s*(.+?)
|
11
|
+
(!#{Sass::SCSS::RX::IDENT}(?:\s+!#{Sass::SCSS::RX::IDENT})*)?$/x
|
12
|
+
|
13
|
+
# The regular expression used to validate variables without matching.
|
14
|
+
VALIDATE = /^\$#{Sass::SCSS::RX::IDENT}$/
|
15
|
+
|
16
|
+
# Parses a string of SassScript
|
17
|
+
#
|
18
|
+
# @param value [String] The SassScript
|
19
|
+
# @param line [Fixnum] The number of the line on which the SassScript appeared.
|
20
|
+
# Used for error reporting
|
21
|
+
# @param offset [Fixnum] The number of characters in on `line` that the SassScript started.
|
22
|
+
# Used for error reporting
|
23
|
+
# @param options [{Symbol => Object}] An options hash;
|
24
|
+
# see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
|
25
|
+
# @return [Script::Tree::Node] The root node of the parse tree
|
26
|
+
def self.parse(value, line, offset, options = {})
|
27
|
+
Parser.parse(value, line, offset, options)
|
28
|
+
rescue Sass::SyntaxError => e
|
29
|
+
e.message << ": #{value.inspect}." if e.message == "SassScript error"
|
30
|
+
e.modify_backtrace(:line => line, :filename => options[:filename])
|
31
|
+
raise e
|
32
|
+
end
|
33
|
+
|
34
|
+
require 'sass/script/functions'
|
35
|
+
require 'sass/script/parser'
|
36
|
+
require 'sass/script/tree'
|
37
|
+
require 'sass/script/value'
|
38
|
+
|
39
|
+
# @private
|
40
|
+
CONST_RENAMES = {
|
41
|
+
:Literal => Sass::Script::Value::Base,
|
42
|
+
:ArgList => Sass::Script::Value::ArgList,
|
43
|
+
:Bool => Sass::Script::Value::Bool,
|
44
|
+
:Color => Sass::Script::Value::Color,
|
45
|
+
:List => Sass::Script::Value::List,
|
46
|
+
:Null => Sass::Script::Value::Null,
|
47
|
+
:Number => Sass::Script::Value::Number,
|
48
|
+
:String => Sass::Script::Value::String,
|
49
|
+
:Node => Sass::Script::Tree::Node,
|
50
|
+
:Funcall => Sass::Script::Tree::Funcall,
|
51
|
+
:Interpolation => Sass::Script::Tree::Interpolation,
|
52
|
+
:Operation => Sass::Script::Tree::Operation,
|
53
|
+
:StringInterpolation => Sass::Script::Tree::StringInterpolation,
|
54
|
+
:UnaryOperation => Sass::Script::Tree::UnaryOperation,
|
55
|
+
:Variable => Sass::Script::Tree::Variable,
|
56
|
+
}
|
57
|
+
|
58
|
+
# @private
|
59
|
+
def self.const_missing(name)
|
60
|
+
klass = CONST_RENAMES[name]
|
61
|
+
super unless klass
|
62
|
+
CONST_RENAMES.each {|n, k| const_set(n, k)}
|
63
|
+
klass
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Sass
|
2
|
+
module Script
|
3
|
+
# This is a subclass of {Lexer} for use in parsing plain CSS properties.
|
4
|
+
#
|
5
|
+
# @see Sass::SCSS::CssParser
|
6
|
+
class CssLexer < Lexer
|
7
|
+
private
|
8
|
+
|
9
|
+
def token
|
10
|
+
important || super
|
11
|
+
end
|
12
|
+
|
13
|
+
def string(re, *args)
|
14
|
+
if re == :uri
|
15
|
+
uri = scan(URI)
|
16
|
+
return unless uri
|
17
|
+
return [:string, Script::Value::String.new(uri)]
|
18
|
+
end
|
19
|
+
|
20
|
+
return unless scan(STRING)
|
21
|
+
string_value = Sass::Script::Value::String.value(@scanner[1] || @scanner[2])
|
22
|
+
value = Script::Value::String.new(string_value, :string)
|
23
|
+
[:string, value]
|
24
|
+
end
|
25
|
+
|
26
|
+
def important
|
27
|
+
s = scan(IMPORTANT)
|
28
|
+
return unless s
|
29
|
+
[:raw, s]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'sass/script'
|
2
|
+
require 'sass/script/css_lexer'
|
3
|
+
|
4
|
+
module Sass
|
5
|
+
module Script
|
6
|
+
# This is a subclass of {Parser} for use in parsing plain CSS properties.
|
7
|
+
#
|
8
|
+
# @see Sass::SCSS::CssParser
|
9
|
+
class CssParser < Parser
|
10
|
+
private
|
11
|
+
|
12
|
+
# @private
|
13
|
+
def lexer_class; CssLexer; end
|
14
|
+
|
15
|
+
# We need a production that only does /,
|
16
|
+
# since * and % aren't allowed in plain CSS
|
17
|
+
production :div, :unary_plus, :div
|
18
|
+
|
19
|
+
def string
|
20
|
+
tok = try_tok(:string)
|
21
|
+
return number unless tok
|
22
|
+
return if @lexer.peek && @lexer.peek.type == :begin_interpolation
|
23
|
+
literal_node(tok.value, tok.source_range)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Short-circuit all the SassScript-only productions
|
27
|
+
alias_method :interpolation, :space
|
28
|
+
alias_method :or_expr, :div
|
29
|
+
alias_method :unary_div, :ident
|
30
|
+
alias_method :paren, :string
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Sass
|
2
|
+
module Script
|
3
|
+
# An object tracking whether a warning has been emitted for a given script
|
4
|
+
# tree.
|
5
|
+
#
|
6
|
+
# This is shared among all objects in a script tree. Whenever any of those
|
7
|
+
# objects encounters a situation in which it wouldn't produce semantically
|
8
|
+
# identical CSS to its input, it calls \{#warn!\}. The first time \{#warn!}
|
9
|
+
# is called for a given warning object, it prints a deprecation warning.
|
10
|
+
class CssVariableWarning
|
11
|
+
def initialize
|
12
|
+
@warned = false
|
13
|
+
@value = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
# Sets the root of the script tree that this warning refers to.
|
17
|
+
#
|
18
|
+
# @param value [Sass::Script::Tree::Node]
|
19
|
+
def value=(value)
|
20
|
+
warn_called = @warned && !@value
|
21
|
+
@value = value
|
22
|
+
print_warning if warn_called
|
23
|
+
end
|
24
|
+
|
25
|
+
# The first time this is called, it prints a deprecation warning.
|
26
|
+
#
|
27
|
+
# This may be called before \{#value=}. If it is, the warning is emitted
|
28
|
+
# once the script tree is set.
|
29
|
+
def warn!
|
30
|
+
return if @warned
|
31
|
+
@warned = true
|
32
|
+
return unless @value
|
33
|
+
|
34
|
+
print_warning
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
# Prints this node's warning.
|
40
|
+
def print_warning
|
41
|
+
of_filename = " of #{@value.filename}" if @value.filename
|
42
|
+
Sass::Util.sass_warn(
|
43
|
+
"DEPRECATION WARNING on line #{@value.line}#{of_filename}:\n" +
|
44
|
+
"Sass 3.6 will change the way CSS variables are parsed. Instead of being parsed as\n" +
|
45
|
+
"normal properties, they will not allow any Sass-specific behavior other than \#{}.\n" +
|
46
|
+
"For forwards-compatibility, use \#{}:\n" +
|
47
|
+
"\n" +
|
48
|
+
" --variable: \#{#{@value.to_sass}};")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,2690 @@
|
|
1
|
+
require 'sass/script/value/helpers'
|
2
|
+
|
3
|
+
module Sass::Script
|
4
|
+
# @comment
|
5
|
+
# YARD can't handle some multiline tags, and we need really long tags for function declarations.
|
6
|
+
# rubocop:disable LineLength
|
7
|
+
# Methods in this module are accessible from the SassScript context.
|
8
|
+
# For example, you can write
|
9
|
+
#
|
10
|
+
# $color: hsl(120deg, 100%, 50%)
|
11
|
+
#
|
12
|
+
# and it will call {Functions#hsl}.
|
13
|
+
#
|
14
|
+
# The following functions are provided:
|
15
|
+
#
|
16
|
+
# *Note: These functions are described in more detail below.*
|
17
|
+
#
|
18
|
+
# ## RGB Functions
|
19
|
+
#
|
20
|
+
# \{#rgb rgb($red, $green, $blue)}
|
21
|
+
# : Creates a {Sass::Script::Value::Color Color} from red, green, and blue
|
22
|
+
# values.
|
23
|
+
#
|
24
|
+
# \{#rgba rgba($red, $green, $blue, $alpha)}
|
25
|
+
# : Creates a {Sass::Script::Value::Color Color} from red, green, blue, and
|
26
|
+
# alpha values.
|
27
|
+
#
|
28
|
+
# \{#red red($color)}
|
29
|
+
# : Gets the red component of a color.
|
30
|
+
#
|
31
|
+
# \{#green green($color)}
|
32
|
+
# : Gets the green component of a color.
|
33
|
+
#
|
34
|
+
# \{#blue blue($color)}
|
35
|
+
# : Gets the blue component of a color.
|
36
|
+
#
|
37
|
+
# \{#mix mix($color1, $color2, \[$weight\])}
|
38
|
+
# : Mixes two colors together.
|
39
|
+
#
|
40
|
+
# ## HSL Functions
|
41
|
+
#
|
42
|
+
# \{#hsl hsl($hue, $saturation, $lightness)}
|
43
|
+
# : Creates a {Sass::Script::Value::Color Color} from hue, saturation, and
|
44
|
+
# lightness values.
|
45
|
+
#
|
46
|
+
# \{#hsla hsla($hue, $saturation, $lightness, $alpha)}
|
47
|
+
# : Creates a {Sass::Script::Value::Color Color} from hue, saturation,
|
48
|
+
# lightness, and alpha values.
|
49
|
+
#
|
50
|
+
# \{#hue hue($color)}
|
51
|
+
# : Gets the hue component of a color.
|
52
|
+
#
|
53
|
+
# \{#saturation saturation($color)}
|
54
|
+
# : Gets the saturation component of a color.
|
55
|
+
#
|
56
|
+
# \{#lightness lightness($color)}
|
57
|
+
# : Gets the lightness component of a color.
|
58
|
+
#
|
59
|
+
# \{#adjust_hue adjust-hue($color, $degrees)}
|
60
|
+
# : Changes the hue of a color.
|
61
|
+
#
|
62
|
+
# \{#lighten lighten($color, $amount)}
|
63
|
+
# : Makes a color lighter.
|
64
|
+
#
|
65
|
+
# \{#darken darken($color, $amount)}
|
66
|
+
# : Makes a color darker.
|
67
|
+
#
|
68
|
+
# \{#saturate saturate($color, $amount)}
|
69
|
+
# : Makes a color more saturated.
|
70
|
+
#
|
71
|
+
# \{#desaturate desaturate($color, $amount)}
|
72
|
+
# : Makes a color less saturated.
|
73
|
+
#
|
74
|
+
# \{#grayscale grayscale($color)}
|
75
|
+
# : Converts a color to grayscale.
|
76
|
+
#
|
77
|
+
# \{#complement complement($color)}
|
78
|
+
# : Returns the complement of a color.
|
79
|
+
#
|
80
|
+
# \{#invert invert($color)}
|
81
|
+
# : Returns the inverse of a color.
|
82
|
+
#
|
83
|
+
# ## Opacity Functions
|
84
|
+
#
|
85
|
+
# \{#alpha alpha($color)} / \{#opacity opacity($color)}
|
86
|
+
# : Gets the alpha component (opacity) of a color.
|
87
|
+
#
|
88
|
+
# \{#rgba rgba($color, $alpha)}
|
89
|
+
# : Changes the alpha component for a color.
|
90
|
+
#
|
91
|
+
# \{#opacify opacify($color, $amount)} / \{#fade_in fade-in($color, $amount)}
|
92
|
+
# : Makes a color more opaque.
|
93
|
+
#
|
94
|
+
# \{#transparentize transparentize($color, $amount)} / \{#fade_out fade-out($color, $amount)}
|
95
|
+
# : Makes a color more transparent.
|
96
|
+
#
|
97
|
+
# ## Other Color Functions
|
98
|
+
#
|
99
|
+
# \{#adjust_color adjust-color($color, \[$red\], \[$green\], \[$blue\], \[$hue\], \[$saturation\], \[$lightness\], \[$alpha\])}
|
100
|
+
# : Increases or decreases one or more components of a color.
|
101
|
+
#
|
102
|
+
# \{#scale_color scale-color($color, \[$red\], \[$green\], \[$blue\], \[$saturation\], \[$lightness\], \[$alpha\])}
|
103
|
+
# : Fluidly scales one or more properties of a color.
|
104
|
+
#
|
105
|
+
# \{#change_color change-color($color, \[$red\], \[$green\], \[$blue\], \[$hue\], \[$saturation\], \[$lightness\], \[$alpha\])}
|
106
|
+
# : Changes one or more properties of a color.
|
107
|
+
#
|
108
|
+
# \{#ie_hex_str ie-hex-str($color)}
|
109
|
+
# : Converts a color into the format understood by IE filters.
|
110
|
+
#
|
111
|
+
# ## String Functions
|
112
|
+
#
|
113
|
+
# \{#unquote unquote($string)}
|
114
|
+
# : Removes quotes from a string.
|
115
|
+
#
|
116
|
+
# \{#quote quote($string)}
|
117
|
+
# : Adds quotes to a string.
|
118
|
+
#
|
119
|
+
# \{#str_length str-length($string)}
|
120
|
+
# : Returns the number of characters in a string.
|
121
|
+
#
|
122
|
+
# \{#str_insert str-insert($string, $insert, $index)}
|
123
|
+
# : Inserts `$insert` into `$string` at `$index`.
|
124
|
+
#
|
125
|
+
# \{#str_index str-index($string, $substring)}
|
126
|
+
# : Returns the index of the first occurrence of `$substring` in `$string`.
|
127
|
+
#
|
128
|
+
# \{#str_slice str-slice($string, $start-at, [$end-at])}
|
129
|
+
# : Extracts a substring from `$string`.
|
130
|
+
#
|
131
|
+
# \{#to_upper_case to-upper-case($string)}
|
132
|
+
# : Converts a string to upper case.
|
133
|
+
#
|
134
|
+
# \{#to_lower_case to-lower-case($string)}
|
135
|
+
# : Converts a string to lower case.
|
136
|
+
#
|
137
|
+
# ## Number Functions
|
138
|
+
#
|
139
|
+
# \{#percentage percentage($number)}
|
140
|
+
# : Converts a unitless number to a percentage.
|
141
|
+
#
|
142
|
+
# \{#round round($number)}
|
143
|
+
# : Rounds a number to the nearest whole number.
|
144
|
+
#
|
145
|
+
# \{#ceil ceil($number)}
|
146
|
+
# : Rounds a number up to the next whole number.
|
147
|
+
#
|
148
|
+
# \{#floor floor($number)}
|
149
|
+
# : Rounds a number down to the previous whole number.
|
150
|
+
#
|
151
|
+
# \{#abs abs($number)}
|
152
|
+
# : Returns the absolute value of a number.
|
153
|
+
#
|
154
|
+
# \{#min min($numbers...)\}
|
155
|
+
# : Finds the minimum of several numbers.
|
156
|
+
#
|
157
|
+
# \{#max max($numbers...)\}
|
158
|
+
# : Finds the maximum of several numbers.
|
159
|
+
#
|
160
|
+
# \{#random random([$limit])\}
|
161
|
+
# : Returns a random number.
|
162
|
+
#
|
163
|
+
# ## List Functions {#list-functions}
|
164
|
+
#
|
165
|
+
# Lists in Sass are immutable; all list functions return a new list rather
|
166
|
+
# than updating the existing list in-place.
|
167
|
+
#
|
168
|
+
# All list functions work for maps as well, treating them as lists of pairs.
|
169
|
+
#
|
170
|
+
# \{#length length($list)}
|
171
|
+
# : Returns the length of a list.
|
172
|
+
#
|
173
|
+
# \{#nth nth($list, $n)}
|
174
|
+
# : Returns a specific item in a list.
|
175
|
+
#
|
176
|
+
# \{#set-nth set-nth($list, $n, $value)}
|
177
|
+
# : Replaces the nth item in a list.
|
178
|
+
#
|
179
|
+
# \{#join join($list1, $list2, \[$separator\])}
|
180
|
+
# : Joins together two lists into one.
|
181
|
+
#
|
182
|
+
# \{#append append($list1, $val, \[$separator\])}
|
183
|
+
# : Appends a single value onto the end of a list.
|
184
|
+
#
|
185
|
+
# \{#zip zip($lists...)}
|
186
|
+
# : Combines several lists into a single multidimensional list.
|
187
|
+
#
|
188
|
+
# \{#index index($list, $value)}
|
189
|
+
# : Returns the position of a value within a list.
|
190
|
+
#
|
191
|
+
# \{#list_separator list-separator($list)}
|
192
|
+
# : Returns the separator of a list.
|
193
|
+
#
|
194
|
+
# ## Map Functions {#map-functions}
|
195
|
+
#
|
196
|
+
# Maps in Sass are immutable; all map functions return a new map rather than
|
197
|
+
# updating the existing map in-place.
|
198
|
+
#
|
199
|
+
# \{#map_get map-get($map, $key)}
|
200
|
+
# : Returns the value in a map associated with a given key.
|
201
|
+
#
|
202
|
+
# \{#map_merge map-merge($map1, $map2)}
|
203
|
+
# : Merges two maps together into a new map.
|
204
|
+
#
|
205
|
+
# \{#map_remove map-remove($map, $keys...)}
|
206
|
+
# : Returns a new map with keys removed.
|
207
|
+
#
|
208
|
+
# \{#map_keys map-keys($map)}
|
209
|
+
# : Returns a list of all keys in a map.
|
210
|
+
#
|
211
|
+
# \{#map_values map-values($map)}
|
212
|
+
# : Returns a list of all values in a map.
|
213
|
+
#
|
214
|
+
# \{#map_has_key map-has-key($map, $key)}
|
215
|
+
# : Returns whether a map has a value associated with a given key.
|
216
|
+
#
|
217
|
+
# \{#keywords keywords($args)}
|
218
|
+
# : Returns the keywords passed to a function that takes variable arguments.
|
219
|
+
#
|
220
|
+
# ## Selector Functions
|
221
|
+
#
|
222
|
+
# Selector functions are very liberal in the formats they support
|
223
|
+
# for selector arguments. They can take a plain string, a list of
|
224
|
+
# lists as returned by `&` or anything in between:
|
225
|
+
#
|
226
|
+
# * A plain string, such as `".foo .bar, .baz .bang"`.
|
227
|
+
# * A space-separated list of strings such as `(".foo" ".bar")`.
|
228
|
+
# * A comma-separated list of strings such as `(".foo .bar", ".baz .bang")`.
|
229
|
+
# * A comma-separated list of space-separated lists of strings such
|
230
|
+
# as `((".foo" ".bar"), (".baz" ".bang"))`.
|
231
|
+
#
|
232
|
+
# In general, selector functions allow placeholder selectors
|
233
|
+
# (`%foo`) but disallow parent-reference selectors (`&`).
|
234
|
+
#
|
235
|
+
# \{#selector_nest selector-nest($selectors...)}
|
236
|
+
# : Nests selector beneath one another like they would be nested in the
|
237
|
+
# stylesheet.
|
238
|
+
#
|
239
|
+
# \{#selector_append selector-append($selectors...)}
|
240
|
+
# : Appends selectors to one another without spaces in between.
|
241
|
+
#
|
242
|
+
# \{#selector_extend selector-extend($selector, $extendee, $extender)}
|
243
|
+
# : Extends `$extendee` with `$extender` within `$selector`.
|
244
|
+
#
|
245
|
+
# \{#selector_replace selector-replace($selector, $original, $replacement)}
|
246
|
+
# : Replaces `$original` with `$replacement` within `$selector`.
|
247
|
+
#
|
248
|
+
# \{#selector_unify selector-unify($selector1, $selector2)}
|
249
|
+
# : Unifies two selectors to produce a selector that matches
|
250
|
+
# elements matched by both.
|
251
|
+
#
|
252
|
+
# \{#is_superselector is-superselector($super, $sub)}
|
253
|
+
# : Returns whether `$super` matches all the elements `$sub` does, and
|
254
|
+
# possibly more.
|
255
|
+
#
|
256
|
+
# \{#simple_selectors simple-selectors($selector)}
|
257
|
+
# : Returns the simple selectors that comprise a compound selector.
|
258
|
+
#
|
259
|
+
# \{#selector_parse selector-parse($selector)}
|
260
|
+
# : Parses a selector into the format returned by `&`.
|
261
|
+
#
|
262
|
+
# ## Introspection Functions
|
263
|
+
#
|
264
|
+
# \{#feature_exists feature-exists($feature)}
|
265
|
+
# : Returns whether a feature exists in the current Sass runtime.
|
266
|
+
#
|
267
|
+
# \{#variable_exists variable-exists($name)}
|
268
|
+
# : Returns whether a variable with the given name exists in the current scope.
|
269
|
+
#
|
270
|
+
# \{#global_variable_exists global-variable-exists($name)}
|
271
|
+
# : Returns whether a variable with the given name exists in the global scope.
|
272
|
+
#
|
273
|
+
# \{#function_exists function-exists($name)}
|
274
|
+
# : Returns whether a function with the given name exists.
|
275
|
+
#
|
276
|
+
# \{#mixin_exists mixin-exists($name)}
|
277
|
+
# : Returns whether a mixin with the given name exists.
|
278
|
+
#
|
279
|
+
# \{#inspect inspect($value)}
|
280
|
+
# : Returns the string representation of a value as it would be represented in Sass.
|
281
|
+
#
|
282
|
+
# \{#type_of type-of($value)}
|
283
|
+
# : Returns the type of a value.
|
284
|
+
#
|
285
|
+
# \{#unit unit($number)}
|
286
|
+
# : Returns the unit(s) associated with a number.
|
287
|
+
#
|
288
|
+
# \{#unitless unitless($number)}
|
289
|
+
# : Returns whether a number has units.
|
290
|
+
#
|
291
|
+
# \{#comparable comparable($number1, $number2)}
|
292
|
+
# : Returns whether two numbers can be added, subtracted, or compared.
|
293
|
+
#
|
294
|
+
# \{#call call($name, $args...)}
|
295
|
+
# : Dynamically calls a Sass function.
|
296
|
+
#
|
297
|
+
# ## Miscellaneous Functions
|
298
|
+
#
|
299
|
+
# \{#if if($condition, $if-true, $if-false)}
|
300
|
+
# : Returns one of two values, depending on whether or not `$condition` is
|
301
|
+
# true.
|
302
|
+
#
|
303
|
+
# \{#unique_id unique-id()}
|
304
|
+
# : Returns a unique CSS identifier.
|
305
|
+
#
|
306
|
+
# ## Adding Custom Functions
|
307
|
+
#
|
308
|
+
# New Sass functions can be added by adding Ruby methods to this module.
|
309
|
+
# For example:
|
310
|
+
#
|
311
|
+
# module Sass::Script::Functions
|
312
|
+
# def reverse(string)
|
313
|
+
# assert_type string, :String
|
314
|
+
# Sass::Script::Value::String.new(string.value.reverse)
|
315
|
+
# end
|
316
|
+
# declare :reverse, [:string]
|
317
|
+
# end
|
318
|
+
#
|
319
|
+
# Calling {declare} tells Sass the argument names for your function.
|
320
|
+
# If omitted, the function will still work, but will not be able to accept keyword arguments.
|
321
|
+
# {declare} can also allow your function to take arbitrary keyword arguments.
|
322
|
+
#
|
323
|
+
# There are a few things to keep in mind when modifying this module.
|
324
|
+
# First of all, the arguments passed are {Value} objects.
|
325
|
+
# Value objects are also expected to be returned.
|
326
|
+
# This means that Ruby values must be unwrapped and wrapped.
|
327
|
+
#
|
328
|
+
# Most Value objects support the {Value::Base#value value} accessor for getting
|
329
|
+
# their Ruby values. Color objects, though, must be accessed using
|
330
|
+
# {Sass::Script::Value::Color#rgb rgb}, {Sass::Script::Value::Color#red red},
|
331
|
+
# {Sass::Script::Value::Color#blue green}, or {Sass::Script::Value::Color#blue
|
332
|
+
# blue}.
|
333
|
+
#
|
334
|
+
# Second, making Ruby functions accessible from Sass introduces the temptation
|
335
|
+
# to do things like database access within stylesheets.
|
336
|
+
# This is generally a bad idea;
|
337
|
+
# since Sass files are by default only compiled once,
|
338
|
+
# dynamic code is not a great fit.
|
339
|
+
#
|
340
|
+
# If you really, really need to compile Sass on each request,
|
341
|
+
# first make sure you have adequate caching set up.
|
342
|
+
# Then you can use {Sass::Engine} to render the code,
|
343
|
+
# using the {file:SASS_REFERENCE.md#custom-option `options` parameter}
|
344
|
+
# to pass in data that {EvaluationContext#options can be accessed}
|
345
|
+
# from your Sass functions.
|
346
|
+
#
|
347
|
+
# Within one of the functions in this module,
|
348
|
+
# methods of {EvaluationContext} can be used.
|
349
|
+
#
|
350
|
+
# ### Caveats
|
351
|
+
#
|
352
|
+
# When creating new {Value} objects within functions, be aware that it's not
|
353
|
+
# safe to call {Value::Base#to_s #to_s} (or other methods that use the string
|
354
|
+
# representation) on those objects without first setting {Tree::Node#options=
|
355
|
+
# the #options attribute}.
|
356
|
+
#
|
357
|
+
# @comment
|
358
|
+
# rubocop:enable LineLength
|
359
|
+
# rubocop:disable ModuleLength
|
360
|
+
module Functions
|
361
|
+
@signatures = {}
|
362
|
+
|
363
|
+
# A class representing a Sass function signature.
|
364
|
+
#
|
365
|
+
# @attr args [Array<String>] The names of the arguments to the function.
|
366
|
+
# @attr delayed_args [Array<String>] The names of the arguments whose evaluation should be
|
367
|
+
# delayed.
|
368
|
+
# @attr var_args [Boolean] Whether the function takes a variable number of arguments.
|
369
|
+
# @attr var_kwargs [Boolean] Whether the function takes an arbitrary set of keyword arguments.
|
370
|
+
Signature = Struct.new(:args, :delayed_args, :var_args, :var_kwargs, :deprecated)
|
371
|
+
|
372
|
+
# Declare a Sass signature for a Ruby-defined function.
|
373
|
+
# This includes the names of the arguments,
|
374
|
+
# whether the function takes a variable number of arguments,
|
375
|
+
# and whether the function takes an arbitrary set of keyword arguments.
|
376
|
+
#
|
377
|
+
# It's not necessary to declare a signature for a function.
|
378
|
+
# However, without a signature it won't support keyword arguments.
|
379
|
+
#
|
380
|
+
# A single function can have multiple signatures declared
|
381
|
+
# as long as each one takes a different number of arguments.
|
382
|
+
# It's also possible to declare multiple signatures
|
383
|
+
# that all take the same number of arguments,
|
384
|
+
# but none of them but the first will be used
|
385
|
+
# unless the user uses keyword arguments.
|
386
|
+
#
|
387
|
+
# @example
|
388
|
+
# declare :rgba, [:hex, :alpha]
|
389
|
+
# declare :rgba, [:red, :green, :blue, :alpha]
|
390
|
+
# declare :accepts_anything, [], :var_args => true, :var_kwargs => true
|
391
|
+
# declare :some_func, [:foo, :bar, :baz], :var_kwargs => true
|
392
|
+
#
|
393
|
+
# @param method_name [Symbol] The name of the method
|
394
|
+
# whose signature is being declared.
|
395
|
+
# @param args [Array<Symbol>] The names of the arguments for the function signature.
|
396
|
+
# @option options :var_args [Boolean] (false)
|
397
|
+
# Whether the function accepts a variable number of (unnamed) arguments
|
398
|
+
# in addition to the named arguments.
|
399
|
+
# @option options :var_kwargs [Boolean] (false)
|
400
|
+
# Whether the function accepts other keyword arguments
|
401
|
+
# in addition to those in `:args`.
|
402
|
+
# If this is true, the Ruby function will be passed a hash from strings
|
403
|
+
# to {Value}s as the last argument.
|
404
|
+
# In addition, if this is true and `:var_args` is not,
|
405
|
+
# Sass will ensure that the last argument passed is a hash.
|
406
|
+
def self.declare(method_name, args, options = {})
|
407
|
+
delayed_args = []
|
408
|
+
args = args.map do |a|
|
409
|
+
a = a.to_s
|
410
|
+
if a[0] == ?&
|
411
|
+
a = a[1..-1]
|
412
|
+
delayed_args << a
|
413
|
+
end
|
414
|
+
a
|
415
|
+
end
|
416
|
+
# We don't expose this functionality except to certain builtin methods.
|
417
|
+
if delayed_args.any? && method_name != :if
|
418
|
+
raise ArgumentError.new("Delayed arguments are not allowed for method #{method_name}")
|
419
|
+
end
|
420
|
+
@signatures[method_name] ||= []
|
421
|
+
@signatures[method_name] << Signature.new(
|
422
|
+
args,
|
423
|
+
delayed_args,
|
424
|
+
options[:var_args],
|
425
|
+
options[:var_kwargs],
|
426
|
+
options[:deprecated] && options[:deprecated].map {|a| a.to_s})
|
427
|
+
end
|
428
|
+
|
429
|
+
# Determine the correct signature for the number of arguments
|
430
|
+
# passed in for a given function.
|
431
|
+
# If no signatures match, the first signature is returned for error messaging.
|
432
|
+
#
|
433
|
+
# @param method_name [Symbol] The name of the Ruby function to be called.
|
434
|
+
# @param arg_arity [Fixnum] The number of unnamed arguments the function was passed.
|
435
|
+
# @param kwarg_arity [Fixnum] The number of keyword arguments the function was passed.
|
436
|
+
#
|
437
|
+
# @return [{Symbol => Object}, nil]
|
438
|
+
# The signature options for the matching signature,
|
439
|
+
# or nil if no signatures are declared for this function. See {declare}.
|
440
|
+
def self.signature(method_name, arg_arity, kwarg_arity)
|
441
|
+
return unless @signatures[method_name]
|
442
|
+
@signatures[method_name].each do |signature|
|
443
|
+
sig_arity = signature.args.size
|
444
|
+
return signature if sig_arity == arg_arity + kwarg_arity
|
445
|
+
next unless sig_arity < arg_arity + kwarg_arity
|
446
|
+
|
447
|
+
# We have enough args.
|
448
|
+
# Now we need to figure out which args are varargs
|
449
|
+
# and if the signature allows them.
|
450
|
+
t_arg_arity, t_kwarg_arity = arg_arity, kwarg_arity
|
451
|
+
if sig_arity > t_arg_arity
|
452
|
+
# we transfer some kwargs arity to args arity
|
453
|
+
# if it does not have enough args -- assuming the names will work out.
|
454
|
+
t_kwarg_arity -= (sig_arity - t_arg_arity)
|
455
|
+
t_arg_arity = sig_arity
|
456
|
+
end
|
457
|
+
|
458
|
+
if (t_arg_arity == sig_arity || t_arg_arity > sig_arity && signature.var_args) &&
|
459
|
+
(t_kwarg_arity == 0 || t_kwarg_arity > 0 && signature.var_kwargs)
|
460
|
+
return signature
|
461
|
+
end
|
462
|
+
end
|
463
|
+
@signatures[method_name].first
|
464
|
+
end
|
465
|
+
|
466
|
+
# Sets the random seed used by Sass's internal random number generator.
|
467
|
+
#
|
468
|
+
# This can be used to ensure consistent random number sequences which
|
469
|
+
# allows for consistent results when testing, etc.
|
470
|
+
#
|
471
|
+
# @param seed [Integer]
|
472
|
+
# @return [Integer] The same seed.
|
473
|
+
def self.random_seed=(seed)
|
474
|
+
@random_number_generator = Sass::Util::CrossPlatformRandom.new(seed)
|
475
|
+
end
|
476
|
+
|
477
|
+
# Get Sass's internal random number generator.
|
478
|
+
#
|
479
|
+
# @return [Random]
|
480
|
+
def self.random_number_generator
|
481
|
+
@random_number_generator ||= Sass::Util::CrossPlatformRandom.new
|
482
|
+
end
|
483
|
+
|
484
|
+
# The context in which methods in {Script::Functions} are evaluated.
|
485
|
+
# That means that all instance methods of {EvaluationContext}
|
486
|
+
# are available to use in functions.
|
487
|
+
class EvaluationContext
|
488
|
+
include Functions
|
489
|
+
include Value::Helpers
|
490
|
+
|
491
|
+
# The human-readable names for [Sass::Script::Value::Base]. The default is
|
492
|
+
# just the downcased name of the type.
|
493
|
+
TYPE_NAMES = {:ArgList => 'variable argument list'}
|
494
|
+
|
495
|
+
# The environment for this function. This environment's
|
496
|
+
# {Environment#parent} is the global environment, and its
|
497
|
+
# {Environment#caller} is a read-only view of the local environment of the
|
498
|
+
# caller of this function.
|
499
|
+
#
|
500
|
+
# @return [Environment]
|
501
|
+
attr_reader :environment
|
502
|
+
|
503
|
+
# The options hash for the {Sass::Engine} that is processing the function call
|
504
|
+
#
|
505
|
+
# @return [{Symbol => Object}]
|
506
|
+
attr_reader :options
|
507
|
+
|
508
|
+
# @param environment [Environment] See \{#environment}
|
509
|
+
def initialize(environment)
|
510
|
+
@environment = environment
|
511
|
+
@options = environment.options
|
512
|
+
end
|
513
|
+
|
514
|
+
# Asserts that the type of a given SassScript value
|
515
|
+
# is the expected type (designated by a symbol).
|
516
|
+
#
|
517
|
+
# Valid types are `:Bool`, `:Color`, `:Number`, and `:String`.
|
518
|
+
# Note that `:String` will match both double-quoted strings
|
519
|
+
# and unquoted identifiers.
|
520
|
+
#
|
521
|
+
# @example
|
522
|
+
# assert_type value, :String
|
523
|
+
# assert_type value, :Number
|
524
|
+
# @param value [Sass::Script::Value::Base] A SassScript value
|
525
|
+
# @param type [Symbol] The name of the type the value is expected to be
|
526
|
+
# @param name [String, Symbol, nil] The name of the argument.
|
527
|
+
# @raise [ArgumentError] if value is not of the correct type.
|
528
|
+
def assert_type(value, type, name = nil)
|
529
|
+
klass = Sass::Script::Value.const_get(type)
|
530
|
+
if value.is_a?(klass)
|
531
|
+
value.check_deprecated_interp if type == :String
|
532
|
+
return
|
533
|
+
end
|
534
|
+
|
535
|
+
return if value.is_a?(Sass::Script::Value::List) && type == :Map && value.value.empty?
|
536
|
+
err = "#{value.inspect} is not a #{TYPE_NAMES[type] || type.to_s.downcase}"
|
537
|
+
err = "$#{name.to_s.tr('_', '-')}: " + err if name
|
538
|
+
raise ArgumentError.new(err)
|
539
|
+
end
|
540
|
+
|
541
|
+
# Asserts that the unit of the number is as expected.
|
542
|
+
#
|
543
|
+
# @example
|
544
|
+
# assert_unit number, "px"
|
545
|
+
# assert_unit number, nil
|
546
|
+
# @param number [Sass::Script::Value::Number] The number to be validated.
|
547
|
+
# @param unit [::String]
|
548
|
+
# The unit that the number must have.
|
549
|
+
# If nil, the number must be unitless.
|
550
|
+
# @param name [::String] The name of the parameter being validated.
|
551
|
+
# @raise [ArgumentError] if number is not of the correct unit or is not a number.
|
552
|
+
def assert_unit(number, unit, name = nil)
|
553
|
+
assert_type number, :Number, name
|
554
|
+
return if number.is_unit?(unit)
|
555
|
+
expectation = unit ? "have a unit of #{unit}" : "be unitless"
|
556
|
+
if name
|
557
|
+
raise ArgumentError.new("Expected $#{name} to #{expectation} but got #{number}")
|
558
|
+
else
|
559
|
+
raise ArgumentError.new("Expected #{number} to #{expectation}")
|
560
|
+
end
|
561
|
+
end
|
562
|
+
|
563
|
+
# Asserts that the value is an integer.
|
564
|
+
#
|
565
|
+
# @example
|
566
|
+
# assert_integer 2px
|
567
|
+
# assert_integer 2.5px
|
568
|
+
# => SyntaxError: "Expected 2.5px to be an integer"
|
569
|
+
# assert_integer 2.5px, "width"
|
570
|
+
# => SyntaxError: "Expected width to be an integer but got 2.5px"
|
571
|
+
# @param number [Sass::Script::Value::Base] The value to be validated.
|
572
|
+
# @param name [::String] The name of the parameter being validated.
|
573
|
+
# @raise [ArgumentError] if number is not an integer or is not a number.
|
574
|
+
def assert_integer(number, name = nil)
|
575
|
+
assert_type number, :Number, name
|
576
|
+
return if number.int?
|
577
|
+
if name
|
578
|
+
raise ArgumentError.new("Expected $#{name} to be an integer but got #{number}")
|
579
|
+
else
|
580
|
+
raise ArgumentError.new("Expected #{number} to be an integer")
|
581
|
+
end
|
582
|
+
end
|
583
|
+
|
584
|
+
# Performs a node that has been delayed for execution.
|
585
|
+
#
|
586
|
+
# @private
|
587
|
+
# @param node [Sass::Script::Tree::Node,
|
588
|
+
# Sass::Script::Value::Base] When this is a tree node, it's
|
589
|
+
# performed in the caller's environment. When it's a value
|
590
|
+
# (which can happen when the value had to be performed already
|
591
|
+
# -- like for a splat), it's returned as-is.
|
592
|
+
# @param env [Sass::Environment] The environment within which to perform the node.
|
593
|
+
# Defaults to the (read-only) environment of the caller.
|
594
|
+
def perform(node, env = environment.caller)
|
595
|
+
if node.is_a?(Sass::Script::Value::Base)
|
596
|
+
node
|
597
|
+
else
|
598
|
+
node.perform(env)
|
599
|
+
end
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
class << self
|
604
|
+
# Returns whether user function with a given name exists.
|
605
|
+
#
|
606
|
+
# @param function_name [String]
|
607
|
+
# @return [Boolean]
|
608
|
+
alias_method :callable?, :public_method_defined?
|
609
|
+
|
610
|
+
private
|
611
|
+
|
612
|
+
def include(*args)
|
613
|
+
r = super
|
614
|
+
# We have to re-include ourselves into EvaluationContext to work around
|
615
|
+
# an icky Ruby restriction.
|
616
|
+
EvaluationContext.send :include, self
|
617
|
+
r
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
# Creates a {Sass::Script::Value::Color Color} object from red, green, and
|
622
|
+
# blue values.
|
623
|
+
#
|
624
|
+
# @see #rgba
|
625
|
+
# @overload rgb($red, $green, $blue)
|
626
|
+
# @param $red [Sass::Script::Value::Number] The amount of red in the color.
|
627
|
+
# Must be between 0 and 255 inclusive, or between `0%` and `100%`
|
628
|
+
# inclusive
|
629
|
+
# @param $green [Sass::Script::Value::Number] The amount of green in the
|
630
|
+
# color. Must be between 0 and 255 inclusive, or between `0%` and `100%`
|
631
|
+
# inclusive
|
632
|
+
# @param $blue [Sass::Script::Value::Number] The amount of blue in the
|
633
|
+
# color. Must be between 0 and 255 inclusive, or between `0%` and `100%`
|
634
|
+
# inclusive
|
635
|
+
# @return [Sass::Script::Value::Color]
|
636
|
+
# @raise [ArgumentError] if any parameter is the wrong type or out of bounds
|
637
|
+
def rgb(red, green, blue)
|
638
|
+
if calc?(red) || calc?(green) || calc?(blue)
|
639
|
+
return unquoted_string("rgb(#{red}, #{green}, #{blue})")
|
640
|
+
end
|
641
|
+
assert_type red, :Number, :red
|
642
|
+
assert_type green, :Number, :green
|
643
|
+
assert_type blue, :Number, :blue
|
644
|
+
|
645
|
+
color_attrs = [red, green, blue].map do |c|
|
646
|
+
if c.is_unit?("%")
|
647
|
+
c.value * 255 / 100.0
|
648
|
+
elsif c.unitless?
|
649
|
+
c.value
|
650
|
+
else
|
651
|
+
raise ArgumentError.new("Expected #{c} to be unitless or have a unit of % but got #{c}")
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
# Don't store the string representation for function-created colors, both
|
656
|
+
# because it's not very useful and because some functions aren't supported
|
657
|
+
# on older browsers.
|
658
|
+
Sass::Script::Value::Color.new(color_attrs)
|
659
|
+
end
|
660
|
+
declare :rgb, [:red, :green, :blue]
|
661
|
+
|
662
|
+
# Creates a {Sass::Script::Value::Color Color} from red, green, blue, and
|
663
|
+
# alpha values.
|
664
|
+
# @see #rgb
|
665
|
+
#
|
666
|
+
# @overload rgba($red, $green, $blue, $alpha)
|
667
|
+
# @param $red [Sass::Script::Value::Number] The amount of red in the
|
668
|
+
# color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
|
669
|
+
# @param $green [Sass::Script::Value::Number] The amount of green in the
|
670
|
+
# color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
|
671
|
+
# @param $blue [Sass::Script::Value::Number] The amount of blue in the
|
672
|
+
# color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
|
673
|
+
# @param $alpha [Sass::Script::Value::Number] The opacity of the color.
|
674
|
+
# Must be between 0 and 1 inclusive
|
675
|
+
# @return [Sass::Script::Value::Color]
|
676
|
+
# @raise [ArgumentError] if any parameter is the wrong type or out of
|
677
|
+
# bounds
|
678
|
+
#
|
679
|
+
# @overload rgba($color, $alpha)
|
680
|
+
# Sets the opacity of an existing color.
|
681
|
+
#
|
682
|
+
# @example
|
683
|
+
# rgba(#102030, 0.5) => rgba(16, 32, 48, 0.5)
|
684
|
+
# rgba(blue, 0.2) => rgba(0, 0, 255, 0.2)
|
685
|
+
#
|
686
|
+
# @param $color [Sass::Script::Value::Color] The color whose opacity will
|
687
|
+
# be changed.
|
688
|
+
# @param $alpha [Sass::Script::Value::Number] The new opacity of the
|
689
|
+
# color. Must be between 0 and 1 inclusive
|
690
|
+
# @return [Sass::Script::Value::Color]
|
691
|
+
# @raise [ArgumentError] if `$alpha` is out of bounds or either parameter
|
692
|
+
# is the wrong type
|
693
|
+
def rgba(*args)
|
694
|
+
case args.size
|
695
|
+
when 2
|
696
|
+
color, alpha = args
|
697
|
+
|
698
|
+
assert_type color, :Color, :color
|
699
|
+
if calc?(alpha)
|
700
|
+
unquoted_string("rgba(#{color.red}, #{color.green}, #{color.blue}, #{alpha})")
|
701
|
+
else
|
702
|
+
assert_type alpha, :Number, :alpha
|
703
|
+
check_alpha_unit alpha, 'rgba'
|
704
|
+
color.with(:alpha => alpha.value)
|
705
|
+
end
|
706
|
+
when 4
|
707
|
+
red, green, blue, alpha = args
|
708
|
+
if calc?(red) || calc?(green) || calc?(blue) || calc?(alpha)
|
709
|
+
unquoted_string("rgba(#{red}, #{green}, #{blue}, #{alpha})")
|
710
|
+
else
|
711
|
+
rgba(rgb(red, green, blue), alpha)
|
712
|
+
end
|
713
|
+
else
|
714
|
+
raise ArgumentError.new("wrong number of arguments (#{args.size} for 4)")
|
715
|
+
end
|
716
|
+
end
|
717
|
+
declare :rgba, [:red, :green, :blue, :alpha]
|
718
|
+
declare :rgba, [:color, :alpha]
|
719
|
+
|
720
|
+
# Creates a {Sass::Script::Value::Color Color} from hue, saturation, and
|
721
|
+
# lightness values. Uses the algorithm from the [CSS3 spec][].
|
722
|
+
#
|
723
|
+
# [CSS3 spec]: http://www.w3.org/TR/css3-color/#hsl-color
|
724
|
+
#
|
725
|
+
# @see #hsla
|
726
|
+
# @overload hsl($hue, $saturation, $lightness)
|
727
|
+
# @param $hue [Sass::Script::Value::Number] The hue of the color. Should be
|
728
|
+
# between 0 and 360 degrees, inclusive
|
729
|
+
# @param $saturation [Sass::Script::Value::Number] The saturation of the
|
730
|
+
# color. Must be between `0%` and `100%`, inclusive
|
731
|
+
# @param $lightness [Sass::Script::Value::Number] The lightness of the
|
732
|
+
# color. Must be between `0%` and `100%`, inclusive
|
733
|
+
# @return [Sass::Script::Value::Color]
|
734
|
+
# @raise [ArgumentError] if `$saturation` or `$lightness` are out of bounds
|
735
|
+
# or any parameter is the wrong type
|
736
|
+
def hsl(hue, saturation, lightness)
|
737
|
+
if calc?(hue) || calc?(saturation) || calc?(lightness)
|
738
|
+
unquoted_string("hsl(#{hue}, #{saturation}, #{lightness})")
|
739
|
+
else
|
740
|
+
hsla(hue, saturation, lightness, number(1))
|
741
|
+
end
|
742
|
+
end
|
743
|
+
declare :hsl, [:hue, :saturation, :lightness]
|
744
|
+
|
745
|
+
# Creates a {Sass::Script::Value::Color Color} from hue,
|
746
|
+
# saturation, lightness, and alpha values. Uses the algorithm from
|
747
|
+
# the [CSS3 spec][].
|
748
|
+
#
|
749
|
+
# [CSS3 spec]: http://www.w3.org/TR/css3-color/#hsl-color
|
750
|
+
#
|
751
|
+
# @see #hsl
|
752
|
+
# @overload hsla($hue, $saturation, $lightness, $alpha)
|
753
|
+
# @param $hue [Sass::Script::Value::Number] The hue of the color. Should be
|
754
|
+
# between 0 and 360 degrees, inclusive
|
755
|
+
# @param $saturation [Sass::Script::Value::Number] The saturation of the
|
756
|
+
# color. Must be between `0%` and `100%`, inclusive
|
757
|
+
# @param $lightness [Sass::Script::Value::Number] The lightness of the
|
758
|
+
# color. Must be between `0%` and `100%`, inclusive
|
759
|
+
# @param $alpha [Sass::Script::Value::Number] The opacity of the color. Must
|
760
|
+
# be between 0 and 1, inclusive
|
761
|
+
# @return [Sass::Script::Value::Color]
|
762
|
+
# @raise [ArgumentError] if `$saturation`, `$lightness`, or `$alpha` are out
|
763
|
+
# of bounds or any parameter is the wrong type
|
764
|
+
def hsla(hue, saturation, lightness, alpha)
|
765
|
+
if calc?(hue) || calc?(saturation) || calc?(lightness) || calc?(alpha)
|
766
|
+
return unquoted_string("hsla(#{hue}, #{saturation}, #{lightness}, #{alpha})")
|
767
|
+
end
|
768
|
+
assert_type hue, :Number, :hue
|
769
|
+
assert_type saturation, :Number, :saturation
|
770
|
+
assert_type lightness, :Number, :lightness
|
771
|
+
assert_type alpha, :Number, :alpha
|
772
|
+
check_alpha_unit alpha, 'hsla'
|
773
|
+
|
774
|
+
h = hue.value
|
775
|
+
s = saturation.value
|
776
|
+
l = lightness.value
|
777
|
+
|
778
|
+
# Don't store the string representation for function-created colors, both
|
779
|
+
# because it's not very useful and because some functions aren't supported
|
780
|
+
# on older browsers.
|
781
|
+
Sass::Script::Value::Color.new(
|
782
|
+
:hue => h, :saturation => s, :lightness => l, :alpha => alpha.value)
|
783
|
+
end
|
784
|
+
declare :hsla, [:hue, :saturation, :lightness, :alpha]
|
785
|
+
|
786
|
+
# Gets the red component of a color. Calculated from HSL where necessary via
|
787
|
+
# [this algorithm][hsl-to-rgb].
|
788
|
+
#
|
789
|
+
# [hsl-to-rgb]: http://www.w3.org/TR/css3-color/#hsl-color
|
790
|
+
#
|
791
|
+
# @overload red($color)
|
792
|
+
# @param $color [Sass::Script::Value::Color]
|
793
|
+
# @return [Sass::Script::Value::Number] The red component, between 0 and 255
|
794
|
+
# inclusive
|
795
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
796
|
+
def red(color)
|
797
|
+
assert_type color, :Color, :color
|
798
|
+
number(color.red)
|
799
|
+
end
|
800
|
+
declare :red, [:color]
|
801
|
+
|
802
|
+
# Gets the green component of a color. Calculated from HSL where necessary
|
803
|
+
# via [this algorithm][hsl-to-rgb].
|
804
|
+
#
|
805
|
+
# [hsl-to-rgb]: http://www.w3.org/TR/css3-color/#hsl-color
|
806
|
+
#
|
807
|
+
# @overload green($color)
|
808
|
+
# @param $color [Sass::Script::Value::Color]
|
809
|
+
# @return [Sass::Script::Value::Number] The green component, between 0 and
|
810
|
+
# 255 inclusive
|
811
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
812
|
+
def green(color)
|
813
|
+
assert_type color, :Color, :color
|
814
|
+
number(color.green)
|
815
|
+
end
|
816
|
+
declare :green, [:color]
|
817
|
+
|
818
|
+
# Gets the blue component of a color. Calculated from HSL where necessary
|
819
|
+
# via [this algorithm][hsl-to-rgb].
|
820
|
+
#
|
821
|
+
# [hsl-to-rgb]: http://www.w3.org/TR/css3-color/#hsl-color
|
822
|
+
#
|
823
|
+
# @overload blue($color)
|
824
|
+
# @param $color [Sass::Script::Value::Color]
|
825
|
+
# @return [Sass::Script::Value::Number] The blue component, between 0 and
|
826
|
+
# 255 inclusive
|
827
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
828
|
+
def blue(color)
|
829
|
+
assert_type color, :Color, :color
|
830
|
+
number(color.blue)
|
831
|
+
end
|
832
|
+
declare :blue, [:color]
|
833
|
+
|
834
|
+
# Returns the hue component of a color. See [the CSS3 HSL
|
835
|
+
# specification][hsl]. Calculated from RGB where necessary via [this
|
836
|
+
# algorithm][rgb-to-hsl].
|
837
|
+
#
|
838
|
+
# [hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
839
|
+
# [rgb-to-hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
840
|
+
#
|
841
|
+
# @overload hue($color)
|
842
|
+
# @param $color [Sass::Script::Value::Color]
|
843
|
+
# @return [Sass::Script::Value::Number] The hue component, between 0deg and
|
844
|
+
# 360deg
|
845
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
846
|
+
def hue(color)
|
847
|
+
assert_type color, :Color, :color
|
848
|
+
number(color.hue, "deg")
|
849
|
+
end
|
850
|
+
declare :hue, [:color]
|
851
|
+
|
852
|
+
# Returns the saturation component of a color. See [the CSS3 HSL
|
853
|
+
# specification][hsl]. Calculated from RGB where necessary via [this
|
854
|
+
# algorithm][rgb-to-hsl].
|
855
|
+
#
|
856
|
+
# [hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
857
|
+
# [rgb-to-hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
858
|
+
#
|
859
|
+
# @overload saturation($color)
|
860
|
+
# @param $color [Sass::Script::Value::Color]
|
861
|
+
# @return [Sass::Script::Value::Number] The saturation component, between 0%
|
862
|
+
# and 100%
|
863
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
864
|
+
def saturation(color)
|
865
|
+
assert_type color, :Color, :color
|
866
|
+
number(color.saturation, "%")
|
867
|
+
end
|
868
|
+
declare :saturation, [:color]
|
869
|
+
|
870
|
+
# Returns the lightness component of a color. See [the CSS3 HSL
|
871
|
+
# specification][hsl]. Calculated from RGB where necessary via [this
|
872
|
+
# algorithm][rgb-to-hsl].
|
873
|
+
#
|
874
|
+
# [hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
875
|
+
# [rgb-to-hsl]: http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
|
876
|
+
#
|
877
|
+
# @overload lightness($color)
|
878
|
+
# @param $color [Sass::Script::Value::Color]
|
879
|
+
# @return [Sass::Script::Value::Number] The lightness component, between 0%
|
880
|
+
# and 100%
|
881
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
882
|
+
def lightness(color)
|
883
|
+
assert_type color, :Color, :color
|
884
|
+
number(color.lightness, "%")
|
885
|
+
end
|
886
|
+
declare :lightness, [:color]
|
887
|
+
|
888
|
+
# Returns the alpha component (opacity) of a color. This is 1 unless
|
889
|
+
# otherwise specified.
|
890
|
+
#
|
891
|
+
# This function also supports the proprietary Microsoft `alpha(opacity=20)`
|
892
|
+
# syntax as a special case.
|
893
|
+
#
|
894
|
+
# @overload alpha($color)
|
895
|
+
# @param $color [Sass::Script::Value::Color]
|
896
|
+
# @return [Sass::Script::Value::Number] The alpha component, between 0 and 1
|
897
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
898
|
+
def alpha(*args)
|
899
|
+
if args.all? do |a|
|
900
|
+
a.is_a?(Sass::Script::Value::String) && a.type == :identifier &&
|
901
|
+
a.value =~ /^[a-zA-Z]+\s*=/
|
902
|
+
end
|
903
|
+
# Support the proprietary MS alpha() function
|
904
|
+
return identifier("alpha(#{args.map {|a| a.to_s}.join(', ')})")
|
905
|
+
end
|
906
|
+
|
907
|
+
raise ArgumentError.new("wrong number of arguments (#{args.size} for 1)") if args.size != 1
|
908
|
+
|
909
|
+
assert_type args.first, :Color, :color
|
910
|
+
number(args.first.alpha)
|
911
|
+
end
|
912
|
+
declare :alpha, [:color]
|
913
|
+
|
914
|
+
# Returns the alpha component (opacity) of a color. This is 1 unless
|
915
|
+
# otherwise specified.
|
916
|
+
#
|
917
|
+
# @overload opacity($color)
|
918
|
+
# @param $color [Sass::Script::Value::Color]
|
919
|
+
# @return [Sass::Script::Value::Number] The alpha component, between 0 and 1
|
920
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
921
|
+
def opacity(color)
|
922
|
+
if color.is_a?(Sass::Script::Value::Number)
|
923
|
+
return identifier("opacity(#{color})")
|
924
|
+
end
|
925
|
+
assert_type color, :Color, :color
|
926
|
+
number(color.alpha)
|
927
|
+
end
|
928
|
+
declare :opacity, [:color]
|
929
|
+
|
930
|
+
# Makes a color more opaque. Takes a color and a number between 0 and 1, and
|
931
|
+
# returns a color with the opacity increased by that amount.
|
932
|
+
#
|
933
|
+
# @see #transparentize
|
934
|
+
# @example
|
935
|
+
# opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
|
936
|
+
# opacify(rgba(0, 0, 17, 0.8), 0.2) => #001
|
937
|
+
# @overload opacify($color, $amount)
|
938
|
+
# @param $color [Sass::Script::Value::Color]
|
939
|
+
# @param $amount [Sass::Script::Value::Number] The amount to increase the
|
940
|
+
# opacity by, between 0 and 1
|
941
|
+
# @return [Sass::Script::Value::Color]
|
942
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
943
|
+
# is the wrong type
|
944
|
+
def opacify(color, amount)
|
945
|
+
_adjust(color, amount, :alpha, 0..1, :+)
|
946
|
+
end
|
947
|
+
declare :opacify, [:color, :amount]
|
948
|
+
|
949
|
+
alias_method :fade_in, :opacify
|
950
|
+
declare :fade_in, [:color, :amount]
|
951
|
+
|
952
|
+
# Makes a color more transparent. Takes a color and a number between 0 and
|
953
|
+
# 1, and returns a color with the opacity decreased by that amount.
|
954
|
+
#
|
955
|
+
# @see #opacify
|
956
|
+
# @example
|
957
|
+
# transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
|
958
|
+
# transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)
|
959
|
+
# @overload transparentize($color, $amount)
|
960
|
+
# @param $color [Sass::Script::Value::Color]
|
961
|
+
# @param $amount [Sass::Script::Value::Number] The amount to decrease the
|
962
|
+
# opacity by, between 0 and 1
|
963
|
+
# @return [Sass::Script::Value::Color]
|
964
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
965
|
+
# is the wrong type
|
966
|
+
def transparentize(color, amount)
|
967
|
+
_adjust(color, amount, :alpha, 0..1, :-)
|
968
|
+
end
|
969
|
+
declare :transparentize, [:color, :amount]
|
970
|
+
|
971
|
+
alias_method :fade_out, :transparentize
|
972
|
+
declare :fade_out, [:color, :amount]
|
973
|
+
|
974
|
+
# Makes a color lighter. Takes a color and a number between `0%` and `100%`,
|
975
|
+
# and returns a color with the lightness increased by that amount.
|
976
|
+
#
|
977
|
+
# @see #darken
|
978
|
+
# @example
|
979
|
+
# lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30)
|
980
|
+
# lighten(#800, 20%) => #e00
|
981
|
+
# @overload lighten($color, $amount)
|
982
|
+
# @param $color [Sass::Script::Value::Color]
|
983
|
+
# @param $amount [Sass::Script::Value::Number] The amount to increase the
|
984
|
+
# lightness by, between `0%` and `100%`
|
985
|
+
# @return [Sass::Script::Value::Color]
|
986
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
987
|
+
# is the wrong type
|
988
|
+
def lighten(color, amount)
|
989
|
+
_adjust(color, amount, :lightness, 0..100, :+, "%")
|
990
|
+
end
|
991
|
+
declare :lighten, [:color, :amount]
|
992
|
+
|
993
|
+
# Makes a color darker. Takes a color and a number between 0% and 100%, and
|
994
|
+
# returns a color with the lightness decreased by that amount.
|
995
|
+
#
|
996
|
+
# @see #lighten
|
997
|
+
# @example
|
998
|
+
# darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
|
999
|
+
# darken(#800, 20%) => #200
|
1000
|
+
# @overload darken($color, $amount)
|
1001
|
+
# @param $color [Sass::Script::Value::Color]
|
1002
|
+
# @param $amount [Sass::Script::Value::Number] The amount to decrease the
|
1003
|
+
# lightness by, between `0%` and `100%`
|
1004
|
+
# @return [Sass::Script::Value::Color]
|
1005
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
1006
|
+
# is the wrong type
|
1007
|
+
def darken(color, amount)
|
1008
|
+
_adjust(color, amount, :lightness, 0..100, :-, "%")
|
1009
|
+
end
|
1010
|
+
declare :darken, [:color, :amount]
|
1011
|
+
|
1012
|
+
# Makes a color more saturated. Takes a color and a number between 0% and
|
1013
|
+
# 100%, and returns a color with the saturation increased by that amount.
|
1014
|
+
#
|
1015
|
+
# @see #desaturate
|
1016
|
+
# @example
|
1017
|
+
# saturate(hsl(120, 30%, 90%), 20%) => hsl(120, 50%, 90%)
|
1018
|
+
# saturate(#855, 20%) => #9e3f3f
|
1019
|
+
# @overload saturate($color, $amount)
|
1020
|
+
# @param $color [Sass::Script::Value::Color]
|
1021
|
+
# @param $amount [Sass::Script::Value::Number] The amount to increase the
|
1022
|
+
# saturation by, between `0%` and `100%`
|
1023
|
+
# @return [Sass::Script::Value::Color]
|
1024
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
1025
|
+
# is the wrong type
|
1026
|
+
def saturate(color, amount = nil)
|
1027
|
+
# Support the filter effects definition of saturate.
|
1028
|
+
# https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
|
1029
|
+
return identifier("saturate(#{color})") if amount.nil?
|
1030
|
+
_adjust(color, amount, :saturation, 0..100, :+, "%")
|
1031
|
+
end
|
1032
|
+
declare :saturate, [:color, :amount]
|
1033
|
+
declare :saturate, [:amount]
|
1034
|
+
|
1035
|
+
# Makes a color less saturated. Takes a color and a number between 0% and
|
1036
|
+
# 100%, and returns a color with the saturation decreased by that value.
|
1037
|
+
#
|
1038
|
+
# @see #saturate
|
1039
|
+
# @example
|
1040
|
+
# desaturate(hsl(120, 30%, 90%), 20%) => hsl(120, 10%, 90%)
|
1041
|
+
# desaturate(#855, 20%) => #726b6b
|
1042
|
+
# @overload desaturate($color, $amount)
|
1043
|
+
# @param $color [Sass::Script::Value::Color]
|
1044
|
+
# @param $amount [Sass::Script::Value::Number] The amount to decrease the
|
1045
|
+
# saturation by, between `0%` and `100%`
|
1046
|
+
# @return [Sass::Script::Value::Color]
|
1047
|
+
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
1048
|
+
# is the wrong type
|
1049
|
+
def desaturate(color, amount)
|
1050
|
+
_adjust(color, amount, :saturation, 0..100, :-, "%")
|
1051
|
+
end
|
1052
|
+
declare :desaturate, [:color, :amount]
|
1053
|
+
|
1054
|
+
# Changes the hue of a color. Takes a color and a number of degrees (usually
|
1055
|
+
# between `-360deg` and `360deg`), and returns a color with the hue rotated
|
1056
|
+
# along the color wheel by that amount.
|
1057
|
+
#
|
1058
|
+
# @example
|
1059
|
+
# adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
|
1060
|
+
# adjust-hue(hsl(120, 30%, 90%), -60deg) => hsl(60, 30%, 90%)
|
1061
|
+
# adjust-hue(#811, 45deg) => #886a11
|
1062
|
+
# @overload adjust_hue($color, $degrees)
|
1063
|
+
# @param $color [Sass::Script::Value::Color]
|
1064
|
+
# @param $degrees [Sass::Script::Value::Number] The number of degrees to
|
1065
|
+
# rotate the hue
|
1066
|
+
# @return [Sass::Script::Value::Color]
|
1067
|
+
# @raise [ArgumentError] if either parameter is the wrong type
|
1068
|
+
def adjust_hue(color, degrees)
|
1069
|
+
assert_type color, :Color, :color
|
1070
|
+
assert_type degrees, :Number, :degrees
|
1071
|
+
color.with(:hue => color.hue + degrees.value)
|
1072
|
+
end
|
1073
|
+
declare :adjust_hue, [:color, :degrees]
|
1074
|
+
|
1075
|
+
# Converts a color into the format understood by IE filters.
|
1076
|
+
#
|
1077
|
+
# @example
|
1078
|
+
# ie-hex-str(#abc) => #FFAABBCC
|
1079
|
+
# ie-hex-str(#3322BB) => #FF3322BB
|
1080
|
+
# ie-hex-str(rgba(0, 255, 0, 0.5)) => #8000FF00
|
1081
|
+
# @overload ie_hex_str($color)
|
1082
|
+
# @param $color [Sass::Script::Value::Color]
|
1083
|
+
# @return [Sass::Script::Value::String] The IE-formatted string
|
1084
|
+
# representation of the color
|
1085
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
1086
|
+
def ie_hex_str(color)
|
1087
|
+
assert_type color, :Color, :color
|
1088
|
+
alpha = Sass::Util.round(color.alpha * 255).to_s(16).rjust(2, '0')
|
1089
|
+
identifier("##{alpha}#{color.send(:hex_str)[1..-1]}".upcase)
|
1090
|
+
end
|
1091
|
+
declare :ie_hex_str, [:color]
|
1092
|
+
|
1093
|
+
# Increases or decreases one or more properties of a color. This can change
|
1094
|
+
# the red, green, blue, hue, saturation, value, and alpha properties. The
|
1095
|
+
# properties are specified as keyword arguments, and are added to or
|
1096
|
+
# subtracted from the color's current value for that property.
|
1097
|
+
#
|
1098
|
+
# All properties are optional. You can't specify both RGB properties
|
1099
|
+
# (`$red`, `$green`, `$blue`) and HSL properties (`$hue`, `$saturation`,
|
1100
|
+
# `$value`) at the same time.
|
1101
|
+
#
|
1102
|
+
# @example
|
1103
|
+
# adjust-color(#102030, $blue: 5) => #102035
|
1104
|
+
# adjust-color(#102030, $red: -5, $blue: 5) => #0b2035
|
1105
|
+
# adjust-color(hsl(25, 100%, 80%), $lightness: -30%, $alpha: -0.4) => hsla(25, 100%, 50%, 0.6)
|
1106
|
+
# @overload adjust_color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])
|
1107
|
+
# @param $color [Sass::Script::Value::Color]
|
1108
|
+
# @param $red [Sass::Script::Value::Number] The adjustment to make on the
|
1109
|
+
# red component, between -255 and 255 inclusive
|
1110
|
+
# @param $green [Sass::Script::Value::Number] The adjustment to make on the
|
1111
|
+
# green component, between -255 and 255 inclusive
|
1112
|
+
# @param $blue [Sass::Script::Value::Number] The adjustment to make on the
|
1113
|
+
# blue component, between -255 and 255 inclusive
|
1114
|
+
# @param $hue [Sass::Script::Value::Number] The adjustment to make on the
|
1115
|
+
# hue component, in degrees
|
1116
|
+
# @param $saturation [Sass::Script::Value::Number] The adjustment to make on
|
1117
|
+
# the saturation component, between `-100%` and `100%` inclusive
|
1118
|
+
# @param $lightness [Sass::Script::Value::Number] The adjustment to make on
|
1119
|
+
# the lightness component, between `-100%` and `100%` inclusive
|
1120
|
+
# @param $alpha [Sass::Script::Value::Number] The adjustment to make on the
|
1121
|
+
# alpha component, between -1 and 1 inclusive
|
1122
|
+
# @return [Sass::Script::Value::Color]
|
1123
|
+
# @raise [ArgumentError] if any parameter is the wrong type or out-of
|
1124
|
+
# bounds, or if RGB properties and HSL properties are adjusted at the
|
1125
|
+
# same time
|
1126
|
+
def adjust_color(color, kwargs)
|
1127
|
+
assert_type color, :Color, :color
|
1128
|
+
with = Sass::Util.map_hash(
|
1129
|
+
"red" => [-255..255, ""],
|
1130
|
+
"green" => [-255..255, ""],
|
1131
|
+
"blue" => [-255..255, ""],
|
1132
|
+
"hue" => nil,
|
1133
|
+
"saturation" => [-100..100, "%"],
|
1134
|
+
"lightness" => [-100..100, "%"],
|
1135
|
+
"alpha" => [-1..1, ""]
|
1136
|
+
) do |name, (range, units)|
|
1137
|
+
val = kwargs.delete(name)
|
1138
|
+
next unless val
|
1139
|
+
assert_type val, :Number, name
|
1140
|
+
Sass::Util.check_range("$#{name}: Amount", range, val, units) if range
|
1141
|
+
adjusted = color.send(name) + val.value
|
1142
|
+
adjusted = [0, Sass::Util.restrict(adjusted, range)].max if range
|
1143
|
+
[name.to_sym, adjusted]
|
1144
|
+
end
|
1145
|
+
|
1146
|
+
unless kwargs.empty?
|
1147
|
+
name, val = kwargs.to_a.first
|
1148
|
+
raise ArgumentError.new("Unknown argument $#{name} (#{val})")
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
color.with(with)
|
1152
|
+
end
|
1153
|
+
declare :adjust_color, [:color], :var_kwargs => true
|
1154
|
+
|
1155
|
+
# Fluidly scales one or more properties of a color. Unlike
|
1156
|
+
# \{#adjust_color adjust-color}, which changes a color's properties by fixed
|
1157
|
+
# amounts, \{#scale_color scale-color} fluidly changes them based on how
|
1158
|
+
# high or low they already are. That means that lightening an already-light
|
1159
|
+
# color with \{#scale_color scale-color} won't change the lightness much,
|
1160
|
+
# but lightening a dark color by the same amount will change it more
|
1161
|
+
# dramatically. This has the benefit of making `scale-color($color, ...)`
|
1162
|
+
# have a similar effect regardless of what `$color` is.
|
1163
|
+
#
|
1164
|
+
# For example, the lightness of a color can be anywhere between `0%` and
|
1165
|
+
# `100%`. If `scale-color($color, $lightness: 40%)` is called, the resulting
|
1166
|
+
# color's lightness will be 40% of the way between its original lightness
|
1167
|
+
# and 100. If `scale-color($color, $lightness: -40%)` is called instead, the
|
1168
|
+
# lightness will be 40% of the way between the original and 0.
|
1169
|
+
#
|
1170
|
+
# This can change the red, green, blue, saturation, value, and alpha
|
1171
|
+
# properties. The properties are specified as keyword arguments. All
|
1172
|
+
# arguments should be percentages between `0%` and `100%`.
|
1173
|
+
#
|
1174
|
+
# All properties are optional. You can't specify both RGB properties
|
1175
|
+
# (`$red`, `$green`, `$blue`) and HSL properties (`$saturation`, `$value`)
|
1176
|
+
# at the same time.
|
1177
|
+
#
|
1178
|
+
# @example
|
1179
|
+
# scale-color(hsl(120, 70%, 80%), $lightness: 50%) => hsl(120, 70%, 90%)
|
1180
|
+
# scale-color(rgb(200, 150%, 170%), $green: -40%, $blue: 70%) => rgb(200, 90, 229)
|
1181
|
+
# scale-color(hsl(200, 70%, 80%), $saturation: -90%, $alpha: -30%) => hsla(200, 7%, 80%, 0.7)
|
1182
|
+
# @overload scale_color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])
|
1183
|
+
# @param $color [Sass::Script::Value::Color]
|
1184
|
+
# @param $red [Sass::Script::Value::Number]
|
1185
|
+
# @param $green [Sass::Script::Value::Number]
|
1186
|
+
# @param $blue [Sass::Script::Value::Number]
|
1187
|
+
# @param $saturation [Sass::Script::Value::Number]
|
1188
|
+
# @param $lightness [Sass::Script::Value::Number]
|
1189
|
+
# @param $alpha [Sass::Script::Value::Number]
|
1190
|
+
# @return [Sass::Script::Value::Color]
|
1191
|
+
# @raise [ArgumentError] if any parameter is the wrong type or out-of
|
1192
|
+
# bounds, or if RGB properties and HSL properties are adjusted at the
|
1193
|
+
# same time
|
1194
|
+
def scale_color(color, kwargs)
|
1195
|
+
assert_type color, :Color, :color
|
1196
|
+
with = Sass::Util.map_hash(
|
1197
|
+
"red" => 255,
|
1198
|
+
"green" => 255,
|
1199
|
+
"blue" => 255,
|
1200
|
+
"saturation" => 100,
|
1201
|
+
"lightness" => 100,
|
1202
|
+
"alpha" => 1
|
1203
|
+
) do |name, max|
|
1204
|
+
val = kwargs.delete(name)
|
1205
|
+
next unless val
|
1206
|
+
assert_type val, :Number, name
|
1207
|
+
assert_unit val, '%', name
|
1208
|
+
Sass::Util.check_range("$#{name}: Amount", -100..100, val, '%')
|
1209
|
+
|
1210
|
+
current = color.send(name)
|
1211
|
+
scale = val.value / 100.0
|
1212
|
+
diff = scale > 0 ? max - current : current
|
1213
|
+
[name.to_sym, current + diff * scale]
|
1214
|
+
end
|
1215
|
+
|
1216
|
+
unless kwargs.empty?
|
1217
|
+
name, val = kwargs.to_a.first
|
1218
|
+
raise ArgumentError.new("Unknown argument $#{name} (#{val})")
|
1219
|
+
end
|
1220
|
+
|
1221
|
+
color.with(with)
|
1222
|
+
end
|
1223
|
+
declare :scale_color, [:color], :var_kwargs => true
|
1224
|
+
|
1225
|
+
# Changes one or more properties of a color. This can change the red, green,
|
1226
|
+
# blue, hue, saturation, value, and alpha properties. The properties are
|
1227
|
+
# specified as keyword arguments, and replace the color's current value for
|
1228
|
+
# that property.
|
1229
|
+
#
|
1230
|
+
# All properties are optional. You can't specify both RGB properties
|
1231
|
+
# (`$red`, `$green`, `$blue`) and HSL properties (`$hue`, `$saturation`,
|
1232
|
+
# `$value`) at the same time.
|
1233
|
+
#
|
1234
|
+
# @example
|
1235
|
+
# change-color(#102030, $blue: 5) => #102005
|
1236
|
+
# change-color(#102030, $red: 120, $blue: 5) => #782005
|
1237
|
+
# change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8) => hsla(25, 100%, 40%, 0.8)
|
1238
|
+
# @overload change_color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])
|
1239
|
+
# @param $color [Sass::Script::Value::Color]
|
1240
|
+
# @param $red [Sass::Script::Value::Number] The new red component for the
|
1241
|
+
# color, within 0 and 255 inclusive
|
1242
|
+
# @param $green [Sass::Script::Value::Number] The new green component for
|
1243
|
+
# the color, within 0 and 255 inclusive
|
1244
|
+
# @param $blue [Sass::Script::Value::Number] The new blue component for the
|
1245
|
+
# color, within 0 and 255 inclusive
|
1246
|
+
# @param $hue [Sass::Script::Value::Number] The new hue component for the
|
1247
|
+
# color, in degrees
|
1248
|
+
# @param $saturation [Sass::Script::Value::Number] The new saturation
|
1249
|
+
# component for the color, between `0%` and `100%` inclusive
|
1250
|
+
# @param $lightness [Sass::Script::Value::Number] The new lightness
|
1251
|
+
# component for the color, within `0%` and `100%` inclusive
|
1252
|
+
# @param $alpha [Sass::Script::Value::Number] The new alpha component for
|
1253
|
+
# the color, within 0 and 1 inclusive
|
1254
|
+
# @return [Sass::Script::Value::Color]
|
1255
|
+
# @raise [ArgumentError] if any parameter is the wrong type or out-of
|
1256
|
+
# bounds, or if RGB properties and HSL properties are adjusted at the
|
1257
|
+
# same time
|
1258
|
+
def change_color(color, kwargs)
|
1259
|
+
assert_type color, :Color, :color
|
1260
|
+
with = Sass::Util.map_hash(
|
1261
|
+
'red' => ['Red value', 0..255],
|
1262
|
+
'green' => ['Green value', 0..255],
|
1263
|
+
'blue' => ['Blue value', 0..255],
|
1264
|
+
'hue' => [],
|
1265
|
+
'saturation' => ['Saturation', 0..100, '%'],
|
1266
|
+
'lightness' => ['Lightness', 0..100, '%'],
|
1267
|
+
'alpha' => ['Alpha channel', 0..1]
|
1268
|
+
) do |name, (desc, range, unit)|
|
1269
|
+
val = kwargs.delete(name)
|
1270
|
+
next unless val
|
1271
|
+
assert_type val, :Number, name
|
1272
|
+
|
1273
|
+
if range
|
1274
|
+
val = Sass::Util.check_range(desc, range, val, unit)
|
1275
|
+
else
|
1276
|
+
val = val.value
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
[name.to_sym, val]
|
1280
|
+
end
|
1281
|
+
|
1282
|
+
unless kwargs.empty?
|
1283
|
+
name, val = kwargs.to_a.first
|
1284
|
+
raise ArgumentError.new("Unknown argument $#{name} (#{val})")
|
1285
|
+
end
|
1286
|
+
|
1287
|
+
color.with(with)
|
1288
|
+
end
|
1289
|
+
declare :change_color, [:color], :var_kwargs => true
|
1290
|
+
|
1291
|
+
# Mixes two colors together. Specifically, takes the average of each of the
|
1292
|
+
# RGB components, optionally weighted by the given percentage. The opacity
|
1293
|
+
# of the colors is also considered when weighting the components.
|
1294
|
+
#
|
1295
|
+
# The weight specifies the amount of the first color that should be included
|
1296
|
+
# in the returned color. The default, `50%`, means that half the first color
|
1297
|
+
# and half the second color should be used. `25%` means that a quarter of
|
1298
|
+
# the first color and three quarters of the second color should be used.
|
1299
|
+
#
|
1300
|
+
# @example
|
1301
|
+
# mix(#f00, #00f) => #7f007f
|
1302
|
+
# mix(#f00, #00f, 25%) => #3f00bf
|
1303
|
+
# mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)
|
1304
|
+
# @overload mix($color1, $color2, $weight: 50%)
|
1305
|
+
# @param $color1 [Sass::Script::Value::Color]
|
1306
|
+
# @param $color2 [Sass::Script::Value::Color]
|
1307
|
+
# @param $weight [Sass::Script::Value::Number] The relative weight of each
|
1308
|
+
# color. Closer to `0%` gives more weight to `$color1`, closer to `100%`
|
1309
|
+
# gives more weight to `$color2`
|
1310
|
+
# @return [Sass::Script::Value::Color]
|
1311
|
+
# @raise [ArgumentError] if `$weight` is out of bounds or any parameter is
|
1312
|
+
# the wrong type
|
1313
|
+
def mix(color1, color2, weight = number(50))
|
1314
|
+
assert_type color1, :Color, :color1
|
1315
|
+
assert_type color2, :Color, :color2
|
1316
|
+
assert_type weight, :Number, :weight
|
1317
|
+
|
1318
|
+
Sass::Util.check_range("Weight", 0..100, weight, '%')
|
1319
|
+
|
1320
|
+
# This algorithm factors in both the user-provided weight (w) and the
|
1321
|
+
# difference between the alpha values of the two colors (a) to decide how
|
1322
|
+
# to perform the weighted average of the two RGB values.
|
1323
|
+
#
|
1324
|
+
# It works by first normalizing both parameters to be within [-1, 1],
|
1325
|
+
# where 1 indicates "only use color1", -1 indicates "only use color2", and
|
1326
|
+
# all values in between indicated a proportionately weighted average.
|
1327
|
+
#
|
1328
|
+
# Once we have the normalized variables w and a, we apply the formula
|
1329
|
+
# (w + a)/(1 + w*a) to get the combined weight (in [-1, 1]) of color1.
|
1330
|
+
# This formula has two especially nice properties:
|
1331
|
+
#
|
1332
|
+
# * When either w or a are -1 or 1, the combined weight is also that number
|
1333
|
+
# (cases where w * a == -1 are undefined, and handled as a special case).
|
1334
|
+
#
|
1335
|
+
# * When a is 0, the combined weight is w, and vice versa.
|
1336
|
+
#
|
1337
|
+
# Finally, the weight of color1 is renormalized to be within [0, 1]
|
1338
|
+
# and the weight of color2 is given by 1 minus the weight of color1.
|
1339
|
+
p = (weight.value / 100.0).to_f
|
1340
|
+
w = p * 2 - 1
|
1341
|
+
a = color1.alpha - color2.alpha
|
1342
|
+
|
1343
|
+
w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0
|
1344
|
+
w2 = 1 - w1
|
1345
|
+
|
1346
|
+
rgba = color1.rgb.zip(color2.rgb).map {|v1, v2| v1 * w1 + v2 * w2}
|
1347
|
+
rgba << color1.alpha * p + color2.alpha * (1 - p)
|
1348
|
+
rgb_color(*rgba)
|
1349
|
+
end
|
1350
|
+
declare :mix, [:color1, :color2]
|
1351
|
+
declare :mix, [:color1, :color2, :weight]
|
1352
|
+
|
1353
|
+
# Converts a color to grayscale. This is identical to `desaturate(color,
|
1354
|
+
# 100%)`.
|
1355
|
+
#
|
1356
|
+
# @see #desaturate
|
1357
|
+
# @overload grayscale($color)
|
1358
|
+
# @param $color [Sass::Script::Value::Color]
|
1359
|
+
# @return [Sass::Script::Value::Color]
|
1360
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
1361
|
+
def grayscale(color)
|
1362
|
+
if color.is_a?(Sass::Script::Value::Number)
|
1363
|
+
return identifier("grayscale(#{color})")
|
1364
|
+
end
|
1365
|
+
desaturate color, number(100)
|
1366
|
+
end
|
1367
|
+
declare :grayscale, [:color]
|
1368
|
+
|
1369
|
+
# Returns the complement of a color. This is identical to `adjust-hue(color,
|
1370
|
+
# 180deg)`.
|
1371
|
+
#
|
1372
|
+
# @see #adjust_hue #adjust-hue
|
1373
|
+
# @overload complement($color)
|
1374
|
+
# @param $color [Sass::Script::Value::Color]
|
1375
|
+
# @return [Sass::Script::Value::Color]
|
1376
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
1377
|
+
def complement(color)
|
1378
|
+
adjust_hue color, number(180)
|
1379
|
+
end
|
1380
|
+
declare :complement, [:color]
|
1381
|
+
|
1382
|
+
# Returns the inverse (negative) of a color. The red, green, and blue values
|
1383
|
+
# are inverted, while the opacity is left alone.
|
1384
|
+
#
|
1385
|
+
# @overload invert($color)
|
1386
|
+
# @param $color [Sass::Script::Value::Color]
|
1387
|
+
# @return [Sass::Script::Value::Color]
|
1388
|
+
# @raise [ArgumentError] if `$color` isn't a color
|
1389
|
+
def invert(color)
|
1390
|
+
if color.is_a?(Sass::Script::Value::Number)
|
1391
|
+
return identifier("invert(#{color})")
|
1392
|
+
end
|
1393
|
+
|
1394
|
+
assert_type color, :Color, :color
|
1395
|
+
color.with(
|
1396
|
+
:red => (255 - color.red),
|
1397
|
+
:green => (255 - color.green),
|
1398
|
+
:blue => (255 - color.blue))
|
1399
|
+
end
|
1400
|
+
declare :invert, [:color]
|
1401
|
+
|
1402
|
+
# Removes quotes from a string. If the string is already unquoted, this will
|
1403
|
+
# return it unmodified.
|
1404
|
+
#
|
1405
|
+
# @see #quote
|
1406
|
+
# @example
|
1407
|
+
# unquote("foo") => foo
|
1408
|
+
# unquote(foo) => foo
|
1409
|
+
# @overload unquote($string)
|
1410
|
+
# @param $string [Sass::Script::Value::String]
|
1411
|
+
# @return [Sass::Script::Value::String]
|
1412
|
+
# @raise [ArgumentError] if `$string` isn't a string
|
1413
|
+
def unquote(string)
|
1414
|
+
unless string.is_a?(Sass::Script::Value::String)
|
1415
|
+
# Don't warn multiple times for the same source line.
|
1416
|
+
# rubocop:disable GlobalVars
|
1417
|
+
$_sass_warned_for_unquote ||= Set.new
|
1418
|
+
frame = environment.stack.frames.last
|
1419
|
+
key = [frame.filename, frame.line] if frame
|
1420
|
+
return string if frame && $_sass_warned_for_unquote.include?(key)
|
1421
|
+
$_sass_warned_for_unquote << key if frame
|
1422
|
+
# rubocop:enable GlobalVars
|
1423
|
+
|
1424
|
+
Sass::Util.sass_warn(<<MESSAGE.strip)
|
1425
|
+
DEPRECATION WARNING: Passing #{string.to_sass}, a non-string value, to unquote()
|
1426
|
+
will be an error in future versions of Sass.
|
1427
|
+
#{environment.stack.to_s.gsub(/^/, ' ' * 8)}
|
1428
|
+
MESSAGE
|
1429
|
+
return string
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
string.check_deprecated_interp
|
1433
|
+
return string if string.type == :identifier
|
1434
|
+
identifier(string.value)
|
1435
|
+
end
|
1436
|
+
declare :unquote, [:string]
|
1437
|
+
|
1438
|
+
# Add quotes to a string if the string isn't quoted,
|
1439
|
+
# or returns the same string if it is.
|
1440
|
+
#
|
1441
|
+
# @see #unquote
|
1442
|
+
# @example
|
1443
|
+
# quote("foo") => "foo"
|
1444
|
+
# quote(foo) => "foo"
|
1445
|
+
# @overload quote($string)
|
1446
|
+
# @param $string [Sass::Script::Value::String]
|
1447
|
+
# @return [Sass::Script::Value::String]
|
1448
|
+
# @raise [ArgumentError] if `$string` isn't a string
|
1449
|
+
def quote(string)
|
1450
|
+
assert_type string, :String, :string
|
1451
|
+
if string.type != :string
|
1452
|
+
quoted_string(string.value)
|
1453
|
+
else
|
1454
|
+
string
|
1455
|
+
end
|
1456
|
+
end
|
1457
|
+
declare :quote, [:string]
|
1458
|
+
|
1459
|
+
# Returns the number of characters in a string.
|
1460
|
+
#
|
1461
|
+
# @example
|
1462
|
+
# str-length("foo") => 3
|
1463
|
+
# @overload str_length($string)
|
1464
|
+
# @param $string [Sass::Script::Value::String]
|
1465
|
+
# @return [Sass::Script::Value::Number]
|
1466
|
+
# @raise [ArgumentError] if `$string` isn't a string
|
1467
|
+
def str_length(string)
|
1468
|
+
assert_type string, :String, :string
|
1469
|
+
number(string.value.size)
|
1470
|
+
end
|
1471
|
+
declare :str_length, [:string]
|
1472
|
+
|
1473
|
+
# Inserts `$insert` into `$string` at `$index`.
|
1474
|
+
#
|
1475
|
+
# Note that unlike some languages, the first character in a Sass string is
|
1476
|
+
# number 1, the second number 2, and so forth.
|
1477
|
+
#
|
1478
|
+
# @example
|
1479
|
+
# str-insert("abcd", "X", 1) => "Xabcd"
|
1480
|
+
# str-insert("abcd", "X", 4) => "abcXd"
|
1481
|
+
# str-insert("abcd", "X", 5) => "abcdX"
|
1482
|
+
#
|
1483
|
+
# @overload str_insert($string, $insert, $index)
|
1484
|
+
# @param $string [Sass::Script::Value::String]
|
1485
|
+
# @param $insert [Sass::Script::Value::String]
|
1486
|
+
# @param $index [Sass::Script::Value::Number] The position at which
|
1487
|
+
# `$insert` will be inserted. Negative indices count from the end of
|
1488
|
+
# `$string`. An index that's outside the bounds of the string will insert
|
1489
|
+
# `$insert` at the front or back of the string
|
1490
|
+
# @return [Sass::Script::Value::String] The result string. This will be
|
1491
|
+
# quoted if and only if `$string` was quoted
|
1492
|
+
# @raise [ArgumentError] if any parameter is the wrong type
|
1493
|
+
def str_insert(original, insert, index)
|
1494
|
+
assert_type original, :String, :string
|
1495
|
+
assert_type insert, :String, :insert
|
1496
|
+
assert_integer index, :index
|
1497
|
+
assert_unit index, nil, :index
|
1498
|
+
insertion_point = if index.to_i > 0
|
1499
|
+
[index.to_i - 1, original.value.size].min
|
1500
|
+
else
|
1501
|
+
[index.to_i, -original.value.size - 1].max
|
1502
|
+
end
|
1503
|
+
result = original.value.dup.insert(insertion_point, insert.value)
|
1504
|
+
Sass::Script::Value::String.new(result, original.type)
|
1505
|
+
end
|
1506
|
+
declare :str_insert, [:string, :insert, :index]
|
1507
|
+
|
1508
|
+
# Returns the index of the first occurrence of `$substring` in `$string`. If
|
1509
|
+
# there is no such occurrence, returns `null`.
|
1510
|
+
#
|
1511
|
+
# Note that unlike some languages, the first character in a Sass string is
|
1512
|
+
# number 1, the second number 2, and so forth.
|
1513
|
+
#
|
1514
|
+
# @example
|
1515
|
+
# str-index(abcd, a) => 1
|
1516
|
+
# str-index(abcd, ab) => 1
|
1517
|
+
# str-index(abcd, X) => null
|
1518
|
+
# str-index(abcd, c) => 3
|
1519
|
+
#
|
1520
|
+
# @overload str_index($string, $substring)
|
1521
|
+
# @param $string [Sass::Script::Value::String]
|
1522
|
+
# @param $substring [Sass::Script::Value::String]
|
1523
|
+
# @return [Sass::Script::Value::Number, Sass::Script::Value::Null]
|
1524
|
+
# @raise [ArgumentError] if any parameter is the wrong type
|
1525
|
+
def str_index(string, substring)
|
1526
|
+
assert_type string, :String, :string
|
1527
|
+
assert_type substring, :String, :substring
|
1528
|
+
index = string.value.index(substring.value)
|
1529
|
+
index ? number(index + 1) : null
|
1530
|
+
end
|
1531
|
+
declare :str_index, [:string, :substring]
|
1532
|
+
|
1533
|
+
# Extracts a substring from `$string`. The substring will begin at index
|
1534
|
+
# `$start-at` and ends at index `$end-at`.
|
1535
|
+
#
|
1536
|
+
# Note that unlike some languages, the first character in a Sass string is
|
1537
|
+
# number 1, the second number 2, and so forth.
|
1538
|
+
#
|
1539
|
+
# @example
|
1540
|
+
# str-slice("abcd", 2, 3) => "bc"
|
1541
|
+
# str-slice("abcd", 2) => "bcd"
|
1542
|
+
# str-slice("abcd", -3, -2) => "bc"
|
1543
|
+
# str-slice("abcd", 2, -2) => "bc"
|
1544
|
+
#
|
1545
|
+
# @overload str_slice($string, $start-at, $end-at: -1)
|
1546
|
+
# @param $start-at [Sass::Script::Value::Number] The index of the first
|
1547
|
+
# character of the substring. If this is negative, it counts from the end
|
1548
|
+
# of `$string`
|
1549
|
+
# @param $end-before [Sass::Script::Value::Number] The index of the last
|
1550
|
+
# character of the substring. If this is negative, it counts from the end
|
1551
|
+
# of `$string`. Defaults to -1
|
1552
|
+
# @return [Sass::Script::Value::String] The substring. This will be quoted
|
1553
|
+
# if and only if `$string` was quoted
|
1554
|
+
# @raise [ArgumentError] if any parameter is the wrong type
|
1555
|
+
def str_slice(string, start_at, end_at = nil)
|
1556
|
+
assert_type string, :String, :string
|
1557
|
+
assert_unit start_at, nil, "start-at"
|
1558
|
+
|
1559
|
+
end_at = number(-1) if end_at.nil?
|
1560
|
+
assert_unit end_at, nil, "end-at"
|
1561
|
+
|
1562
|
+
return Sass::Script::Value::String.new("", string.type) if end_at.value == 0
|
1563
|
+
s = start_at.value > 0 ? start_at.value - 1 : start_at.value
|
1564
|
+
e = end_at.value > 0 ? end_at.value - 1 : end_at.value
|
1565
|
+
s = string.value.length + s if s < 0
|
1566
|
+
s = 0 if s < 0
|
1567
|
+
e = string.value.length + e if e < 0
|
1568
|
+
e = 0 if s < 0
|
1569
|
+
extracted = string.value.slice(s..e)
|
1570
|
+
Sass::Script::Value::String.new(extracted || "", string.type)
|
1571
|
+
end
|
1572
|
+
declare :str_slice, [:string, :start_at]
|
1573
|
+
declare :str_slice, [:string, :start_at, :end_at]
|
1574
|
+
|
1575
|
+
# Converts a string to upper case.
|
1576
|
+
#
|
1577
|
+
# @example
|
1578
|
+
# to-upper-case(abcd) => ABCD
|
1579
|
+
#
|
1580
|
+
# @overload to_upper_case($string)
|
1581
|
+
# @param $string [Sass::Script::Value::String]
|
1582
|
+
# @return [Sass::Script::Value::String]
|
1583
|
+
# @raise [ArgumentError] if `$string` isn't a string
|
1584
|
+
def to_upper_case(string)
|
1585
|
+
assert_type string, :String, :string
|
1586
|
+
Sass::Script::Value::String.new(string.value.upcase, string.type)
|
1587
|
+
end
|
1588
|
+
declare :to_upper_case, [:string]
|
1589
|
+
|
1590
|
+
# Convert a string to lower case,
|
1591
|
+
#
|
1592
|
+
# @example
|
1593
|
+
# to-lower-case(ABCD) => abcd
|
1594
|
+
#
|
1595
|
+
# @overload to_lower_case($string)
|
1596
|
+
# @param $string [Sass::Script::Value::String]
|
1597
|
+
# @return [Sass::Script::Value::String]
|
1598
|
+
# @raise [ArgumentError] if `$string` isn't a string
|
1599
|
+
def to_lower_case(string)
|
1600
|
+
assert_type string, :String, :string
|
1601
|
+
Sass::Script::Value::String.new(string.value.downcase, string.type)
|
1602
|
+
end
|
1603
|
+
declare :to_lower_case, [:string]
|
1604
|
+
|
1605
|
+
# Returns the type of a value.
|
1606
|
+
#
|
1607
|
+
# @example
|
1608
|
+
# type-of(100px) => number
|
1609
|
+
# type-of(asdf) => string
|
1610
|
+
# type-of("asdf") => string
|
1611
|
+
# type-of(true) => bool
|
1612
|
+
# type-of(#fff) => color
|
1613
|
+
# type-of(blue) => color
|
1614
|
+
# @overload type_of($value)
|
1615
|
+
# @param $value [Sass::Script::Value::Base] The value to inspect
|
1616
|
+
# @return [Sass::Script::Value::String] The unquoted string name of the
|
1617
|
+
# value's type
|
1618
|
+
def type_of(value)
|
1619
|
+
value.check_deprecated_interp if value.is_a?(Sass::Script::Value::String)
|
1620
|
+
identifier(value.class.name.gsub(/Sass::Script::Value::/, '').downcase)
|
1621
|
+
end
|
1622
|
+
declare :type_of, [:value]
|
1623
|
+
|
1624
|
+
# Returns whether a feature exists in the current Sass runtime.
|
1625
|
+
#
|
1626
|
+
# The following features are supported:
|
1627
|
+
#
|
1628
|
+
# * `global-variable-shadowing` indicates that a local variable will shadow
|
1629
|
+
# a global variable unless `!global` is used.
|
1630
|
+
#
|
1631
|
+
# * `extend-selector-pseudoclass` indicates that `@extend` will reach into
|
1632
|
+
# selector pseudoclasses like `:not`.
|
1633
|
+
#
|
1634
|
+
# * `units-level-3` indicates full support for unit arithmetic using units
|
1635
|
+
# defined in the [Values and Units Level 3][] spec.
|
1636
|
+
#
|
1637
|
+
# [Values and Units Level 3]: http://www.w3.org/TR/css3-values/
|
1638
|
+
#
|
1639
|
+
# * `at-error` indicates that the Sass `@error` directive is supported.
|
1640
|
+
#
|
1641
|
+
# @example
|
1642
|
+
# feature-exists(some-feature-that-exists) => true
|
1643
|
+
# feature-exists(what-is-this-i-dont-know) => false
|
1644
|
+
#
|
1645
|
+
# @overload feature_exists($feature)
|
1646
|
+
# @param $feature [Sass::Script::Value::String] The name of the feature
|
1647
|
+
# @return [Sass::Script::Value::Bool] Whether the feature is supported in this version of Sass
|
1648
|
+
# @raise [ArgumentError] if `$feature` isn't a string
|
1649
|
+
def feature_exists(feature)
|
1650
|
+
assert_type feature, :String, :feature
|
1651
|
+
bool(Sass.has_feature?(feature.value))
|
1652
|
+
end
|
1653
|
+
declare :feature_exists, [:feature]
|
1654
|
+
|
1655
|
+
# Returns the unit(s) associated with a number. Complex units are sorted in
|
1656
|
+
# alphabetical order by numerator and denominator.
|
1657
|
+
#
|
1658
|
+
# @example
|
1659
|
+
# unit(100) => ""
|
1660
|
+
# unit(100px) => "px"
|
1661
|
+
# unit(3em) => "em"
|
1662
|
+
# unit(10px * 5em) => "em*px"
|
1663
|
+
# unit(10px * 5em / 30cm / 1rem) => "em*px/cm*rem"
|
1664
|
+
# @overload unit($number)
|
1665
|
+
# @param $number [Sass::Script::Value::Number]
|
1666
|
+
# @return [Sass::Script::Value::String] The unit(s) of the number, as a
|
1667
|
+
# quoted string
|
1668
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1669
|
+
def unit(number)
|
1670
|
+
assert_type number, :Number, :number
|
1671
|
+
quoted_string(number.unit_str)
|
1672
|
+
end
|
1673
|
+
declare :unit, [:number]
|
1674
|
+
|
1675
|
+
# Returns whether a number has units.
|
1676
|
+
#
|
1677
|
+
# @example
|
1678
|
+
# unitless(100) => true
|
1679
|
+
# unitless(100px) => false
|
1680
|
+
# @overload unitless($number)
|
1681
|
+
# @param $number [Sass::Script::Value::Number]
|
1682
|
+
# @return [Sass::Script::Value::Bool]
|
1683
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1684
|
+
def unitless(number)
|
1685
|
+
assert_type number, :Number, :number
|
1686
|
+
bool(number.unitless?)
|
1687
|
+
end
|
1688
|
+
declare :unitless, [:number]
|
1689
|
+
|
1690
|
+
# Returns whether two numbers can added, subtracted, or compared.
|
1691
|
+
#
|
1692
|
+
# @example
|
1693
|
+
# comparable(2px, 1px) => true
|
1694
|
+
# comparable(100px, 3em) => false
|
1695
|
+
# comparable(10cm, 3mm) => true
|
1696
|
+
# @overload comparable($number1, $number2)
|
1697
|
+
# @param $number1 [Sass::Script::Value::Number]
|
1698
|
+
# @param $number2 [Sass::Script::Value::Number]
|
1699
|
+
# @return [Sass::Script::Value::Bool]
|
1700
|
+
# @raise [ArgumentError] if either parameter is the wrong type
|
1701
|
+
def comparable(number1, number2)
|
1702
|
+
assert_type number1, :Number, :number1
|
1703
|
+
assert_type number2, :Number, :number2
|
1704
|
+
bool(number1.comparable_to?(number2))
|
1705
|
+
end
|
1706
|
+
declare :comparable, [:number1, :number2]
|
1707
|
+
|
1708
|
+
# Converts a unitless number to a percentage.
|
1709
|
+
#
|
1710
|
+
# @example
|
1711
|
+
# percentage(0.2) => 20%
|
1712
|
+
# percentage(100px / 50px) => 200%
|
1713
|
+
# @overload percentage($number)
|
1714
|
+
# @param $number [Sass::Script::Value::Number]
|
1715
|
+
# @return [Sass::Script::Value::Number]
|
1716
|
+
# @raise [ArgumentError] if `$number` isn't a unitless number
|
1717
|
+
def percentage(number)
|
1718
|
+
unless number.is_a?(Sass::Script::Value::Number) && number.unitless?
|
1719
|
+
raise ArgumentError.new("$number: #{number.inspect} is not a unitless number")
|
1720
|
+
end
|
1721
|
+
number(number.value * 100, '%')
|
1722
|
+
end
|
1723
|
+
declare :percentage, [:number]
|
1724
|
+
|
1725
|
+
# Rounds a number to the nearest whole number.
|
1726
|
+
#
|
1727
|
+
# @example
|
1728
|
+
# round(10.4px) => 10px
|
1729
|
+
# round(10.6px) => 11px
|
1730
|
+
# @overload round($number)
|
1731
|
+
# @param $number [Sass::Script::Value::Number]
|
1732
|
+
# @return [Sass::Script::Value::Number]
|
1733
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1734
|
+
def round(number)
|
1735
|
+
numeric_transformation(number) {|n| Sass::Util.round(n)}
|
1736
|
+
end
|
1737
|
+
declare :round, [:number]
|
1738
|
+
|
1739
|
+
# Rounds a number up to the next whole number.
|
1740
|
+
#
|
1741
|
+
# @example
|
1742
|
+
# ceil(10.4px) => 11px
|
1743
|
+
# ceil(10.6px) => 11px
|
1744
|
+
# @overload ceil($number)
|
1745
|
+
# @param $number [Sass::Script::Value::Number]
|
1746
|
+
# @return [Sass::Script::Value::Number]
|
1747
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1748
|
+
def ceil(number)
|
1749
|
+
numeric_transformation(number) {|n| n.ceil}
|
1750
|
+
end
|
1751
|
+
declare :ceil, [:number]
|
1752
|
+
|
1753
|
+
# Rounds a number down to the previous whole number.
|
1754
|
+
#
|
1755
|
+
# @example
|
1756
|
+
# floor(10.4px) => 10px
|
1757
|
+
# floor(10.6px) => 10px
|
1758
|
+
# @overload floor($number)
|
1759
|
+
# @param $number [Sass::Script::Value::Number]
|
1760
|
+
# @return [Sass::Script::Value::Number]
|
1761
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1762
|
+
def floor(number)
|
1763
|
+
numeric_transformation(number) {|n| n.floor}
|
1764
|
+
end
|
1765
|
+
declare :floor, [:number]
|
1766
|
+
|
1767
|
+
# Returns the absolute value of a number.
|
1768
|
+
#
|
1769
|
+
# @example
|
1770
|
+
# abs(10px) => 10px
|
1771
|
+
# abs(-10px) => 10px
|
1772
|
+
# @overload abs($number)
|
1773
|
+
# @param $number [Sass::Script::Value::Number]
|
1774
|
+
# @return [Sass::Script::Value::Number]
|
1775
|
+
# @raise [ArgumentError] if `$number` isn't a number
|
1776
|
+
def abs(number)
|
1777
|
+
numeric_transformation(number) {|n| n.abs}
|
1778
|
+
end
|
1779
|
+
declare :abs, [:number]
|
1780
|
+
|
1781
|
+
# Finds the minimum of several numbers. This function takes any number of
|
1782
|
+
# arguments.
|
1783
|
+
#
|
1784
|
+
# @example
|
1785
|
+
# min(1px, 4px) => 1px
|
1786
|
+
# min(5em, 3em, 4em) => 3em
|
1787
|
+
# @overload min($numbers...)
|
1788
|
+
# @param $numbers [[Sass::Script::Value::Number]]
|
1789
|
+
# @return [Sass::Script::Value::Number]
|
1790
|
+
# @raise [ArgumentError] if any argument isn't a number, or if not all of
|
1791
|
+
# the arguments have comparable units
|
1792
|
+
def min(*numbers)
|
1793
|
+
numbers.each {|n| assert_type n, :Number}
|
1794
|
+
numbers.inject {|min, num| min.lt(num).to_bool ? min : num}
|
1795
|
+
end
|
1796
|
+
declare :min, [], :var_args => :true
|
1797
|
+
|
1798
|
+
# Finds the maximum of several numbers. This function takes any number of
|
1799
|
+
# arguments.
|
1800
|
+
#
|
1801
|
+
# @example
|
1802
|
+
# max(1px, 4px) => 4px
|
1803
|
+
# max(5em, 3em, 4em) => 5em
|
1804
|
+
# @overload max($numbers...)
|
1805
|
+
# @param $numbers [[Sass::Script::Value::Number]]
|
1806
|
+
# @return [Sass::Script::Value::Number]
|
1807
|
+
# @raise [ArgumentError] if any argument isn't a number, or if not all of
|
1808
|
+
# the arguments have comparable units
|
1809
|
+
def max(*values)
|
1810
|
+
values.each {|v| assert_type v, :Number}
|
1811
|
+
values.inject {|max, val| max.gt(val).to_bool ? max : val}
|
1812
|
+
end
|
1813
|
+
declare :max, [], :var_args => :true
|
1814
|
+
|
1815
|
+
# Return the length of a list.
|
1816
|
+
#
|
1817
|
+
# This can return the number of pairs in a map as well.
|
1818
|
+
#
|
1819
|
+
# @example
|
1820
|
+
# length(10px) => 1
|
1821
|
+
# length(10px 20px 30px) => 3
|
1822
|
+
# length((width: 10px, height: 20px)) => 2
|
1823
|
+
# @overload length($list)
|
1824
|
+
# @param $list [Sass::Script::Value::Base]
|
1825
|
+
# @return [Sass::Script::Value::Number]
|
1826
|
+
def length(list)
|
1827
|
+
number(list.to_a.size)
|
1828
|
+
end
|
1829
|
+
declare :length, [:list]
|
1830
|
+
|
1831
|
+
# Return a new list, based on the list provided, but with the nth
|
1832
|
+
# element changed to the value given.
|
1833
|
+
#
|
1834
|
+
# Note that unlike some languages, the first item in a Sass list is number
|
1835
|
+
# 1, the second number 2, and so forth.
|
1836
|
+
#
|
1837
|
+
# Negative index values address elements in reverse order, starting with the last element
|
1838
|
+
# in the list.
|
1839
|
+
#
|
1840
|
+
# @example
|
1841
|
+
# set-nth($list: 10px 20px 30px, $n: 2, $value: -20px) => 10px -20px 30px
|
1842
|
+
# @overload set-nth($list, $n, $value)
|
1843
|
+
# @param $list [Sass::Script::Value::Base] The list that will be copied, having the element
|
1844
|
+
# at index `$n` changed.
|
1845
|
+
# @param $n [Sass::Script::Value::Number] The index of the item to set.
|
1846
|
+
# Negative indices count from the end of the list.
|
1847
|
+
# @param $value [Sass::Script::Value::Base] The new value at index `$n`.
|
1848
|
+
# @return [Sass::Script::Value::List]
|
1849
|
+
# @raise [ArgumentError] if `$n` isn't an integer between 1 and the length
|
1850
|
+
# of `$list`
|
1851
|
+
def set_nth(list, n, value)
|
1852
|
+
assert_type n, :Number, :n
|
1853
|
+
Sass::Script::Value::List.assert_valid_index(list, n)
|
1854
|
+
index = n.to_i > 0 ? n.to_i - 1 : n.to_i
|
1855
|
+
new_list = list.to_a.dup
|
1856
|
+
new_list[index] = value
|
1857
|
+
Sass::Script::Value::List.new(new_list, list.separator)
|
1858
|
+
end
|
1859
|
+
declare :set_nth, [:list, :n, :value]
|
1860
|
+
|
1861
|
+
# Gets the nth item in a list.
|
1862
|
+
#
|
1863
|
+
# Note that unlike some languages, the first item in a Sass list is number
|
1864
|
+
# 1, the second number 2, and so forth.
|
1865
|
+
#
|
1866
|
+
# This can return the nth pair in a map as well.
|
1867
|
+
#
|
1868
|
+
# Negative index values address elements in reverse order, starting with the last element in
|
1869
|
+
# the list.
|
1870
|
+
#
|
1871
|
+
# @example
|
1872
|
+
# nth(10px 20px 30px, 1) => 10px
|
1873
|
+
# nth((Helvetica, Arial, sans-serif), 3) => sans-serif
|
1874
|
+
# nth((width: 10px, length: 20px), 2) => length, 20px
|
1875
|
+
# @overload nth($list, $n)
|
1876
|
+
# @param $list [Sass::Script::Value::Base]
|
1877
|
+
# @param $n [Sass::Script::Value::Number] The index of the item to get.
|
1878
|
+
# Negative indices count from the end of the list.
|
1879
|
+
# @return [Sass::Script::Value::Base]
|
1880
|
+
# @raise [ArgumentError] if `$n` isn't an integer between 1 and the length
|
1881
|
+
# of `$list`
|
1882
|
+
def nth(list, n)
|
1883
|
+
assert_type n, :Number, :n
|
1884
|
+
Sass::Script::Value::List.assert_valid_index(list, n)
|
1885
|
+
|
1886
|
+
index = n.to_i > 0 ? n.to_i - 1 : n.to_i
|
1887
|
+
list.to_a[index]
|
1888
|
+
end
|
1889
|
+
declare :nth, [:list, :n]
|
1890
|
+
|
1891
|
+
# Joins together two lists into one.
|
1892
|
+
#
|
1893
|
+
# Unless `$separator` is passed, if one list is comma-separated and one is
|
1894
|
+
# space-separated, the first parameter's separator is used for the resulting
|
1895
|
+
# list. If both lists have fewer than two items, spaces are used for the
|
1896
|
+
# resulting list.
|
1897
|
+
#
|
1898
|
+
# Like all list functions, `join()` returns a new list rather than modifying
|
1899
|
+
# its arguments in place.
|
1900
|
+
#
|
1901
|
+
# @example
|
1902
|
+
# join(10px 20px, 30px 40px) => 10px 20px 30px 40px
|
1903
|
+
# join((blue, red), (#abc, #def)) => blue, red, #abc, #def
|
1904
|
+
# join(10px, 20px) => 10px 20px
|
1905
|
+
# join(10px, 20px, comma) => 10px, 20px
|
1906
|
+
# join((blue, red), (#abc, #def), space) => blue red #abc #def
|
1907
|
+
# @overload join($list1, $list2, $separator: auto)
|
1908
|
+
# @param $list1 [Sass::Script::Value::Base]
|
1909
|
+
# @param $list2 [Sass::Script::Value::Base]
|
1910
|
+
# @param $separator [Sass::Script::Value::String] The list separator to use.
|
1911
|
+
# If this is `comma` or `space`, that separator will be used. If this is
|
1912
|
+
# `auto` (the default), the separator is determined as explained above.
|
1913
|
+
# @return [Sass::Script::Value::List]
|
1914
|
+
def join(list1, list2, separator = identifier("auto"))
|
1915
|
+
assert_type separator, :String, :separator
|
1916
|
+
unless %w(auto space comma).include?(separator.value)
|
1917
|
+
raise ArgumentError.new("Separator name must be space, comma, or auto")
|
1918
|
+
end
|
1919
|
+
sep = if separator.value == 'auto'
|
1920
|
+
list1.separator || list2.separator || :space
|
1921
|
+
else
|
1922
|
+
separator.value.to_sym
|
1923
|
+
end
|
1924
|
+
list(list1.to_a + list2.to_a, sep)
|
1925
|
+
end
|
1926
|
+
declare :join, [:list1, :list2]
|
1927
|
+
declare :join, [:list1, :list2, :separator]
|
1928
|
+
|
1929
|
+
# Appends a single value onto the end of a list.
|
1930
|
+
#
|
1931
|
+
# Unless the `$separator` argument is passed, if the list had only one item,
|
1932
|
+
# the resulting list will be space-separated.
|
1933
|
+
#
|
1934
|
+
# Like all list functions, `append()` returns a new list rather than
|
1935
|
+
# modifying its argument in place.
|
1936
|
+
#
|
1937
|
+
# @example
|
1938
|
+
# append(10px 20px, 30px) => 10px 20px 30px
|
1939
|
+
# append((blue, red), green) => blue, red, green
|
1940
|
+
# append(10px 20px, 30px 40px) => 10px 20px (30px 40px)
|
1941
|
+
# append(10px, 20px, comma) => 10px, 20px
|
1942
|
+
# append((blue, red), green, space) => blue red green
|
1943
|
+
# @overload append($list, $val, $separator: auto)
|
1944
|
+
# @param $list [Sass::Script::Value::Base]
|
1945
|
+
# @param $val [Sass::Script::Value::Base]
|
1946
|
+
# @param $separator [Sass::Script::Value::String] The list separator to use.
|
1947
|
+
# If this is `comma` or `space`, that separator will be used. If this is
|
1948
|
+
# `auto` (the default), the separator is determined as explained above.
|
1949
|
+
# @return [Sass::Script::Value::List]
|
1950
|
+
def append(list, val, separator = identifier("auto"))
|
1951
|
+
assert_type separator, :String, :separator
|
1952
|
+
unless %w(auto space comma).include?(separator.value)
|
1953
|
+
raise ArgumentError.new("Separator name must be space, comma, or auto")
|
1954
|
+
end
|
1955
|
+
sep = if separator.value == 'auto'
|
1956
|
+
list.separator || :space
|
1957
|
+
else
|
1958
|
+
separator.value.to_sym
|
1959
|
+
end
|
1960
|
+
list(list.to_a + [val], sep)
|
1961
|
+
end
|
1962
|
+
declare :append, [:list, :val]
|
1963
|
+
declare :append, [:list, :val, :separator]
|
1964
|
+
|
1965
|
+
# Combines several lists into a single multidimensional list. The nth value
|
1966
|
+
# of the resulting list is a space separated list of the source lists' nth
|
1967
|
+
# values.
|
1968
|
+
#
|
1969
|
+
# The length of the resulting list is the length of the
|
1970
|
+
# shortest list.
|
1971
|
+
#
|
1972
|
+
# @example
|
1973
|
+
# zip(1px 1px 3px, solid dashed solid, red green blue)
|
1974
|
+
# => 1px solid red, 1px dashed green, 3px solid blue
|
1975
|
+
# @overload zip($lists...)
|
1976
|
+
# @param $lists [[Sass::Script::Value::Base]]
|
1977
|
+
# @return [Sass::Script::Value::List]
|
1978
|
+
def zip(*lists)
|
1979
|
+
length = nil
|
1980
|
+
values = []
|
1981
|
+
lists.each do |list|
|
1982
|
+
array = list.to_a
|
1983
|
+
values << array.dup
|
1984
|
+
length = length.nil? ? array.length : [length, array.length].min
|
1985
|
+
end
|
1986
|
+
values.each do |value|
|
1987
|
+
value.slice!(length)
|
1988
|
+
end
|
1989
|
+
new_list_value = values.first.zip(*values[1..-1])
|
1990
|
+
list(new_list_value.map {|list| list(list, :space)}, :comma)
|
1991
|
+
end
|
1992
|
+
declare :zip, [], :var_args => true
|
1993
|
+
|
1994
|
+
# Returns the position of a value within a list. If the value isn't found,
|
1995
|
+
# returns `null` instead.
|
1996
|
+
#
|
1997
|
+
# Note that unlike some languages, the first item in a Sass list is number
|
1998
|
+
# 1, the second number 2, and so forth.
|
1999
|
+
#
|
2000
|
+
# This can return the position of a pair in a map as well.
|
2001
|
+
#
|
2002
|
+
# @example
|
2003
|
+
# index(1px solid red, solid) => 2
|
2004
|
+
# index(1px solid red, dashed) => null
|
2005
|
+
# index((width: 10px, height: 20px), (height 20px)) => 2
|
2006
|
+
# @overload index($list, $value)
|
2007
|
+
# @param $list [Sass::Script::Value::Base]
|
2008
|
+
# @param $value [Sass::Script::Value::Base]
|
2009
|
+
# @return [Sass::Script::Value::Number, Sass::Script::Value::Null] The
|
2010
|
+
# 1-based index of `$value` in `$list`, or `null`
|
2011
|
+
def index(list, value)
|
2012
|
+
index = list.to_a.index {|e| e.eq(value).to_bool}
|
2013
|
+
index ? number(index + 1) : null
|
2014
|
+
end
|
2015
|
+
declare :index, [:list, :value]
|
2016
|
+
|
2017
|
+
# Returns the separator of a list. If the list doesn't have a separator due
|
2018
|
+
# to having fewer than two elements, returns `space`.
|
2019
|
+
#
|
2020
|
+
# @example
|
2021
|
+
# list-separator(1px 2px 3px) => space
|
2022
|
+
# list-separator(1px, 2px, 3px) => comma
|
2023
|
+
# list-separator('foo') => space
|
2024
|
+
# @overload list_separator($list)
|
2025
|
+
# @param $list [Sass::Script::Value::Base]
|
2026
|
+
# @return [Sass::Script::Value::String] `comma` or `space`
|
2027
|
+
def list_separator(list)
|
2028
|
+
identifier((list.separator || :space).to_s)
|
2029
|
+
end
|
2030
|
+
declare :separator, [:list]
|
2031
|
+
|
2032
|
+
# Returns the value in a map associated with the given key. If the map
|
2033
|
+
# doesn't have such a key, returns `null`.
|
2034
|
+
#
|
2035
|
+
# @example
|
2036
|
+
# map-get(("foo": 1, "bar": 2), "foo") => 1
|
2037
|
+
# map-get(("foo": 1, "bar": 2), "bar") => 2
|
2038
|
+
# map-get(("foo": 1, "bar": 2), "baz") => null
|
2039
|
+
# @overload map_get($map, $key)
|
2040
|
+
# @param $map [Sass::Script::Value::Map]
|
2041
|
+
# @param $key [Sass::Script::Value::Base]
|
2042
|
+
# @return [Sass::Script::Value::Base] The value indexed by `$key`, or `null`
|
2043
|
+
# if the map doesn't contain the given key
|
2044
|
+
# @raise [ArgumentError] if `$map` is not a map
|
2045
|
+
def map_get(map, key)
|
2046
|
+
assert_type map, :Map, :map
|
2047
|
+
map.to_h[key] || null
|
2048
|
+
end
|
2049
|
+
declare :map_get, [:map, :key]
|
2050
|
+
|
2051
|
+
# Merges two maps together into a new map. Keys in `$map2` will take
|
2052
|
+
# precedence over keys in `$map1`.
|
2053
|
+
#
|
2054
|
+
# This is the best way to add new values to a map.
|
2055
|
+
#
|
2056
|
+
# All keys in the returned map that also appear in `$map1` will have the
|
2057
|
+
# same order as in `$map1`. New keys from `$map2` will be placed at the end
|
2058
|
+
# of the map.
|
2059
|
+
#
|
2060
|
+
# Like all map functions, `map-merge()` returns a new map rather than
|
2061
|
+
# modifying its arguments in place.
|
2062
|
+
#
|
2063
|
+
# @example
|
2064
|
+
# map-merge(("foo": 1), ("bar": 2)) => ("foo": 1, "bar": 2)
|
2065
|
+
# map-merge(("foo": 1, "bar": 2), ("bar": 3)) => ("foo": 1, "bar": 3)
|
2066
|
+
# @overload map_merge($map1, $map2)
|
2067
|
+
# @param $map1 [Sass::Script::Value::Map]
|
2068
|
+
# @param $map2 [Sass::Script::Value::Map]
|
2069
|
+
# @return [Sass::Script::Value::Map]
|
2070
|
+
# @raise [ArgumentError] if either parameter is not a map
|
2071
|
+
def map_merge(map1, map2)
|
2072
|
+
assert_type map1, :Map, :map1
|
2073
|
+
assert_type map2, :Map, :map2
|
2074
|
+
map(map1.to_h.merge(map2.to_h))
|
2075
|
+
end
|
2076
|
+
declare :map_merge, [:map1, :map2]
|
2077
|
+
|
2078
|
+
# Returns a new map with keys removed.
|
2079
|
+
#
|
2080
|
+
# Like all map functions, `map-merge()` returns a new map rather than
|
2081
|
+
# modifying its arguments in place.
|
2082
|
+
#
|
2083
|
+
# @example
|
2084
|
+
# map-remove(("foo": 1, "bar": 2), "bar") => ("foo": 1)
|
2085
|
+
# map-remove(("foo": 1, "bar": 2, "baz": 3), "bar", "baz") => ("foo": 1)
|
2086
|
+
# map-remove(("foo": 1, "bar": 2), "baz") => ("foo": 1, "bar": 2)
|
2087
|
+
# @overload map_remove($map, $keys...)
|
2088
|
+
# @param $map [Sass::Script::Value::Map]
|
2089
|
+
# @param $keys [[Sass::Script::Value::Base]]
|
2090
|
+
# @return [Sass::Script::Value::Map]
|
2091
|
+
# @raise [ArgumentError] if `$map` is not a map
|
2092
|
+
def map_remove(map, *keys)
|
2093
|
+
assert_type map, :Map, :map
|
2094
|
+
hash = map.to_h.dup
|
2095
|
+
hash.delete_if {|key, _| keys.include?(key)}
|
2096
|
+
map(hash)
|
2097
|
+
end
|
2098
|
+
declare :map_remove, [:map, :key], :var_args => true
|
2099
|
+
|
2100
|
+
# Returns a list of all keys in a map.
|
2101
|
+
#
|
2102
|
+
# @example
|
2103
|
+
# map-keys(("foo": 1, "bar": 2)) => "foo", "bar"
|
2104
|
+
# @overload map_keys($map)
|
2105
|
+
# @param $map [Map]
|
2106
|
+
# @return [List] the list of keys, comma-separated
|
2107
|
+
# @raise [ArgumentError] if `$map` is not a map
|
2108
|
+
def map_keys(map)
|
2109
|
+
assert_type map, :Map, :map
|
2110
|
+
list(map.to_h.keys, :comma)
|
2111
|
+
end
|
2112
|
+
declare :map_keys, [:map]
|
2113
|
+
|
2114
|
+
# Returns a list of all values in a map. This list may include duplicate
|
2115
|
+
# values, if multiple keys have the same value.
|
2116
|
+
#
|
2117
|
+
# @example
|
2118
|
+
# map-values(("foo": 1, "bar": 2)) => 1, 2
|
2119
|
+
# map-values(("foo": 1, "bar": 2, "baz": 1)) => 1, 2, 1
|
2120
|
+
# @overload map_values($map)
|
2121
|
+
# @param $map [Map]
|
2122
|
+
# @return [List] the list of values, comma-separated
|
2123
|
+
# @raise [ArgumentError] if `$map` is not a map
|
2124
|
+
def map_values(map)
|
2125
|
+
assert_type map, :Map, :map
|
2126
|
+
list(map.to_h.values, :comma)
|
2127
|
+
end
|
2128
|
+
declare :map_values, [:map]
|
2129
|
+
|
2130
|
+
# Returns whether a map has a value associated with a given key.
|
2131
|
+
#
|
2132
|
+
# @example
|
2133
|
+
# map-has-key(("foo": 1, "bar": 2), "foo") => true
|
2134
|
+
# map-has-key(("foo": 1, "bar": 2), "baz") => false
|
2135
|
+
# @overload map_has_key($map, $key)
|
2136
|
+
# @param $map [Sass::Script::Value::Map]
|
2137
|
+
# @param $key [Sass::Script::Value::Base]
|
2138
|
+
# @return [Sass::Script::Value::Bool]
|
2139
|
+
# @raise [ArgumentError] if `$map` is not a map
|
2140
|
+
def map_has_key(map, key)
|
2141
|
+
assert_type map, :Map, :map
|
2142
|
+
bool(map.to_h.has_key?(key))
|
2143
|
+
end
|
2144
|
+
declare :map_has_key, [:map, :key]
|
2145
|
+
|
2146
|
+
# Returns the map of named arguments passed to a function or mixin that
|
2147
|
+
# takes a variable argument list. The argument names are strings, and they
|
2148
|
+
# do not contain the leading `$`.
|
2149
|
+
#
|
2150
|
+
# @example
|
2151
|
+
# @mixin foo($args...) {
|
2152
|
+
# @debug keywords($args); //=> (arg1: val, arg2: val)
|
2153
|
+
# }
|
2154
|
+
#
|
2155
|
+
# @include foo($arg1: val, $arg2: val);
|
2156
|
+
# @overload keywords($args)
|
2157
|
+
# @param $args [Sass::Script::Value::ArgList]
|
2158
|
+
# @return [Sass::Script::Value::Map]
|
2159
|
+
# @raise [ArgumentError] if `$args` isn't a variable argument list
|
2160
|
+
def keywords(args)
|
2161
|
+
assert_type args, :ArgList, :args
|
2162
|
+
map(Sass::Util.map_keys(args.keywords.as_stored) {|k| Sass::Script::Value::String.new(k)})
|
2163
|
+
end
|
2164
|
+
declare :keywords, [:args]
|
2165
|
+
|
2166
|
+
# Returns one of two values, depending on whether or not `$condition` is
|
2167
|
+
# true. Just like in `@if`, all values other than `false` and `null` are
|
2168
|
+
# considered to be true.
|
2169
|
+
#
|
2170
|
+
# @example
|
2171
|
+
# if(true, 1px, 2px) => 1px
|
2172
|
+
# if(false, 1px, 2px) => 2px
|
2173
|
+
# @overload if($condition, $if-true, $if-false)
|
2174
|
+
# @param $condition [Sass::Script::Value::Base] Whether the `$if-true` or
|
2175
|
+
# `$if-false` will be returned
|
2176
|
+
# @param $if-true [Sass::Script::Tree::Node]
|
2177
|
+
# @param $if-false [Sass::Script::Tree::Node]
|
2178
|
+
# @return [Sass::Script::Value::Base] `$if-true` or `$if-false`
|
2179
|
+
def if(condition, if_true, if_false)
|
2180
|
+
if condition.to_bool
|
2181
|
+
perform(if_true)
|
2182
|
+
else
|
2183
|
+
perform(if_false)
|
2184
|
+
end
|
2185
|
+
end
|
2186
|
+
declare :if, [:condition, :"&if_true", :"&if_false"]
|
2187
|
+
|
2188
|
+
# Returns a unique CSS identifier. The identifier is returned as an unquoted
|
2189
|
+
# string. The identifier returned is only guaranteed to be unique within the
|
2190
|
+
# scope of a single Sass run.
|
2191
|
+
#
|
2192
|
+
# @overload unique_id()
|
2193
|
+
# @return [Sass::Script::Value::String]
|
2194
|
+
def unique_id
|
2195
|
+
generator = Sass::Script::Functions.random_number_generator
|
2196
|
+
Thread.current[:sass_last_unique_id] ||= generator.rand(36**8)
|
2197
|
+
# avoid the temptation of trying to guess the next unique value.
|
2198
|
+
value = (Thread.current[:sass_last_unique_id] += (generator.rand(10) + 1))
|
2199
|
+
# the u makes this a legal identifier if it would otherwise start with a number.
|
2200
|
+
identifier("u" + value.to_s(36).rjust(8, '0'))
|
2201
|
+
end
|
2202
|
+
declare :unique_id, []
|
2203
|
+
|
2204
|
+
# Dynamically calls a function. This can call user-defined
|
2205
|
+
# functions, built-in functions, or plain CSS functions. It will
|
2206
|
+
# pass along all arguments, including keyword arguments, to the
|
2207
|
+
# called function.
|
2208
|
+
#
|
2209
|
+
# @example
|
2210
|
+
# call(rgb, 10, 100, 255) => #0a64ff
|
2211
|
+
# call(scale-color, #0a64ff, $lightness: -10%) => #0058ef
|
2212
|
+
#
|
2213
|
+
# $fn: nth;
|
2214
|
+
# call($fn, (a b c), 2) => b
|
2215
|
+
#
|
2216
|
+
# @overload call($name, $args...)
|
2217
|
+
# @param $name [String] The name of the function to call.
|
2218
|
+
def call(name, *args)
|
2219
|
+
assert_type name, :String, :name
|
2220
|
+
kwargs = args.last.is_a?(Hash) ? args.pop : {}
|
2221
|
+
funcall = Sass::Script::Tree::Funcall.new(
|
2222
|
+
name.value,
|
2223
|
+
args.map {|a| Sass::Script::Tree::Literal.new(a)},
|
2224
|
+
Sass::Util.map_vals(kwargs) {|v| Sass::Script::Tree::Literal.new(v)},
|
2225
|
+
nil,
|
2226
|
+
nil)
|
2227
|
+
funcall.options = options
|
2228
|
+
perform(funcall)
|
2229
|
+
end
|
2230
|
+
declare :call, [:name], :var_args => true, :var_kwargs => true
|
2231
|
+
|
2232
|
+
# This function only exists as a workaround for IE7's [`content:
|
2233
|
+
# counter` bug](http://jes.st/2013/ie7s-css-breaking-content-counter-bug/).
|
2234
|
+
# It works identically to any other plain-CSS function, except it
|
2235
|
+
# avoids adding spaces between the argument commas.
|
2236
|
+
#
|
2237
|
+
# @example
|
2238
|
+
# counter(item, ".") => counter(item,".")
|
2239
|
+
# @overload counter($args...)
|
2240
|
+
# @return [Sass::Script::Value::String]
|
2241
|
+
def counter(*args)
|
2242
|
+
identifier("counter(#{args.map {|a| a.to_s(options)}.join(',')})")
|
2243
|
+
end
|
2244
|
+
declare :counter, [], :var_args => true
|
2245
|
+
|
2246
|
+
# This function only exists as a workaround for IE7's [`content:
|
2247
|
+
# counter` bug](http://jes.st/2013/ie7s-css-breaking-content-counter-bug/).
|
2248
|
+
# It works identically to any other plain-CSS function, except it
|
2249
|
+
# avoids adding spaces between the argument commas.
|
2250
|
+
#
|
2251
|
+
# @example
|
2252
|
+
# counters(item, ".") => counters(item,".")
|
2253
|
+
# @overload counters($args...)
|
2254
|
+
# @return [Sass::Script::Value::String]
|
2255
|
+
def counters(*args)
|
2256
|
+
identifier("counters(#{args.map {|a| a.to_s(options)}.join(',')})")
|
2257
|
+
end
|
2258
|
+
declare :counters, [], :var_args => true
|
2259
|
+
|
2260
|
+
# Check whether a variable with the given name exists in the current
|
2261
|
+
# scope or in the global scope.
|
2262
|
+
#
|
2263
|
+
# @example
|
2264
|
+
# $a-false-value: false;
|
2265
|
+
# variable-exists(a-false-value) => true
|
2266
|
+
#
|
2267
|
+
# variable-exists(nonexistent) => false
|
2268
|
+
#
|
2269
|
+
# @overload variable_exists($name)
|
2270
|
+
# @param $name [Sass::Script::Value::String] The name of the variable to
|
2271
|
+
# check. The name should not include the `$`.
|
2272
|
+
# @return [Sass::Script::Value::Bool] Whether the variable is defined in
|
2273
|
+
# the current scope.
|
2274
|
+
def variable_exists(name)
|
2275
|
+
assert_type name, :String, :name
|
2276
|
+
bool(environment.caller.var(name.value))
|
2277
|
+
end
|
2278
|
+
declare :variable_exists, [:name]
|
2279
|
+
|
2280
|
+
# Check whether a variable with the given name exists in the global
|
2281
|
+
# scope (at the top level of the file).
|
2282
|
+
#
|
2283
|
+
# @example
|
2284
|
+
# $a-false-value: false;
|
2285
|
+
# global-variable-exists(a-false-value) => true
|
2286
|
+
#
|
2287
|
+
# .foo {
|
2288
|
+
# $some-var: false;
|
2289
|
+
# @if global-variable-exists(some-var) { /* false, doesn't run */ }
|
2290
|
+
# }
|
2291
|
+
#
|
2292
|
+
# @overload global_variable_exists($name)
|
2293
|
+
# @param $name [Sass::Script::Value::String] The name of the variable to
|
2294
|
+
# check. The name should not include the `$`.
|
2295
|
+
# @return [Sass::Script::Value::Bool] Whether the variable is defined in
|
2296
|
+
# the global scope.
|
2297
|
+
def global_variable_exists(name)
|
2298
|
+
assert_type name, :String, :name
|
2299
|
+
bool(environment.global_env.var(name.value))
|
2300
|
+
end
|
2301
|
+
declare :global_variable_exists, [:name]
|
2302
|
+
|
2303
|
+
# Check whether a function with the given name exists.
|
2304
|
+
#
|
2305
|
+
# @example
|
2306
|
+
# function-exists(lighten) => true
|
2307
|
+
#
|
2308
|
+
# @function myfunc { @return "something"; }
|
2309
|
+
# function-exists(myfunc) => true
|
2310
|
+
#
|
2311
|
+
# @overload function_exists($name)
|
2312
|
+
# @param name [Sass::Script::Value::String] The name of the function to
|
2313
|
+
# check.
|
2314
|
+
# @return [Sass::Script::Value::Bool] Whether the function is defined.
|
2315
|
+
def function_exists(name)
|
2316
|
+
assert_type name, :String, :name
|
2317
|
+
exists = Sass::Script::Functions.callable?(name.value.tr("-", "_"))
|
2318
|
+
exists ||= environment.function(name.value)
|
2319
|
+
bool(exists)
|
2320
|
+
end
|
2321
|
+
declare :function_exists, [:name]
|
2322
|
+
|
2323
|
+
# Check whether a mixin with the given name exists.
|
2324
|
+
#
|
2325
|
+
# @example
|
2326
|
+
# mixin-exists(nonexistent) => false
|
2327
|
+
#
|
2328
|
+
# @mixin red-text { color: red; }
|
2329
|
+
# mixin-exists(red-text) => true
|
2330
|
+
#
|
2331
|
+
# @overload mixin_exists($name)
|
2332
|
+
# @param name [Sass::Script::Value::String] The name of the mixin to
|
2333
|
+
# check.
|
2334
|
+
# @return [Sass::Script::Value::Bool] Whether the mixin is defined.
|
2335
|
+
def mixin_exists(name)
|
2336
|
+
assert_type name, :String, :name
|
2337
|
+
bool(environment.mixin(name.value))
|
2338
|
+
end
|
2339
|
+
declare :mixin_exists, [:name]
|
2340
|
+
|
2341
|
+
# Return a string containing the value as its Sass representation.
|
2342
|
+
#
|
2343
|
+
# @overload inspect($value)
|
2344
|
+
# @param $value [Sass::Script::Value::Base] The value to inspect.
|
2345
|
+
# @return [Sass::Script::Value::String] A representation of the value as
|
2346
|
+
# it would be written in Sass.
|
2347
|
+
def inspect(value)
|
2348
|
+
value.check_deprecated_interp if value.is_a?(Sass::Script::Value::String)
|
2349
|
+
unquoted_string(value.to_sass)
|
2350
|
+
end
|
2351
|
+
declare :inspect, [:value]
|
2352
|
+
|
2353
|
+
# @overload random()
|
2354
|
+
# Return a decimal between 0 and 1, inclusive of 0 but not 1.
|
2355
|
+
# @return [Sass::Script::Value::Number] A decimal value.
|
2356
|
+
# @overload random($limit)
|
2357
|
+
# Return an integer between 1 and `$limit`, inclusive of both 1 and `$limit`.
|
2358
|
+
# @param $limit [Sass::Script::Value::Number] The maximum of the random integer to be
|
2359
|
+
# returned, a positive integer.
|
2360
|
+
# @return [Sass::Script::Value::Number] An integer.
|
2361
|
+
# @raise [ArgumentError] if the `$limit` is not 1 or greater
|
2362
|
+
def random(limit = nil)
|
2363
|
+
generator = Sass::Script::Functions.random_number_generator
|
2364
|
+
if limit
|
2365
|
+
assert_integer limit, "limit"
|
2366
|
+
if limit.to_i < 1
|
2367
|
+
raise ArgumentError.new("$limit #{limit} must be greater than or equal to 1")
|
2368
|
+
end
|
2369
|
+
number(1 + generator.rand(limit.to_i))
|
2370
|
+
else
|
2371
|
+
number(generator.rand)
|
2372
|
+
end
|
2373
|
+
end
|
2374
|
+
declare :random, []
|
2375
|
+
declare :random, [:limit]
|
2376
|
+
|
2377
|
+
# Parses a user-provided selector into a list of lists of strings
|
2378
|
+
# as returned by `&`.
|
2379
|
+
#
|
2380
|
+
# @example
|
2381
|
+
# selector-parse(".foo .bar, .baz .bang") => ('.foo' '.bar', '.baz' '.bang')
|
2382
|
+
#
|
2383
|
+
# @overload selector_parse($selector)
|
2384
|
+
# @param $selector [Sass::Script::Value::String, Sass::Script::Value::List]
|
2385
|
+
# The selector to parse. This can be either a string, a list of
|
2386
|
+
# strings, or a list of lists of strings as returned by `&`.
|
2387
|
+
# @return [Sass::Script::Value::List]
|
2388
|
+
# A list of lists of strings representing `$selector`. This is
|
2389
|
+
# in the same format as a selector returned by `&`.
|
2390
|
+
def selector_parse(selector)
|
2391
|
+
parse_selector(selector, :selector).to_sass_script
|
2392
|
+
end
|
2393
|
+
declare :selector_parse, [:selector]
|
2394
|
+
|
2395
|
+
# Return a new selector with all selectors in `$selectors` nested beneath
|
2396
|
+
# one another as though they had been nested in the stylesheet as
|
2397
|
+
# `$selector1 { $selector2 { ... } }`.
|
2398
|
+
#
|
2399
|
+
# Unlike most selector functions, `selector-nest` allows the
|
2400
|
+
# parent selector `&` to be used in any selector but the first.
|
2401
|
+
#
|
2402
|
+
# @example
|
2403
|
+
# selector-nest(".foo", ".bar", ".baz") => .foo .bar .baz
|
2404
|
+
# selector-nest(".a .foo", ".b .bar") => .a .foo .b .bar
|
2405
|
+
# selector-nest(".foo", "&.bar") => .foo.bar
|
2406
|
+
#
|
2407
|
+
# @overload selector_nest($selectors...)
|
2408
|
+
# @param $selectors [[Sass::Script::Value::String, Sass::Script::Value::List]]
|
2409
|
+
# The selectors to nest. At least one selector must be passed. Each of
|
2410
|
+
# these can be either a string, a list of strings, or a list of lists of
|
2411
|
+
# strings as returned by `&`.
|
2412
|
+
# @return [Sass::Script::Value::List]
|
2413
|
+
# A list of lists of strings representing the result of nesting
|
2414
|
+
# `$selectors`. This is in the same format as a selector returned by
|
2415
|
+
# `&`.
|
2416
|
+
def selector_nest(*selectors)
|
2417
|
+
if selectors.empty?
|
2418
|
+
raise ArgumentError.new("$selectors: At least one selector must be passed")
|
2419
|
+
end
|
2420
|
+
|
2421
|
+
parsed = [parse_selector(selectors.first, :selectors)]
|
2422
|
+
parsed += selectors[1..-1].map {|sel| parse_selector(sel, :selectors, true)}
|
2423
|
+
parsed.inject {|result, child| child.resolve_parent_refs(result)}.to_sass_script
|
2424
|
+
end
|
2425
|
+
declare :selector_nest, [], :var_args => true
|
2426
|
+
|
2427
|
+
# Return a new selector with all selectors in `$selectors` appended one
|
2428
|
+
# another as though they had been nested in the stylesheet as `$selector1 {
|
2429
|
+
# &$selector2 { ... } }`.
|
2430
|
+
#
|
2431
|
+
# @example
|
2432
|
+
# selector-append(".foo", ".bar", ".baz") => .foo.bar.baz
|
2433
|
+
# selector-append(".a .foo", ".b .bar") => "a .foo.b .bar"
|
2434
|
+
# selector-append(".foo", "-suffix") => ".foo-suffix"
|
2435
|
+
#
|
2436
|
+
# @overload selector_append($selectors...)
|
2437
|
+
# @param $selectors [[Sass::Script::Value::String, Sass::Script::Value::List]]
|
2438
|
+
# The selectors to append. At least one selector must be passed. Each of
|
2439
|
+
# these can be either a string, a list of strings, or a list of lists of
|
2440
|
+
# strings as returned by `&`.
|
2441
|
+
# @return [Sass::Script::Value::List]
|
2442
|
+
# A list of lists of strings representing the result of appending
|
2443
|
+
# `$selectors`. This is in the same format as a selector returned by
|
2444
|
+
# `&`.
|
2445
|
+
# @raise [ArgumentError] if a selector could not be appended.
|
2446
|
+
def selector_append(*selectors)
|
2447
|
+
if selectors.empty?
|
2448
|
+
raise ArgumentError.new("$selectors: At least one selector must be passed")
|
2449
|
+
end
|
2450
|
+
|
2451
|
+
selectors.map {|sel| parse_selector(sel, :selectors)}.inject do |parent, child|
|
2452
|
+
child.members.each do |seq|
|
2453
|
+
sseq = seq.members.first
|
2454
|
+
unless sseq.is_a?(Sass::Selector::SimpleSequence)
|
2455
|
+
raise ArgumentError.new("Can't append \"#{seq}\" to \"#{parent}\"")
|
2456
|
+
end
|
2457
|
+
|
2458
|
+
base = sseq.base
|
2459
|
+
case base
|
2460
|
+
when Sass::Selector::Universal
|
2461
|
+
raise ArgumentError.new("Can't append \"#{seq}\" to \"#{parent}\"")
|
2462
|
+
when Sass::Selector::Element
|
2463
|
+
unless base.namespace.nil?
|
2464
|
+
raise ArgumentError.new("Can't append \"#{seq}\" to \"#{parent}\"")
|
2465
|
+
end
|
2466
|
+
sseq.members[0] = Sass::Selector::Parent.new(base.name)
|
2467
|
+
else
|
2468
|
+
sseq.members.unshift Sass::Selector::Parent.new
|
2469
|
+
end
|
2470
|
+
end
|
2471
|
+
child.resolve_parent_refs(parent)
|
2472
|
+
end.to_sass_script
|
2473
|
+
end
|
2474
|
+
declare :selector_append, [], :var_args => true
|
2475
|
+
|
2476
|
+
# Returns a new version of `$selector` with `$extendee` extended
|
2477
|
+
# with `$extender`. This works just like the result of
|
2478
|
+
#
|
2479
|
+
# $selector { ... }
|
2480
|
+
# $extender { @extend $extendee }
|
2481
|
+
#
|
2482
|
+
# @example
|
2483
|
+
# selector-extend(".a .b", ".b", ".foo .bar") => .a .b, .a .foo .bar, .foo .a .bar
|
2484
|
+
#
|
2485
|
+
# @overload selector_extend($selector, $extendee, $extender)
|
2486
|
+
# @param $selector [Sass::Script::Value::String, Sass::Script::Value::List]
|
2487
|
+
# The selector within which `$extendee` is extended with
|
2488
|
+
# `$extender`. This can be either a string, a list of strings,
|
2489
|
+
# or a list of lists of strings as returned by `&`.
|
2490
|
+
# @param $extendee [Sass::Script::Value::String, Sass::Script::Value::List]
|
2491
|
+
# The selector being extended. This can be either a string, a
|
2492
|
+
# list of strings, or a list of lists of strings as returned
|
2493
|
+
# by `&`.
|
2494
|
+
# @param $extender [Sass::Script::Value::String, Sass::Script::Value::List]
|
2495
|
+
# The selector being injected into `$selector`. This can be
|
2496
|
+
# either a string, a list of strings, or a list of lists of
|
2497
|
+
# strings as returned by `&`.
|
2498
|
+
# @return [Sass::Script::Value::List]
|
2499
|
+
# A list of lists of strings representing the result of the
|
2500
|
+
# extension. This is in the same format as a selector returned
|
2501
|
+
# by `&`.
|
2502
|
+
# @raise [ArgumentError] if the extension fails
|
2503
|
+
def selector_extend(selector, extendee, extender)
|
2504
|
+
selector = parse_selector(selector, :selector)
|
2505
|
+
extendee = parse_selector(extendee, :extendee)
|
2506
|
+
extender = parse_selector(extender, :extender)
|
2507
|
+
|
2508
|
+
extends = Sass::Util::SubsetMap.new
|
2509
|
+
begin
|
2510
|
+
extender.populate_extends(extends, extendee)
|
2511
|
+
selector.do_extend(extends).to_sass_script
|
2512
|
+
rescue Sass::SyntaxError => e
|
2513
|
+
raise ArgumentError.new(e.to_s)
|
2514
|
+
end
|
2515
|
+
end
|
2516
|
+
declare :selector_extend, [:selector, :extendee, :extender]
|
2517
|
+
|
2518
|
+
# Replaces all instances of `$original` with `$replacement` in `$selector`
|
2519
|
+
#
|
2520
|
+
# This works by using `@extend` and throwing away the original
|
2521
|
+
# selector. This means that it can be used to do very advanced
|
2522
|
+
# replacements; see the examples below.
|
2523
|
+
#
|
2524
|
+
# @example
|
2525
|
+
# selector-replace(".foo .bar", ".bar", ".baz") => ".foo .baz"
|
2526
|
+
# selector-replace(".foo.bar.baz", ".foo.baz", ".qux") => ".bar.qux"
|
2527
|
+
#
|
2528
|
+
# @overload selector_replace($selector, $original, $replacement)
|
2529
|
+
# @param $selector [Sass::Script::Value::String, Sass::Script::Value::List]
|
2530
|
+
# The selector within which `$original` is replaced with
|
2531
|
+
# `$replacement`. This can be either a string, a list of
|
2532
|
+
# strings, or a list of lists of strings as returned by `&`.
|
2533
|
+
# @param $original [Sass::Script::Value::String, Sass::Script::Value::List]
|
2534
|
+
# The selector being replaced. This can be either a string, a
|
2535
|
+
# list of strings, or a list of lists of strings as returned
|
2536
|
+
# by `&`.
|
2537
|
+
# @param $replacement [Sass::Script::Value::String, Sass::Script::Value::List]
|
2538
|
+
# The selector that `$original` is being replaced with. This
|
2539
|
+
# can be either a string, a list of strings, or a list of
|
2540
|
+
# lists of strings as returned by `&`.
|
2541
|
+
# @return [Sass::Script::Value::List]
|
2542
|
+
# A list of lists of strings representing the result of the
|
2543
|
+
# extension. This is in the same format as a selector returned
|
2544
|
+
# by `&`.
|
2545
|
+
# @raise [ArgumentError] if the replacement fails
|
2546
|
+
def selector_replace(selector, original, replacement)
|
2547
|
+
selector = parse_selector(selector, :selector)
|
2548
|
+
original = parse_selector(original, :original)
|
2549
|
+
replacement = parse_selector(replacement, :replacement)
|
2550
|
+
|
2551
|
+
extends = Sass::Util::SubsetMap.new
|
2552
|
+
begin
|
2553
|
+
replacement.populate_extends(extends, original)
|
2554
|
+
selector.do_extend(extends, [], true).to_sass_script
|
2555
|
+
rescue Sass::SyntaxError => e
|
2556
|
+
raise ArgumentError.new(e.to_s)
|
2557
|
+
end
|
2558
|
+
end
|
2559
|
+
declare :selector_replace, [:selector, :original, :replacement]
|
2560
|
+
|
2561
|
+
# Unifies two selectors into a single selector that matches only
|
2562
|
+
# elements matched by both input selectors. Returns `null` if
|
2563
|
+
# there is no such selector.
|
2564
|
+
#
|
2565
|
+
# Like the selector unification done for `@extend`, this doesn't
|
2566
|
+
# guarantee that the output selector will match *all* elements
|
2567
|
+
# matched by both input selectors. For example, if `.a .b` is
|
2568
|
+
# unified with `.x .y`, `.a .x .b.y, .x .a .b.y` will be returned,
|
2569
|
+
# but `.a.x .b.y` will not. This avoids exponential output size
|
2570
|
+
# while matching all elements that are likely to exist in
|
2571
|
+
# practice.
|
2572
|
+
#
|
2573
|
+
# @example
|
2574
|
+
# selector-unify(".a", ".b") => .a.b
|
2575
|
+
# selector-unify(".a .b", ".x .y") => .a .x .b.y, .x .a .b.y
|
2576
|
+
# selector-unify(".a.b", ".b.c") => .a.b.c
|
2577
|
+
# selector-unify("#a", "#b") => null
|
2578
|
+
#
|
2579
|
+
# @overload selector_unify($selector1, $selector2)
|
2580
|
+
# @param $selector1 [Sass::Script::Value::String, Sass::Script::Value::List]
|
2581
|
+
# The first selector to be unified. This can be either a
|
2582
|
+
# string, a list of strings, or a list of lists of strings as
|
2583
|
+
# returned by `&`.
|
2584
|
+
# @param $selector2 [Sass::Script::Value::String, Sass::Script::Value::List]
|
2585
|
+
# The second selector to be unified. This can be either a
|
2586
|
+
# string, a list of strings, or a list of lists of strings as
|
2587
|
+
# returned by `&`.
|
2588
|
+
# @return [Sass::Script::Value::List, Sass::Script::Value::Null]
|
2589
|
+
# A list of lists of strings representing the result of the
|
2590
|
+
# unification, or null if no unification exists. This is in
|
2591
|
+
# the same format as a selector returned by `&`.
|
2592
|
+
def selector_unify(selector1, selector2)
|
2593
|
+
selector1 = parse_selector(selector1, :selector1)
|
2594
|
+
selector2 = parse_selector(selector2, :selector2)
|
2595
|
+
return null unless (unified = selector1.unify(selector2))
|
2596
|
+
unified.to_sass_script
|
2597
|
+
end
|
2598
|
+
declare :selector_unify, [:selector1, :selector2]
|
2599
|
+
|
2600
|
+
# Returns the [simple
|
2601
|
+
# selectors](http://dev.w3.org/csswg/selectors4/#simple) that
|
2602
|
+
# comprise the compound selector `$selector`.
|
2603
|
+
#
|
2604
|
+
# Note that `$selector` **must be** a [compound
|
2605
|
+
# selector](http://dev.w3.org/csswg/selectors4/#compound). That
|
2606
|
+
# means it cannot contain commas or spaces. It also means that
|
2607
|
+
# unlike other selector functions, this takes only strings, not
|
2608
|
+
# lists.
|
2609
|
+
#
|
2610
|
+
# @example
|
2611
|
+
# simple-selectors(".foo.bar") => ".foo", ".bar"
|
2612
|
+
# simple-selectors(".foo.bar.baz") => ".foo", ".bar", ".baz"
|
2613
|
+
#
|
2614
|
+
# @overload simple_selectors($selector)
|
2615
|
+
# @param $selector [Sass::Script::Value::String]
|
2616
|
+
# The compound selector whose simple selectors will be extracted.
|
2617
|
+
# @return [Sass::Script::Value::List]
|
2618
|
+
# A list of simple selectors in the compound selector.
|
2619
|
+
def simple_selectors(selector)
|
2620
|
+
selector = parse_compound_selector(selector, :selector)
|
2621
|
+
list(selector.members.map {|simple| unquoted_string(simple.to_s)}, :comma)
|
2622
|
+
end
|
2623
|
+
declare :simple_selectors, [:selector]
|
2624
|
+
|
2625
|
+
# Returns whether `$super` is a superselector of `$sub`. This means that
|
2626
|
+
# `$super` matches all the elements that `$sub` matches, as well as possibly
|
2627
|
+
# additional elements. In general, simpler selectors tend to be
|
2628
|
+
# superselectors of more complex oned.
|
2629
|
+
#
|
2630
|
+
# @example
|
2631
|
+
# is-superselector(".foo", ".foo.bar") => true
|
2632
|
+
# is-superselector(".foo.bar", ".foo") => false
|
2633
|
+
# is-superselector(".bar", ".foo .bar") => true
|
2634
|
+
# is-superselector(".foo .bar", ".bar") => false
|
2635
|
+
#
|
2636
|
+
# @overload is_superselector($super, $sub)
|
2637
|
+
# @param $super [Sass::Script::Value::String, Sass::Script::Value::List]
|
2638
|
+
# The potential superselector. This can be either a string, a list of
|
2639
|
+
# strings, or a list of lists of strings as returned by `&`.
|
2640
|
+
# @param $sub [Sass::Script::Value::String, Sass::Script::Value::List]
|
2641
|
+
# The potential subselector. This can be either a string, a list of
|
2642
|
+
# strings, or a list of lists of strings as returned by `&`.
|
2643
|
+
# @return [Sass::Script::Value::Bool]
|
2644
|
+
# Whether `$selector1` is a superselector of `$selector2`.
|
2645
|
+
def is_superselector(sup, sub)
|
2646
|
+
sup = parse_selector(sup, :super)
|
2647
|
+
sub = parse_selector(sub, :sub)
|
2648
|
+
bool(sup.superselector?(sub))
|
2649
|
+
end
|
2650
|
+
declare :is_superselector, [:super, :sub]
|
2651
|
+
|
2652
|
+
private
|
2653
|
+
|
2654
|
+
# This method implements the pattern of transforming a numeric value into
|
2655
|
+
# another numeric value with the same units.
|
2656
|
+
# It yields a number to a block to perform the operation and return a number
|
2657
|
+
def numeric_transformation(value)
|
2658
|
+
assert_type value, :Number, :value
|
2659
|
+
Sass::Script::Value::Number.new(
|
2660
|
+
yield(value.value), value.numerator_units, value.denominator_units)
|
2661
|
+
end
|
2662
|
+
|
2663
|
+
# @comment
|
2664
|
+
# rubocop:disable ParameterLists
|
2665
|
+
def _adjust(color, amount, attr, range, op, units = "")
|
2666
|
+
# rubocop:enable ParameterLists
|
2667
|
+
assert_type color, :Color, :color
|
2668
|
+
assert_type amount, :Number, :amount
|
2669
|
+
Sass::Util.check_range('Amount', range, amount, units)
|
2670
|
+
|
2671
|
+
color.with(attr => color.send(attr).send(op, amount.value))
|
2672
|
+
end
|
2673
|
+
|
2674
|
+
def check_alpha_unit(alpha, function)
|
2675
|
+
return if alpha.unitless?
|
2676
|
+
|
2677
|
+
if alpha.is_unit?("%")
|
2678
|
+
Sass::Util.sass_warn(<<WARNING)
|
2679
|
+
DEPRECATION WARNING: Passing a percentage as the alpha value to #{function}() will be
|
2680
|
+
interpreted differently in future versions of Sass. For now, use #{alpha.value} instead.
|
2681
|
+
WARNING
|
2682
|
+
else
|
2683
|
+
Sass::Util.sass_warn(<<WARNING)
|
2684
|
+
DEPRECATION WARNING: Passing a number with units as the alpha value to #{function}() is
|
2685
|
+
deprecated and will be an error in future versions of Sass. Use #{alpha.value} instead.
|
2686
|
+
WARNING
|
2687
|
+
end
|
2688
|
+
end
|
2689
|
+
end
|
2690
|
+
end
|