brakeman 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +11 -0
- data/README.md +3 -2
- data/bundle/load.rb +4 -4
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/History.txt +7 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/Manifest.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/README.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/bin/ruby_parse +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/bin/ruby_parse_extract_error +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby18_parser.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby18_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby19_parser.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby19_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby20_parser.rb +6728 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby20_parser.y +33 -24
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby21_parser.rb +6766 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby21_parser.y +33 -24
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby22_parser.rb +6811 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby22_parser.y +33 -24
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.2/lib/ruby23_parser.rb +6817 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby23_parser.y +34 -55
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_lexer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_lexer.rex +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_lexer.rex.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_parser.yy +36 -69
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/lib/ruby_parser_extras.rb +43 -3
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/test/test_ruby_lexer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/test/test_ruby_parser.rb +42 -1
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/test/test_ruby_parser_extras.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/CHANGES +5 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/Gemfile +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/LICENSE +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/README.jp.md +36 -11
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/README.md +44 -19
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/context.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/profile-parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/profile-render.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/run-benchmarks.rb +41 -34
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/run-diffbench.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/view.erb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/view.haml +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/benchmarks/view.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/bin/slimrb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/include.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/jp/include.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/jp/logic_less.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/jp/smart.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/jp/translator.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/logic_less.md +1 -1
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/smart.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/doc/translator.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/code_attributes.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/command.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/controls.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/do_inserter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/embedded.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/end_inserter.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/engine.rb +1 -3
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/erb_converter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/grammar.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/include.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/interpolation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/logic_less.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/logic_less/context.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/logic_less/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/parser.rb +22 -12
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/smart.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/smart/escaper.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/smart/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/smart/parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/splat/builder.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/splat/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/template.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/translator.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/lib/slim/version.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/slim.gemspec +1 -1
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_code_blocks.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_code_escaping.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_code_evaluation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_code_output.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_code_structure.rb +18 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_commands.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_embedded_engines.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_encoding.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_erb_converter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_html_attributes.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_html_escaping.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_html_structure.rb +16 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_parser_errors.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_pretty.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_ruby_errors.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_slim_template.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_tabs.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_text_interpolation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_thread_options.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/core/test_unicode.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/include/files/recursive.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/include/files/slimfile.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/include/files/subdir/test.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/include/files/textfile +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/include/test_include.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/literate/TESTS.md +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/literate/helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/literate/run.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/logic_less/test_logic_less.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/controllers/application_controller.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/controllers/entries_controller.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/controllers/slim_controller.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/helpers/application_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/models/entry.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/entries/edit.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/layouts/application.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/_partial.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/content_for.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/erb.html.erb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/form_for.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/helper.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/integers.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/no_layout.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/normal.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/partial.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/splat.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/thread_options.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/variables.html.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/app/views/slim/xml.slim +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config.ru +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/application.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/boot.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/environment.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/environments/test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/initializers/backtrace_silencers.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/initializers/inflections.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/initializers/mime_types.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/initializers/secret_token.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/initializers/session_store.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/locales/en.yml +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/config/routes.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/script/rails +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/test/helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/rails/test/test_slim.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/smart/test_smart_text.rb +6 -6
- data/bundle/ruby/2.3.0/gems/{slim-3.0.6 → slim-3.0.7}/test/translator/test_translator.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/CHANGES +5 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/EXPRESSIONS.md +0 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/Gemfile +3 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/LICENSE +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/README.md +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple.rb +2 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/remove_bom.rb +1 -1
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/static_analyzer.rb +87 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/filters/string_splitter.rb +130 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generator.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generators/array_buffer.rb +3 -2
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generators/erb.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generators/rails_output_buffer.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/attribute_merger.rb +5 -10
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/pretty.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/mixins/dispatcher.rb +8 -6
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/templates/rails.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/lib/temple/utils.rb +15 -4
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/temple.gemspec +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_code_merger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_control_flow.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_eraser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_escapable.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_multi_flattener.rb +0 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb +23 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/filters/test_static_merger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_string_splitter.rb +18 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/html/test_attribute_merger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/html/test_attribute_remover.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/html/test_attribute_sorter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/html/test_fast.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/html/test_pretty.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/mixins/test_dispatcher.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/mixins/test_grammar_dsl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_engine.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_erb.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_filter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_generator.rb +4 -4
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_grammar.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{temple-0.7.6 → temple-0.7.7}/test/test_utils.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/CHANGELOG.md +17 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/COPYING +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/Gemfile +3 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/HACKING +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/README.md +3 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/bin/tilt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/docs/TEMPLATES.md +34 -4
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/docs/common.css +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt.rb +10 -6
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/babel.rb +2 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/builder.rb +12 -8
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/commonmarker.rb +21 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/dummy.rb +3 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/erubis.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/mapping.rb +37 -9
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/pandoc.rb +49 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/rst-pandoc.rb +18 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/string.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/template.rb +6 -3
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/typescript.rb +26 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/man/index.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/man/tilt.1.ronn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/locals.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/markaby.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/markaby_other_static.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/render_twice.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/scope.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/markaby/yielding.mab +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/test/mytemplate.rb +2 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_asciidoctor_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_babeltemplate.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_blueclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_buildertemplate_test.rb +13 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_cache_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_coffeescripttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_commonmarkertemplate_test.rb +20 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_compilesite_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_creoletemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_csv_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_erbtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_erubistemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_etannitemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_hamltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_kramdown_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_lesstemplate_test.less +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_lesstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_liquidtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_mapping_test.rb +17 -14
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_markaby_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_markdown_test.rb +9 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_marukutemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_metadata_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_nokogiritemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_pandoctemplate_test.rb +67 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_prawntemplate.prawn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_prawntemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_radiustemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_rdiscounttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_rdoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_redcarpettemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_redclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_rstpandoctemplate_test.rb +32 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_sasstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_stringtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_template_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.5/test/tilt_typescript_test.rb +34 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_wikiclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/test/tilt_yajltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.2 → tilt-2.0.5}/tilt.gemspec +12 -2
- data/lib/brakeman.rb +21 -12
- data/lib/brakeman/checks/check_sql.rb +3 -3
- data/lib/brakeman/checks/check_validation_regex.rb +31 -3
- data/lib/brakeman/options.rb +4 -0
- data/lib/brakeman/parsers/rails3_erubis.rb +43 -23
- data/lib/brakeman/processors/alias_processor.rb +5 -0
- data/lib/brakeman/processors/base_processor.rb +2 -8
- data/lib/brakeman/processors/erb_template_processor.rb +1 -5
- data/lib/brakeman/processors/erubis_template_processor.rb +16 -10
- data/lib/brakeman/processors/haml_template_processor.rb +4 -2
- data/lib/brakeman/processors/lib/basic_processor.rb +2 -16
- data/lib/brakeman/processors/lib/safe_call_helper.rb +16 -0
- data/lib/brakeman/processors/output_processor.rb +1 -1
- data/lib/brakeman/processors/slim_template_processor.rb +1 -5
- data/lib/brakeman/processors/template_processor.rb +19 -0
- data/lib/brakeman/rescanner.rb +2 -1
- data/lib/brakeman/scanner.rb +2 -4
- data/lib/brakeman/tracker.rb +0 -9
- data/lib/brakeman/tracker/collection.rb +4 -0
- data/lib/brakeman/version.rb +1 -1
- metadata +322 -307
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby20_parser.rb +0 -6723
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby21_parser.rb +0 -6764
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby22_parser.rb +0 -6804
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby23_parser.rb +0 -6905
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/Gemfile +0 -3
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/version.rb +0 -3
File without changes
|
data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/test/test_ruby_parser.rb
RENAMED
@@ -1401,6 +1401,19 @@ module TestRubyParserShared
|
|
1401
1401
|
assert_parse rb, pt
|
1402
1402
|
end
|
1403
1403
|
|
1404
|
+
def test_qwords_line_breaks
|
1405
|
+
skip "not yet"
|
1406
|
+
|
1407
|
+
rb = "%w(\na\nb\n)\n1"
|
1408
|
+
pt = s(:block,
|
1409
|
+
s(:array,
|
1410
|
+
s(:str, "a").line(2),
|
1411
|
+
s(:str, "b").line(3)).line(1),
|
1412
|
+
s(:lit, 1).line(5))
|
1413
|
+
|
1414
|
+
assert_parse rb, pt
|
1415
|
+
end
|
1416
|
+
|
1404
1417
|
def test_qWords_space
|
1405
1418
|
rb = "%W( )"
|
1406
1419
|
pt = s(:array)
|
@@ -2196,6 +2209,13 @@ module TestRubyParserShared20to22
|
|
2196
2209
|
assert_parse rb, pt
|
2197
2210
|
end
|
2198
2211
|
|
2212
|
+
def test_dstr_lex_state
|
2213
|
+
rb = '"#{p:a}"'
|
2214
|
+
pt = s(:dstr, "", s(:evstr, s(:call, nil, :p, s(:lit, :a))))
|
2215
|
+
|
2216
|
+
assert_parse rb, pt
|
2217
|
+
end
|
2218
|
+
|
2199
2219
|
def test_call_arg_kwsplat
|
2200
2220
|
rb = "a(b, **1)"
|
2201
2221
|
pt = s(:call, nil, :a, s(:call, nil, :b), s(:hash, s(:kwsplat, s(:lit, 1))))
|
@@ -3429,6 +3449,13 @@ class TestRuby23Parser < RubyParserTestCase
|
|
3429
3449
|
assert_parse rb, pt
|
3430
3450
|
end
|
3431
3451
|
|
3452
|
+
def test_safe_call_rhs_newline
|
3453
|
+
rb = "c = a&.b\n"
|
3454
|
+
pt = s(:lasgn, :c, s(:safe_call, s(:call, nil, :a), :b))
|
3455
|
+
|
3456
|
+
assert_parse rb, pt
|
3457
|
+
end
|
3458
|
+
|
3432
3459
|
def test_safe_calls
|
3433
3460
|
rb = "a&.b&.c(1)"
|
3434
3461
|
pt = s(:safe_call, s(:safe_call, s(:call, nil, :a), :b), :c, s(:lit, 1))
|
@@ -3459,7 +3486,21 @@ class TestRuby23Parser < RubyParserTestCase
|
|
3459
3486
|
|
3460
3487
|
def test_safe_call_operator
|
3461
3488
|
rb = "a&.> 1"
|
3462
|
-
pt = s(:safe_call, s(:call, nil, :a), :>, s(:lit, 1))
|
3489
|
+
pt = s(:safe_call, s(:call, nil, :a), :>, s(:lit, 1)).line(1)
|
3490
|
+
|
3491
|
+
assert_parse rb, pt
|
3492
|
+
end
|
3493
|
+
|
3494
|
+
def test_safe_op_asgn
|
3495
|
+
rb = "a&.b += x 1\n"
|
3496
|
+
pt = s(:safe_op_asgn, s(:call, nil, :a), s(:call, nil, :x, s(:lit, 1)), :b, :+).line(1)
|
3497
|
+
|
3498
|
+
assert_parse rb, pt
|
3499
|
+
end
|
3500
|
+
|
3501
|
+
def test_safe_op_asgn2
|
3502
|
+
rb = "a&.b ||=\nx;"
|
3503
|
+
pt = s(:safe_op_asgn2, s(:call, nil, :a), :b=, :"||", s(:call, nil, :x)).line(1)
|
3463
3504
|
|
3464
3505
|
assert_parse rb, pt
|
3465
3506
|
end
|
data/bundle/ruby/2.3.0/gems/{ruby_parser-3.8.1 → ruby_parser-3.8.2}/test/test_ruby_parser_extras.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Slim
|
2
2
|
|
3
|
-
[![Gem Version](https://img.shields.io/gem/v/slim.svg)](http://rubygems.org/gems/slim) [![Build Status](https://img.shields.io/travis/slim-template/slim.svg?branch=master)](http://travis-ci.org/slim-template/slim) [![Dependency Status](https://img.shields.io/gemnasium/slim-template/slim.svg?travis)](https://gemnasium.com/slim-template/slim) [![Code Climate](https://
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/slim.svg)](http://rubygems.org/gems/slim) [![Build Status](https://img.shields.io/travis/slim-template/slim.svg?branch=master)](http://travis-ci.org/slim-template/slim) [![Dependency Status](https://img.shields.io/gemnasium/slim-template/slim.svg?travis)](https://gemnasium.com/slim-template/slim) [![Code Climate](https://codeclimate.com/github/slim-template/slim/badges/gpa.svg)](https://codeclimate.com/github/slim-template/slim) [![Test Coverage](https://codeclimate.com/github/slim-template/slim/badges/coverage.svg)](https://codeclimate.com/github/slim-template/slim/coverage) [![Gittip donate button](https://img.shields.io/gratipay/bevry.svg)](https://www.gittip.com/min4d/ "Donate weekly to this project using Gittip")
|
4
4
|
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](https://flattr.com/submit/auto?user_id=min4d&url=http%3A%2F%2Fslim-lang.org%2F "Donate monthly to this project using Flattr")
|
5
5
|
|
6
6
|
Slim は 不可解にならないように view の構文を本質的な部品まで減らすことを目指したテンプレート言語です。標準的な HTML テンプレートからどれだけのものが削除できるか確かめるところから始まりました。(<, >, 閉じタグなど) 多くの人が Slim に興味を持ったことで, 機能性は発展し, 柔軟な構文をもたらしました。
|
@@ -238,7 +238,7 @@ html コメントにはスラッシュの直後にエクスクラメーション
|
|
238
238
|
p もっといいブラウザを使ってください。
|
239
239
|
~~~
|
240
240
|
|
241
|
-
|
241
|
+
レンダリング結果:
|
242
242
|
|
243
243
|
~~~ html
|
244
244
|
<!--[if IE]><p>もっといいブラウザを使ってください。</p><![endif]-->
|
@@ -246,9 +246,9 @@ html コメントにはスラッシュの直後にエクスクラメーション
|
|
246
246
|
|
247
247
|
## HTML タグ
|
248
248
|
|
249
|
-
|
249
|
+
# <!DOCTYPE> 宣言
|
250
250
|
|
251
|
-
|
251
|
+
doctype はとても簡単な方法で複雑なドキュメントタイプを生成するために使われる特別なキーワードです。
|
252
252
|
|
253
253
|
XML 宣言
|
254
254
|
|
@@ -513,7 +513,7 @@ input type="text" disabled=nil
|
|
513
513
|
a.menu class="highlight" href="http://slim-lang.com/" Slim-lang.com
|
514
514
|
~~~
|
515
515
|
|
516
|
-
|
516
|
+
レンダリング結果:
|
517
517
|
|
518
518
|
~~~ html
|
519
519
|
<a class="menu highlight" href="http://slim-lang.com/">Slim-lang.com</a>
|
@@ -534,7 +534,7 @@ a class=:menu,:highlight
|
|
534
534
|
.card*{'data-url'=>place_path(place), 'data-id'=>place.id} = place.name
|
535
535
|
~~~
|
536
536
|
|
537
|
-
|
537
|
+
レンダリング結果:
|
538
538
|
|
539
539
|
~~~ html
|
540
540
|
<div class="card" data-id="1234" data-url="/place/1234">Slim の家</div>
|
@@ -575,7 +575,7 @@ ruby:
|
|
575
575
|
*a_unless_current リンク
|
576
576
|
~~~
|
577
577
|
|
578
|
-
|
578
|
+
レンダリング結果:
|
579
579
|
|
580
580
|
~~~ html
|
581
581
|
<span>リンク</span><a href="http://slim-lang.com/">リンク</a>
|
@@ -585,7 +585,7 @@ ruby:
|
|
585
585
|
|
586
586
|
#### タグショートカット
|
587
587
|
|
588
|
-
`:shortcut` オプションを設定することで独自のタグショートカットを定義できます。
|
588
|
+
`:shortcut` オプションを設定することで独自のタグショートカットを定義できます。Rails アプリケーションでは, `config/initializers/slim.rb` のようにイニシャライザに定義します。Sinatra アプリでは, `require 'slim'` が書かれた下であればどこにでも設定を定義することができます。
|
589
589
|
|
590
590
|
~~~ ruby
|
591
591
|
Slim::Engine.set_options shortcut: {'c' => {tag: 'container'}, '#' => {attr: 'id'}, '.' => {attr: 'class'} }
|
@@ -665,6 +665,29 @@ Slim の中で次のように使用し
|
|
665
665
|
<div class="person" role="admin" data-role="admin">Daniel</div>
|
666
666
|
~~~
|
667
667
|
|
668
|
+
次のように追加の属性固定値を設定することもできます。
|
669
|
+
|
670
|
+
~~~ ruby
|
671
|
+
Slim::Engine.set_options shortcut: {'^' => {tag: 'script', attr: 'data-binding',
|
672
|
+
additional_attrs: { type: "text/javascript" }}}
|
673
|
+
~~~
|
674
|
+
|
675
|
+
このように使用します。
|
676
|
+
|
677
|
+
~~~ slim
|
678
|
+
^products
|
679
|
+
== @products.to_json
|
680
|
+
~~~
|
681
|
+
|
682
|
+
レンダリング結果です。
|
683
|
+
|
684
|
+
~~~ html
|
685
|
+
<script data-binding="products" type="text/javascript">
|
686
|
+
[{"name": "product1", "price": "$100"},
|
687
|
+
{"name": "prodcut2", "price": "$200"}]
|
688
|
+
</script>
|
689
|
+
~~~
|
690
|
+
|
668
691
|
#### ID ショートカット `#` と class ショートカット `.`
|
669
692
|
|
670
693
|
`id` と `class` の属性を次のショートカットで指定できます。
|
@@ -754,7 +777,7 @@ end
|
|
754
777
|
= captured_content
|
755
778
|
~~~
|
756
779
|
|
757
|
-
|
780
|
+
別の興味深いユースケースは, enumerableを使いそれぞれの要素をキャプチャすることです。ヘルパは, このようになります。
|
758
781
|
|
759
782
|
~~~ ruby
|
760
783
|
module Capture
|
@@ -766,7 +789,7 @@ module Capture
|
|
766
789
|
end
|
767
790
|
~~~
|
768
791
|
|
769
|
-
|
792
|
+
そして, 次のように使用出来ます。
|
770
793
|
|
771
794
|
~~~ slim
|
772
795
|
- links = { 'http://slim-lang.com' => 'The Slim Template Language' }
|
@@ -774,7 +797,7 @@ end
|
|
774
797
|
a href=url = text
|
775
798
|
~~~
|
776
799
|
|
777
|
-
|
800
|
+
その後は, `link_list`はキャプチャしたコンテンツを含みます。
|
778
801
|
|
779
802
|
### インクルードヘルパ
|
780
803
|
|
@@ -1080,6 +1103,7 @@ markdown:
|
|
1080
1103
|
* [Textmate / Sublime Text](https://github.com/slim-template/ruby-slim.tmbundle)
|
1081
1104
|
* [Espresso text editor](https://github.com/slim-template/Slim-Sugar)
|
1082
1105
|
* [Coda](https://github.com/slim-template/Coda-2-Slim.mode)
|
1106
|
+
* [Atom](https://github.com/slim-template/language-slim)
|
1083
1107
|
|
1084
1108
|
### テンプレート変換 (HAML, ERB, ...)
|
1085
1109
|
|
@@ -1181,6 +1205,7 @@ Slim は [MIT license](http://www.opensource.org/licenses/MIT) に基づいて
|
|
1181
1205
|
静的コード解析:
|
1182
1206
|
|
1183
1207
|
* [Slim-Lint](https://github.com/sds/slim-lint)
|
1208
|
+
* [SublimeLinter-slim-lint](https://github.com/elstgav/SublimeLinter-slim-lint)
|
1184
1209
|
|
1185
1210
|
テンプレート変換 (HAML, ERB, ...):
|
1186
1211
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Slim
|
2
2
|
|
3
|
-
[![Gem Version](https://img.shields.io/gem/v/slim.svg)](http://rubygems.org/gems/slim) [![Build Status](https://img.shields.io/travis/slim-template/slim.svg?branch=master)](http://travis-ci.org/slim-template/slim) [![Dependency Status](https://img.shields.io/gemnasium/slim-template/slim.svg?travis)](https://gemnasium.com/slim-template/slim) [![Code Climate](https://
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/slim.svg)](http://rubygems.org/gems/slim) [![Build Status](https://img.shields.io/travis/slim-template/slim.svg?branch=master)](http://travis-ci.org/slim-template/slim) [![Dependency Status](https://img.shields.io/gemnasium/slim-template/slim.svg?travis)](https://gemnasium.com/slim-template/slim) [![Code Climate](https://codeclimate.com/github/slim-template/slim/badges/gpa.svg)](https://codeclimate.com/github/slim-template/slim) [![Test Coverage](https://codeclimate.com/github/slim-template/slim/badges/coverage.svg)](https://codeclimate.com/github/slim-template/slim/coverage) [![Gittip donate button](https://img.shields.io/gratipay/bevry.svg)](https://www.gittip.com/min4d/ "Donate weekly to this project using Gittip")
|
4
4
|
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](https://flattr.com/submit/auto?user_id=min4d&url=http%3A%2F%2Fslim-lang.org%2F "Donate monthly to this project using Flattr")
|
5
5
|
|
6
6
|
Slim is a template language whose goal is to reduce the view syntax to the essential parts without becoming cryptic. It started as an exercise to see how much could be removed from a standard html template (<, >, closing tags, etc...). As more people took an interest in Slim, the functionality grew and so did the flexibility of the syntax.
|
@@ -189,7 +189,7 @@ body
|
|
189
189
|
|
190
190
|
### Output `=`
|
191
191
|
|
192
|
-
The
|
192
|
+
The equals sign tells Slim it's a Ruby call that produces output to add to the buffer. If your ruby code needs to use multiple lines, append a backslash `\` at the end of the lines. For example:
|
193
193
|
|
194
194
|
~~~ slim
|
195
195
|
= javascript_include_tag \
|
@@ -199,15 +199,15 @@ The equal sign tells Slim it's a Ruby call that produces output to add to the bu
|
|
199
199
|
|
200
200
|
If your line ends with comma `,` (e.g because of a method call) you don't need the additional backslash before the linebreak. For trailing or leading whitespace the modifiers `>` and `<` are supported.
|
201
201
|
|
202
|
-
* Output with trailing white space `=>`. Same as the single
|
203
|
-
* Output with leading white space `=<`. Same as the single
|
202
|
+
* Output with trailing white space `=>`. Same as the single equals sign (`=`), except that it adds a trailing white space.
|
203
|
+
* Output with leading white space `=<`. Same as the single equals sign (`=`), except that it adds a leading white space.
|
204
204
|
|
205
205
|
### Output without HTML escaping `==`
|
206
206
|
|
207
|
-
Same as the single
|
207
|
+
Same as the single equals sign (`=`), but does not go through the `escape_html` method. For trailing or leading whitespace the modifiers `>` and `<` are supported.
|
208
208
|
|
209
|
-
* Output without HTML escaping and trailing white space `==>`. Same as the double
|
210
|
-
* Output without HTML escaping and leading white space `==<`. Same as the double
|
209
|
+
* Output without HTML escaping and trailing white space `==>`. Same as the double equals sign (`==`), except that it adds a trailing white space.
|
210
|
+
* Output without HTML escaping and leading white space `==<`. Same as the double equals sign (`==`), except that it adds a leading white space.
|
211
211
|
|
212
212
|
### Code comment `/`
|
213
213
|
|
@@ -238,7 +238,7 @@ Use the forward slash immediately followed by an exclamation mark for html comme
|
|
238
238
|
p Get a better browser.
|
239
239
|
~~~
|
240
240
|
|
241
|
-
renders as
|
241
|
+
This renders as:
|
242
242
|
|
243
243
|
~~~ html
|
244
244
|
<!--[if IE]><p>Get a better browser.</p><![endif]-->
|
@@ -246,9 +246,9 @@ renders as
|
|
246
246
|
|
247
247
|
## HTML tags
|
248
248
|
|
249
|
-
###
|
249
|
+
### <!DOCTYPE> declaration
|
250
250
|
|
251
|
-
The doctype
|
251
|
+
The doctype keyword can be used to generate the complex doctypes in a very simple manner.
|
252
252
|
|
253
253
|
XML VERSION
|
254
254
|
|
@@ -513,7 +513,7 @@ this is done for class attributes with the white space as delimiter.
|
|
513
513
|
a.menu class="highlight" href="http://slim-lang.com/" Slim-lang.com
|
514
514
|
~~~
|
515
515
|
|
516
|
-
This renders as
|
516
|
+
This renders as:
|
517
517
|
|
518
518
|
~~~ html
|
519
519
|
<a class="menu highlight" href="http://slim-lang.com/">Slim-lang.com</a>
|
@@ -528,13 +528,13 @@ a class=:menu,:highlight
|
|
528
528
|
|
529
529
|
#### Splat attributes `*`
|
530
530
|
|
531
|
-
The splat shortcut allows you turn a hash
|
531
|
+
The splat shortcut allows you to turn a hash into attribute/value pairs.
|
532
532
|
|
533
533
|
~~~ slim
|
534
534
|
.card*{'data-url'=>place_path(place), 'data-id'=>place.id} = place.name
|
535
535
|
~~~
|
536
536
|
|
537
|
-
renders as
|
537
|
+
This renders as:
|
538
538
|
|
539
539
|
~~~ html
|
540
540
|
<div class="card" data-id="1234" data-url="/place/1234">Slim's house</div>
|
@@ -553,7 +553,7 @@ The hash attributes which support attribute merging (see Slim option `:merge_att
|
|
553
553
|
.first *{class: [:second, :third]} Text
|
554
554
|
~~~
|
555
555
|
|
556
|
-
renders as
|
556
|
+
This renders as:
|
557
557
|
|
558
558
|
~~~ html
|
559
559
|
div class="first second third"
|
@@ -575,7 +575,7 @@ ruby:
|
|
575
575
|
*a_unless_current Link
|
576
576
|
~~~
|
577
577
|
|
578
|
-
renders as
|
578
|
+
This renders as:
|
579
579
|
|
580
580
|
~~~ html
|
581
581
|
<span>Link</span><a href="http://slim-lang.com/">Link</a>
|
@@ -585,7 +585,7 @@ renders as
|
|
585
585
|
|
586
586
|
#### Tag shortcuts
|
587
587
|
|
588
|
-
You can define custom tag shortcuts by setting the option `:shortcut`.
|
588
|
+
You can define custom tag shortcuts by setting the option `:shortcut`. In Rails apps, you need to put this code for your shortcuts into an initializer like `config/initializers/slim.rb`. In Sinatra, you simply add the same configuration anywhere below the line where you `require 'slim'`.
|
589
589
|
|
590
590
|
~~~ ruby
|
591
591
|
Slim::Engine.set_options shortcut: {'c' => {tag: 'container'}, '#' => {attr: 'id'}, '.' => {attr: 'class'} }
|
@@ -647,7 +647,7 @@ which renders to
|
|
647
647
|
<div class="person" role="admin">Daniel</div>
|
648
648
|
~~~
|
649
649
|
|
650
|
-
You can also set multiple attributes at once using one shortcut.
|
650
|
+
You can also set multiple attributes with same value at once using one shortcut.
|
651
651
|
|
652
652
|
~~~ ruby
|
653
653
|
Slim::Engine.set_options shortcut: {'@' => {attr: %w(data-role role)}}
|
@@ -665,6 +665,29 @@ which renders to
|
|
665
665
|
<div class="person" role="admin" data-role="admin">Daniel</div>
|
666
666
|
~~~
|
667
667
|
|
668
|
+
You can also set additional fixed value attributes to a shortcut.
|
669
|
+
|
670
|
+
~~~ ruby
|
671
|
+
Slim::Engine.set_options shortcut: {'^' => {tag: 'script', attr: 'data-binding',
|
672
|
+
additional_attrs: { type: "text/javascript" }}}
|
673
|
+
~~~
|
674
|
+
|
675
|
+
Then
|
676
|
+
|
677
|
+
~~~ slim
|
678
|
+
^products
|
679
|
+
== @products.to_json
|
680
|
+
~~~
|
681
|
+
|
682
|
+
which renders to
|
683
|
+
|
684
|
+
~~~ html
|
685
|
+
<script data-binding="products" type="text/javascript">
|
686
|
+
[{"name": "product1", "price": "$100"},
|
687
|
+
{"name": "prodcut2", "price": "$200"}]
|
688
|
+
</script>
|
689
|
+
~~~
|
690
|
+
|
668
691
|
#### ID shortcut `#` and class shortcut `.`
|
669
692
|
|
670
693
|
You can specify the `id` and `class` attributes in the following shortcut form
|
@@ -818,7 +841,7 @@ body
|
|
818
841
|
|
819
842
|
## Embedded engines (Markdown, ...)
|
820
843
|
|
821
|
-
Thanks to [Tilt](https://github.com/rtomayko/tilt), Slim has
|
844
|
+
Thanks to [Tilt](https://github.com/rtomayko/tilt), Slim has extensive support for embedding other template engines.
|
822
845
|
|
823
846
|
Examples:
|
824
847
|
|
@@ -842,7 +865,7 @@ Supported engines:
|
|
842
865
|
| javascript: | none | Shortcut | Shortcut to embed javascript code and wrap in script tag |
|
843
866
|
| css: | none | Shortcut | Shortcut to embed css code and wrap in style tag |
|
844
867
|
| sass: | sass | Compile time | Embed sass code and wrap in style tag |
|
845
|
-
| scss: | sass | Compile time |
|
868
|
+
| scss: | sass | Compile time | Embed scss code and wrap in style tag |
|
846
869
|
| less: | less | Compile time | Embed less css code and wrap in style tag |
|
847
870
|
| styl: | styl | Compile time | Embed stylus css code and wrap in style tag |
|
848
871
|
| coffee: | coffee-script | Compile time | Compile coffee script code and wrap in script tag |
|
@@ -1080,6 +1103,7 @@ There are plugins for various text editors (including the most important ones -
|
|
1080
1103
|
* [Textmate / Sublime Text](https://github.com/slim-template/ruby-slim.tmbundle)
|
1081
1104
|
* [Espresso text editor](https://github.com/slim-template/Slim-Sugar)
|
1082
1105
|
* [Coda](https://github.com/slim-template/Coda-2-Slim.mode)
|
1106
|
+
* [Atom](https://github.com/slim-template/language-slim)
|
1083
1107
|
|
1084
1108
|
### Template Converters (HAML, ERB, ...)
|
1085
1109
|
|
@@ -1181,6 +1205,7 @@ Syntax highlighting:
|
|
1181
1205
|
Static code analysis:
|
1182
1206
|
|
1183
1207
|
* [Slim-Lint](https://github.com/sds/slim-lint)
|
1208
|
+
* [SublimeLinter-slim-lint](https://github.com/elstgav/SublimeLinter-slim-lint)
|
1184
1209
|
|
1185
1210
|
Template Converters (HAML, ERB, ...):
|
1186
1211
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -13,7 +13,7 @@ require 'haml'
|
|
13
13
|
|
14
14
|
class SlimBenchmarks
|
15
15
|
def initialize(slow)
|
16
|
-
@benches
|
16
|
+
@benches = Hash.new { |h, k| h[k] = [] }
|
17
17
|
|
18
18
|
@erb_code = File.read(File.dirname(__FILE__) + '/view.erb')
|
19
19
|
@haml_code = File.read(File.dirname(__FILE__) + '/view.haml')
|
@@ -25,8 +25,8 @@ class SlimBenchmarks
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def init_compiled_benches
|
28
|
-
haml_pretty = Haml::Engine.new(@haml_code, format: :html5)
|
29
|
-
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
|
28
|
+
haml_pretty = Haml::Engine.new(@haml_code, format: :html5, escape_attrs: false)
|
29
|
+
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true, escape_attrs: false)
|
30
30
|
|
31
31
|
context = Context.new
|
32
32
|
|
@@ -41,14 +41,14 @@ class SlimBenchmarks
|
|
41
41
|
def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
|
42
42
|
}
|
43
43
|
|
44
|
-
bench('
|
45
|
-
bench('
|
46
|
-
bench('
|
47
|
-
bench('
|
48
|
-
bench('
|
49
|
-
bench('
|
50
|
-
bench('
|
51
|
-
bench('
|
44
|
+
bench(:compiled, 'erb') { context.run_erb }
|
45
|
+
bench(:compiled, 'erubis') { context.run_erubis }
|
46
|
+
bench(:compiled, 'fast erubis') { context.run_fast_erubis }
|
47
|
+
bench(:compiled, 'temple erb') { context.run_temple_erb }
|
48
|
+
bench(:compiled, 'slim pretty') { context.run_slim_pretty }
|
49
|
+
bench(:compiled, 'slim ugly') { context.run_slim_ugly }
|
50
|
+
bench(:compiled, 'haml pretty') { context.run_haml_pretty }
|
51
|
+
bench(:compiled, 'haml ugly') { context.run_haml_ugly }
|
52
52
|
end
|
53
53
|
|
54
54
|
def init_tilt_benches
|
@@ -62,47 +62,54 @@ class SlimBenchmarks
|
|
62
62
|
|
63
63
|
context = Context.new
|
64
64
|
|
65
|
-
bench('
|
66
|
-
bench('
|
67
|
-
bench('
|
68
|
-
bench('
|
69
|
-
bench('
|
70
|
-
bench('
|
71
|
-
bench('
|
65
|
+
bench(:tilt, 'erb') { tilt_erb.render(context) }
|
66
|
+
bench(:tilt, 'erubis') { tilt_erubis.render(context) }
|
67
|
+
bench(:tilt, 'temple erb') { tilt_temple_erb.render(context) }
|
68
|
+
bench(:tilt, 'slim pretty') { tilt_slim_pretty.render(context) }
|
69
|
+
bench(:tilt, 'slim ugly') { tilt_slim_ugly.render(context) }
|
70
|
+
bench(:tilt, 'haml pretty') { tilt_haml_pretty.render(context) }
|
71
|
+
bench(:tilt, 'haml ugly') { tilt_haml_ugly.render(context) }
|
72
72
|
end
|
73
73
|
|
74
74
|
def init_parsing_benches
|
75
75
|
context = Context.new
|
76
76
|
context_binding = context.instance_eval { binding }
|
77
77
|
|
78
|
-
bench('
|
79
|
-
bench('
|
80
|
-
bench('
|
81
|
-
bench('
|
82
|
-
bench('
|
83
|
-
bench('
|
84
|
-
bench('
|
85
|
-
bench('
|
78
|
+
bench(:parsing, 'erb') { ERB.new(@erb_code).result(context_binding) }
|
79
|
+
bench(:parsing, 'erubis') { Erubis::Eruby.new(@erb_code).result(context_binding) }
|
80
|
+
bench(:parsing, 'fast erubis') { Erubis::FastEruby.new(@erb_code).result(context_binding) }
|
81
|
+
bench(:parsing, 'temple erb') { Temple::ERB::Template.new { @erb_code }.render(context) }
|
82
|
+
bench(:parsing, 'slim pretty') { Slim::Template.new(pretty: true) { @slim_code }.render(context) }
|
83
|
+
bench(:parsing, 'slim ugly') { Slim::Template.new { @slim_code }.render(context) }
|
84
|
+
bench(:parsing, 'haml pretty') { Haml::Engine.new(@haml_code, format: :html5).render(context) }
|
85
|
+
bench(:parsing, 'haml ugly') { Haml::Engine.new(@haml_code, format: :html5, ugly: true).render(context) }
|
86
86
|
end
|
87
87
|
|
88
88
|
def run
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
@benches.each do |group_name, group_benches|
|
90
|
+
puts "Running #{group_name} benchmarks:"
|
91
|
+
|
92
|
+
Benchmark.ips do |x|
|
93
|
+
group_benches.each do |name, block|
|
94
|
+
x.report("#{group_name} #{name}", &block)
|
95
|
+
end
|
96
|
+
|
97
|
+
x.compare!
|
92
98
|
end
|
93
99
|
end
|
100
|
+
|
94
101
|
puts "
|
95
|
-
|
102
|
+
Compiled benchmark: Template is parsed before the benchmark and
|
96
103
|
generated ruby code is compiled into a method.
|
97
104
|
This is the fastest evaluation strategy because it benchmarks
|
98
105
|
pure execution speed of the generated ruby code.
|
99
106
|
|
100
|
-
|
107
|
+
Compiled Tilt benchmark: Template is compiled with Tilt, which gives a more
|
101
108
|
accurate result of the performance in production mode in frameworks like
|
102
109
|
Sinatra, Ramaze and Camping. (Rails still uses its own template
|
103
110
|
compilation.)
|
104
111
|
|
105
|
-
|
112
|
+
Parsing benchmark: Template is parsed every time.
|
106
113
|
This is not the recommended way to use the template engine
|
107
114
|
and Slim is not optimized for it. Activate this benchmark with 'rake bench slow=1'.
|
108
115
|
|
@@ -111,8 +118,8 @@ overhead added by the Temple framework compared to ERB.
|
|
111
118
|
"
|
112
119
|
end
|
113
120
|
|
114
|
-
def bench(name, &block)
|
115
|
-
@benches.push([name, block])
|
121
|
+
def bench(group, name, &block)
|
122
|
+
@benches[group].push([name, block])
|
116
123
|
end
|
117
124
|
end
|
118
125
|
|