brakeman 4.5.1 → 4.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +216 -109
- data/README.md +13 -6
- data/bundle/load.rb +14 -13
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/README.txt +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/setup.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/CHANGELOG.md +138 -4
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/FAQ.md +4 -14
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/Gemfile +16 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/MIT-LICENSE +20 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/README.md +79 -42
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/REFERENCE.md +150 -71
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/TODO +24 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/haml.gemspec +45 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml.rb +2 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/attribute_builder.rb +164 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/attribute_compiler.rb +235 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/attribute_parser.rb +150 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/buffer.rb +25 -132
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/compiler.rb +330 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/engine.rb +34 -41
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/error.rb +65 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/escapable.rb +77 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/exec.rb +38 -20
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/filters.rb +22 -27
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/generator.rb +42 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers.rb +134 -89
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/action_view_extensions.rb +4 -2
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/action_view_mods.rb +45 -60
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/action_view_xss_mods.rb +2 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubi_template.rb +20 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/safe_erubis_template.rb +5 -1
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/xss_mods.rb +23 -13
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/options.rb +63 -69
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/parser.rb +319 -227
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/plugin.rb +37 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/railtie.rb +48 -0
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/sass_rails_filter.rb +18 -4
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/template.rb +13 -6
- data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/template/options.rb +13 -2
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/temple_engine.rb +123 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/temple_line_counter.rb +30 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/util.rb +258 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/version.rb +5 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/yard/default/fulldoc/html/css/common.sass +15 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.1/yard/default/layout/html/footer.erb +12 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/AUTHORS +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/COPYING +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/Changelog.md +3 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/Gemfile +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/LICENSE +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/README.md +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/TODO +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/appveyor.yml +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/highline.gemspec +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/builtin_styles.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/color_scheme.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/compatibility.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/custom_errors.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/import.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/io_console_compatible.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/list.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/list_renderer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/menu.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/menu/item.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/paginator.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question/answer_converter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question_asker.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/simulate.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/statement.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/string.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/string_extensions.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/style.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/template_renderer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/io_console.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/ncurses.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/unix_stty.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/version.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/wrapper.rb +0 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/Gemfile +6 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/LICENSE.txt +22 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/NEWS.md +141 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/README.md +60 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/attlistdecl.rb +63 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/attribute.rb +205 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/cdata.rb +68 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/child.rb +97 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/comment.rb +80 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/doctype.rb +287 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/document.rb +291 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/dtd/dtd.rb +47 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/dtd/elementdecl.rb +18 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/dtd/entitydecl.rb +57 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/dtd/notationdecl.rb +40 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/element.rb +1269 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/encoding.rb +51 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/entity.rb +171 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/formatters/default.rb +116 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/formatters/pretty.rb +142 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/formatters/transitive.rb +58 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/functions.rb +447 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/instruction.rb +79 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/light/node.rb +196 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/namespace.rb +59 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/node.rb +76 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/output.rb +30 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parent.rb +166 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parseexception.rb +52 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/baseparser.rb +594 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/lightparser.rb +59 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/pullparser.rb +197 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/sax2parser.rb +273 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/streamparser.rb +61 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/treeparser.rb +101 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/parsers/xpathparser.rb +675 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/quickpath.rb +266 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/rexml.rb +32 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/sax2listener.rb +98 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/security.rb +28 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/source.rb +298 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/streamlistener.rb +93 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/text.rb +424 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/validation/relaxng.rb +539 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/validation/validation.rb +144 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/validation/validationexception.rb +10 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/xmldecl.rb +130 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/xmltokens.rb +85 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/xpath.rb +81 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/lib/rexml/xpath_parser.rb +968 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.4/rexml.gemspec +84 -0
- data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/History.rdoc +19 -5
- data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/Manifest.txt +0 -0
- data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/README.rdoc +0 -0
- data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/lib/ruby2ruby.rb +122 -112
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/History.rdoc +91 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/Manifest.txt +2 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/README.rdoc +3 -3
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/compare/normalize.rb +43 -3
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/debugging.md +57 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/rp_extensions.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby20_parser.rb +7062 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1/lib/ruby_parser.yy → 2.7.0/gems/ruby_parser-3.15.0/lib/ruby20_parser.y} +473 -450
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby21_parser.rb +7140 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby21_parser.y +482 -307
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby22_parser.rb +7160 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby22_parser.y +483 -308
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby23_parser.rb +7175 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby23_parser.y +483 -308
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby24_parser.rb +7204 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby24_parser.y +487 -310
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby25_parser.rb +7204 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby25_parser.y +487 -310
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby26_parser.rb +7224 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby26_parser.y +493 -314
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby27_parser.rb +7224 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby27_parser.y +2657 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby_lexer.rb +483 -459
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby_lexer.rex +5 -6
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby_lexer.rex.rb +6 -8
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby_parser.rb +29 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.15.0/lib/ruby_parser.yy +2764 -0
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/lib/ruby_parser_extras.rb +670 -420
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/tools/munge.rb +10 -5
- data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.15.0}/tools/ripper.rb +13 -2
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/CHANGES.md +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/Gemfile +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/LICENSE.txt +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/README.md +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/History.rdoc +53 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/Manifest.txt +1 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/README.rdoc +0 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/lib/pt_testcase.rb +15 -17
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.15.1/lib/sexp.rb +381 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0/lib/sexp.rb → 2.7.0/gems/sexp_processor-4.15.1/lib/sexp_matcher.rb} +67 -387
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/lib/sexp_processor.rb +2 -2
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/lib/strict_sexp.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.15.1}/lib/unique.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/CHANGES +4 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/Gemfile +12 -13
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/LICENSE +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.jp.md +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.md +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/code_attributes.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/command.rb +13 -13
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/controls.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/do_inserter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/embedded.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/end_inserter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/engine.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/erb_converter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/grammar.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/include.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/interpolation.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/context.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/parser.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/escaper.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/parser.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/builder.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/template.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/translator.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/version.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/slim.gemspec +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/CHANGES +5 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/EXPRESSIONS.md +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/Gemfile +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/LICENSE +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/README.md +1 -1
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/string_splitter.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generator.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/map.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/dispatcher.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/static_analyzer.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates/rails.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/utils.rb +0 -0
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/version.rb +3 -0
- data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/temple.gemspec +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Manifest +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
- data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/COPYING +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/commonmarker.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/pandoc.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/rst-pandoc.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/string.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/template.rb +7 -12
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.10}/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/CHANGELOG.md +8 -0
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/README.md +3 -3
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.7.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/lib/unicode/display_width.rb +1 -1
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/lib/unicode/display_width/constants.rb +2 -2
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/lib/unicode/display_width/index.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
- data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.7.0}/lib/unicode/display_width/string_ext.rb +0 -0
- data/lib/brakeman.rb +24 -0
- data/lib/brakeman/call_index.rb +54 -15
- data/lib/brakeman/checks/base_check.rb +62 -56
- data/lib/brakeman/checks/check_basic_auth.rb +2 -0
- data/lib/brakeman/checks/check_content_tag.rb +1 -2
- data/lib/brakeman/checks/check_cookie_serialization.rb +22 -0
- data/lib/brakeman/checks/check_cross_site_scripting.rb +4 -4
- data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +28 -0
- data/lib/brakeman/checks/check_deserialize.rb +24 -7
- data/lib/brakeman/checks/check_execute.rb +65 -5
- data/lib/brakeman/checks/check_file_access.rb +7 -1
- data/lib/brakeman/checks/check_header_dos.rb +2 -2
- data/lib/brakeman/checks/check_i18n_xss.rb +2 -2
- data/lib/brakeman/checks/check_jruby_xml.rb +2 -2
- data/lib/brakeman/checks/check_json_entity_escape.rb +38 -0
- data/lib/brakeman/checks/check_json_parsing.rb +2 -2
- data/lib/brakeman/checks/check_link_to.rb +1 -1
- data/lib/brakeman/checks/check_link_to_href.rb +1 -3
- data/lib/brakeman/checks/check_mass_assignment.rb +34 -4
- data/lib/brakeman/checks/check_mime_type_dos.rb +2 -2
- data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -1
- data/lib/brakeman/checks/check_model_attributes.rb +1 -1
- data/lib/brakeman/checks/check_nested_attributes_bypass.rb +1 -1
- data/lib/brakeman/checks/check_page_caching_cve.rb +37 -0
- data/lib/brakeman/checks/check_permit_attributes.rb +1 -1
- data/lib/brakeman/checks/check_regex_dos.rb +1 -1
- data/lib/brakeman/checks/check_reverse_tabnabbing.rb +58 -0
- data/lib/brakeman/checks/check_sanitize_methods.rb +2 -2
- data/lib/brakeman/checks/check_session_settings.rb +5 -2
- data/lib/brakeman/checks/check_skip_before_filter.rb +4 -4
- data/lib/brakeman/checks/check_sql.rb +24 -33
- data/lib/brakeman/checks/check_template_injection.rb +32 -0
- data/lib/brakeman/checks/check_xml_dos.rb +2 -2
- data/lib/brakeman/checks/check_yaml_parsing.rb +10 -18
- data/lib/brakeman/commandline.rb +25 -1
- data/lib/brakeman/differ.rb +16 -33
- data/lib/brakeman/file_parser.rb +9 -8
- data/lib/brakeman/file_path.rb +14 -0
- data/lib/brakeman/options.rb +21 -1
- data/lib/brakeman/parsers/haml_embedded.rb +1 -1
- data/lib/brakeman/parsers/template_parser.rb +3 -1
- data/lib/brakeman/processor.rb +2 -2
- data/lib/brakeman/processors/alias_processor.rb +19 -6
- data/lib/brakeman/processors/base_processor.rb +2 -0
- data/lib/brakeman/processors/controller_processor.rb +5 -5
- data/lib/brakeman/processors/gem_processor.rb +10 -2
- data/lib/brakeman/processors/haml_template_processor.rb +94 -123
- data/lib/brakeman/processors/lib/call_conversion_helper.rb +6 -5
- data/lib/brakeman/processors/lib/find_all_calls.rb +57 -18
- data/lib/brakeman/processors/lib/find_call.rb +3 -64
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +1 -1
- data/lib/brakeman/processors/lib/render_helper.rb +3 -1
- data/lib/brakeman/processors/output_processor.rb +1 -1
- data/lib/brakeman/processors/template_alias_processor.rb +33 -0
- data/lib/brakeman/processors/template_processor.rb +10 -6
- data/lib/brakeman/report.rb +11 -1
- data/lib/brakeman/report/ignore/config.rb +10 -2
- data/lib/brakeman/report/report_junit.rb +104 -0
- data/lib/brakeman/report/report_markdown.rb +0 -1
- data/lib/brakeman/report/report_sarif.rb +114 -0
- data/lib/brakeman/report/report_text.rb +41 -21
- data/lib/brakeman/rescanner.rb +4 -0
- data/lib/brakeman/scanner.rb +4 -1
- data/lib/brakeman/tracker.rb +29 -3
- data/lib/brakeman/tracker/config.rb +43 -75
- data/lib/brakeman/tracker/constants.rb +10 -8
- data/lib/brakeman/tracker/controller.rb +1 -1
- data/lib/brakeman/util.rb +23 -5
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning.rb +4 -0
- data/lib/brakeman/warning_codes.rb +10 -0
- data/lib/ruby_parser/bm_sexp.rb +16 -11
- metadata +422 -343
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/MIT-LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/compiler.rb +0 -540
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/error.rb +0 -61
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/railtie.rb +0 -22
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +0 -41
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/util.rb +0 -377
- data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/debugging.md +0 -18
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.rb +0 -6869
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.y +0 -2431
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby21_parser.rb +0 -6944
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby22_parser.rb +0 -6968
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby23_parser.rb +0 -6987
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby24_parser.rb +0 -6994
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby25_parser.rb +0 -6994
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby26_parser.rb +0 -7012
- data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/tilt-2.0.9/CHANGELOG.md +0 -132
- data/bundle/ruby/2.5.0/gems/tilt-2.0.9/Gemfile +0 -70
- data/bundle/ruby/2.5.0/gems/tilt-2.0.9/HACKING +0 -16
- data/bundle/ruby/2.5.0/gems/tilt-2.0.9/README.md +0 -233
- data/bundle/ruby/2.5.0/gems/tilt-2.0.9/tilt.gemspec +0 -130
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.6.0/data/display_width.marshal.gz +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'action_view'
|
4
|
+
|
5
|
+
module Haml
|
6
|
+
class ErubiTemplateHandler < ActionView::Template::Handlers::ERB::Erubi
|
7
|
+
|
8
|
+
def initialize(*args, &blk)
|
9
|
+
@newline_pending = 0
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class SafeErubiTemplate < Tilt::ErubiTemplate
|
15
|
+
def prepare
|
16
|
+
@options.merge! engine_class: Haml::ErubiTemplateHandler
|
17
|
+
super
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.1}/lib/haml/helpers/xss_mods.rb
RENAMED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Haml
|
2
4
|
module Helpers
|
3
5
|
# This module overrides Haml helpers to work properly
|
@@ -6,12 +8,15 @@ module Haml
|
|
6
8
|
# to work with Rails' XSS protection methods.
|
7
9
|
module XssMods
|
8
10
|
def self.included(base)
|
9
|
-
%w[
|
10
|
-
precede succeed capture_haml haml_concat haml_indent
|
11
|
-
haml_tag escape_once].each do |name|
|
11
|
+
%w[find_and_preserve preserve list_of surround
|
12
|
+
precede succeed capture_haml haml_concat haml_internal_concat haml_indent].each do |name|
|
12
13
|
base.send(:alias_method, "#{name}_without_haml_xss", name)
|
13
14
|
base.send(:alias_method, name, "#{name}_with_haml_xss")
|
14
15
|
end
|
16
|
+
# Those two always have _without_haml_xss
|
17
|
+
%w[html_escape escape_once].each do |name|
|
18
|
+
base.send(:alias_method, name, "#{name}_with_haml_xss")
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
# Don't escape text that's already safe,
|
@@ -61,24 +66,29 @@ module Haml
|
|
61
66
|
Haml::Util.html_safe(capture_haml_without_haml_xss(*args, &block))
|
62
67
|
end
|
63
68
|
|
64
|
-
# Input is
|
69
|
+
# Input will be escaped unless this is in a `with_raw_haml_concat`
|
70
|
+
# block. See #Haml::Helpers::ActionViewExtensions#with_raw_haml_concat.
|
65
71
|
def haml_concat_with_haml_xss(text = "")
|
66
|
-
raw = instance_variable_defined?(
|
67
|
-
|
72
|
+
raw = instance_variable_defined?(:@_haml_concat_raw) ? @_haml_concat_raw : false
|
73
|
+
if raw
|
74
|
+
haml_internal_concat_raw text
|
75
|
+
else
|
76
|
+
haml_internal_concat text
|
77
|
+
end
|
78
|
+
ErrorReturn.new("haml_concat")
|
68
79
|
end
|
69
80
|
|
81
|
+
# Input is escaped
|
82
|
+
def haml_internal_concat_with_haml_xss(text="", newline=true, indent=true)
|
83
|
+
haml_internal_concat_without_haml_xss(haml_xss_html_escape(text), newline, indent)
|
84
|
+
end
|
85
|
+
private :haml_internal_concat_with_haml_xss
|
86
|
+
|
70
87
|
# Output is always HTML safe
|
71
88
|
def haml_indent_with_haml_xss
|
72
89
|
Haml::Util.html_safe(haml_indent_without_haml_xss)
|
73
90
|
end
|
74
91
|
|
75
|
-
# Input is escaped, haml_concat'ed output is always HTML safe
|
76
|
-
def haml_tag_with_haml_xss(name, *rest, &block)
|
77
|
-
name = haml_xss_html_escape(name.to_s)
|
78
|
-
rest.unshift(haml_xss_html_escape(rest.shift.to_s)) unless [Symbol, Hash, NilClass].any? {|t| rest.first.is_a? t}
|
79
|
-
with_raw_haml_concat {haml_tag_without_haml_xss(name, *rest, &block)}
|
80
|
-
end
|
81
|
-
|
82
92
|
# Output is always HTML safe
|
83
93
|
def escape_once_with_haml_xss(*args)
|
84
94
|
Haml::Util.html_safe(escape_once_without_haml_xss(*args))
|
@@ -1,53 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Haml
|
2
4
|
# This class encapsulates all of the configuration options that Haml
|
3
5
|
# understands. Please see the {file:REFERENCE.md#options Haml Reference} to
|
4
6
|
# learn how to set the options.
|
5
7
|
class Options
|
6
|
-
|
7
|
-
@defaults = {
|
8
|
-
:attr_wrapper => "'",
|
9
|
-
:autoclose => %w(area base basefont br col command embed frame
|
10
|
-
hr img input isindex keygen link menuitem meta
|
11
|
-
param source track wbr),
|
12
|
-
:encoding => "UTF-8",
|
13
|
-
:escape_attrs => true,
|
14
|
-
:escape_html => false,
|
15
|
-
:filename => '(haml)',
|
16
|
-
:format => :html5,
|
17
|
-
:hyphenate_data_attrs => true,
|
18
|
-
:line => 1,
|
19
|
-
:mime_type => 'text/html',
|
20
|
-
:preserve => %w(textarea pre code),
|
21
|
-
:remove_whitespace => false,
|
22
|
-
:suppress_eval => false,
|
23
|
-
:ugly => false,
|
24
|
-
:cdata => false,
|
25
|
-
:parser_class => ::Haml::Parser,
|
26
|
-
:compiler_class => ::Haml::Compiler
|
27
|
-
}
|
28
|
-
|
29
8
|
@valid_formats = [:html4, :html5, :xhtml]
|
9
|
+
@buffer_option_keys = [:autoclose, :preserve, :attr_wrapper, :format,
|
10
|
+
:encoding, :escape_html, :escape_filter_interpolations, :escape_attrs, :hyphenate_data_attrs, :cdata]
|
11
|
+
|
12
|
+
class << self
|
13
|
+
# The default option values.
|
14
|
+
# @return Hash
|
15
|
+
def defaults
|
16
|
+
@defaults ||= Haml::TempleEngine.options.to_hash.merge(encoding: 'UTF-8')
|
17
|
+
end
|
30
18
|
|
31
|
-
|
32
|
-
|
19
|
+
# An array of valid values for the `:format` option.
|
20
|
+
# @return Array
|
21
|
+
attr_reader :valid_formats
|
33
22
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
23
|
+
# An array of keys that will be used to provide a hash of options to
|
24
|
+
# {Haml::Buffer}.
|
25
|
+
# @return Hash
|
26
|
+
attr_reader :buffer_option_keys
|
39
27
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
# Returns a subset of defaults: those that {Haml::Buffer} cares about.
|
29
|
+
# @return [{Symbol => Object}] The options hash
|
30
|
+
def buffer_defaults
|
31
|
+
@buffer_defaults ||= buffer_option_keys.inject({}) do |hash, key|
|
32
|
+
hash.merge(key => defaults[key])
|
33
|
+
end
|
34
|
+
end
|
45
35
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
36
|
+
def wrap(options)
|
37
|
+
if options.is_a?(Options)
|
38
|
+
options
|
39
|
+
else
|
40
|
+
Options.new(options)
|
41
|
+
end
|
42
|
+
end
|
51
43
|
end
|
52
44
|
|
53
45
|
# The character that should wrap element attributes. This defaults to `'`
|
@@ -63,7 +55,6 @@ module Haml
|
|
63
55
|
attr_accessor :autoclose
|
64
56
|
|
65
57
|
# The encoding to use for the HTML output.
|
66
|
-
# Only available on Ruby 1.9 or higher.
|
67
58
|
# This can be a string or an `Encoding` Object. Note that Haml **does not**
|
68
59
|
# automatically re-encode Ruby values; any strings coming from outside the
|
69
60
|
# application should be converted before being passed into the Haml
|
@@ -91,6 +82,13 @@ module Haml
|
|
91
82
|
# Defaults to false.
|
92
83
|
attr_accessor :escape_html
|
93
84
|
|
85
|
+
# Sets whether or not to escape HTML-sensitive characters in interpolated strings.
|
86
|
+
# See also {file:REFERENCE.md#escaping_html Escaping HTML} and
|
87
|
+
# {file:REFERENCE.md#unescaping_html Unescaping HTML}.
|
88
|
+
#
|
89
|
+
# Defaults to the current value of `escape_html`.
|
90
|
+
attr_accessor :escape_filter_interpolations
|
91
|
+
|
94
92
|
# The name of the Haml file being parsed.
|
95
93
|
# This is only used as information when exceptions are raised. This is
|
96
94
|
# automatically assigned when working through ActionView, so it's really
|
@@ -137,7 +135,7 @@ module Haml
|
|
137
135
|
# formatting errors.
|
138
136
|
#
|
139
137
|
# Defaults to `false`.
|
140
|
-
|
138
|
+
attr_accessor :remove_whitespace
|
141
139
|
|
142
140
|
# Whether or not attribute hashes and Ruby scripts designated by `=` or `~`
|
143
141
|
# should be evaluated. If this is `true`, said scripts are rendered as empty
|
@@ -146,13 +144,6 @@ module Haml
|
|
146
144
|
# Defaults to `false`.
|
147
145
|
attr_accessor :suppress_eval
|
148
146
|
|
149
|
-
# If set to `true`, Haml makes no attempt to properly indent or format the
|
150
|
-
# HTML output. This significantly improves rendering performance but makes
|
151
|
-
# viewing the source unpleasant.
|
152
|
-
#
|
153
|
-
# Defaults to `true` in Rails production mode, and `false` everywhere else.
|
154
|
-
attr_accessor :ugly
|
155
|
-
|
156
147
|
# Whether to include CDATA sections around javascript and css blocks when
|
157
148
|
# using the `:javascript` or `:css` filters.
|
158
149
|
#
|
@@ -169,9 +160,20 @@ module Haml
|
|
169
160
|
# The compiler class to use. Defaults to Haml::Compiler.
|
170
161
|
attr_accessor :compiler_class
|
171
162
|
|
172
|
-
|
163
|
+
# Enable template tracing. If true, it will add a 'data-trace' attribute to
|
164
|
+
# each tag generated by Haml. The value of the attribute will be the
|
165
|
+
# source template name and the line number from which the tag was generated,
|
166
|
+
# separated by a colon. On Rails applications, the path given will be a
|
167
|
+
# relative path as from the views directory. On non-Rails applications,
|
168
|
+
# the path will be the full path.
|
169
|
+
attr_accessor :trace
|
170
|
+
|
171
|
+
# Key is filter name in String and value is Class to use. Defaults to {}.
|
172
|
+
attr_accessor :filters
|
173
|
+
|
174
|
+
def initialize(values = {})
|
173
175
|
defaults.each {|k, v| instance_variable_set :"@#{k}", v}
|
174
|
-
values.
|
176
|
+
values.each {|k, v| send("#{k}=", v) if defaults.has_key?(k) && !v.nil?}
|
175
177
|
yield if block_given?
|
176
178
|
end
|
177
179
|
|
@@ -188,8 +190,7 @@ module Haml
|
|
188
190
|
send "#{key}=", value
|
189
191
|
end
|
190
192
|
|
191
|
-
[:escape_attrs, :hyphenate_data_attrs, :remove_whitespace, :suppress_eval
|
192
|
-
:ugly].each do |method|
|
193
|
+
[:escape_attrs, :hyphenate_data_attrs, :remove_whitespace, :suppress_eval].each do |method|
|
193
194
|
class_eval(<<-END)
|
194
195
|
def #{method}?
|
195
196
|
!! @#{method}
|
@@ -240,22 +241,13 @@ module Haml
|
|
240
241
|
xhtml? || @cdata
|
241
242
|
end
|
242
243
|
|
243
|
-
def
|
244
|
-
|
245
|
-
@
|
244
|
+
def encoding=(value)
|
245
|
+
return unless value
|
246
|
+
@encoding = value.is_a?(Encoding) ? value.name : value.to_s
|
247
|
+
@encoding = "UTF-8" if @encoding.upcase == "US-ASCII"
|
246
248
|
end
|
247
249
|
|
248
|
-
|
249
|
-
attr_writer :encoding
|
250
|
-
else
|
251
|
-
def encoding=(value)
|
252
|
-
return unless value
|
253
|
-
@encoding = value.is_a?(Encoding) ? value.name : value.to_s
|
254
|
-
@encoding = "UTF-8" if @encoding.upcase == "US-ASCII"
|
255
|
-
end
|
256
|
-
end
|
257
|
-
|
258
|
-
# Returns a subset of options: those that {Haml::Buffer} cares about.
|
250
|
+
# Returns a non-default subset of options: those that {Haml::Buffer} cares about.
|
259
251
|
# All of the values here are such that when `#inspect` is called on the hash,
|
260
252
|
# it can be `Kernel#eval`ed to get the same result back.
|
261
253
|
#
|
@@ -264,7 +256,10 @@ module Haml
|
|
264
256
|
# @return [{Symbol => Object}] The options hash
|
265
257
|
def for_buffer
|
266
258
|
self.class.buffer_option_keys.inject({}) do |hash, key|
|
267
|
-
|
259
|
+
value = public_send(key)
|
260
|
+
if self.class.buffer_defaults[key] != value
|
261
|
+
hash[key] = value
|
262
|
+
end
|
268
263
|
hash
|
269
264
|
end
|
270
265
|
end
|
@@ -274,6 +269,5 @@ module Haml
|
|
274
269
|
def defaults
|
275
270
|
self.class.defaults
|
276
271
|
end
|
277
|
-
|
278
272
|
end
|
279
273
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ripper'
|
1
4
|
require 'strscan'
|
2
5
|
|
3
6
|
module Haml
|
@@ -59,7 +62,7 @@ module Haml
|
|
59
62
|
SILENT_SCRIPT,
|
60
63
|
ESCAPE,
|
61
64
|
FILTER
|
62
|
-
]
|
65
|
+
].freeze
|
63
66
|
|
64
67
|
# The value of the character that designates that a line is part
|
65
68
|
# of a multiline string.
|
@@ -71,26 +74,28 @@ module Haml
|
|
71
74
|
# foo.each do | bar |
|
72
75
|
# = bar
|
73
76
|
#
|
74
|
-
BLOCK_WITH_SPACES = /do
|
77
|
+
BLOCK_WITH_SPACES = /do\s*\|\s*[^\|]*\s+\|\z/
|
75
78
|
|
76
|
-
MID_BLOCK_KEYWORDS = %w[else elsif rescue ensure end when]
|
77
|
-
START_BLOCK_KEYWORDS = %w[if begin case unless]
|
79
|
+
MID_BLOCK_KEYWORDS = %w[else elsif rescue ensure end when].freeze
|
80
|
+
START_BLOCK_KEYWORDS = %w[if begin case unless].freeze
|
78
81
|
# Try to parse assignments to block starters as best as possible
|
79
82
|
START_BLOCK_KEYWORD_REGEX = /(?:\w+(?:,\s*\w+)*\s*=\s*)?(#{START_BLOCK_KEYWORDS.join('|')})/
|
80
83
|
BLOCK_KEYWORD_REGEX = /^-?\s*(?:(#{MID_BLOCK_KEYWORDS.join('|')})|#{START_BLOCK_KEYWORD_REGEX.source})\b/
|
81
84
|
|
82
85
|
# The Regex that matches a Doctype command.
|
83
|
-
DOCTYPE_REGEX = /(\d(?:\.\d)?)
|
86
|
+
DOCTYPE_REGEX = /(\d(?:\.\d)?)?\s*([a-z]*)\s*([^ ]+)?/i
|
84
87
|
|
85
88
|
# The Regex that matches a literal string or symbol value
|
86
89
|
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?!\\|\#\{|\#@|\#\$|\2).|\\.)*\2/
|
87
90
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
ID_KEY = 'id'.freeze
|
92
|
+
CLASS_KEY = 'class'.freeze
|
93
|
+
|
94
|
+
# Used for scanning old attributes, substituting the first '{'
|
95
|
+
METHOD_CALL_PREFIX = 'a('
|
96
|
+
|
97
|
+
def initialize(options)
|
98
|
+
@options = Options.wrap(options)
|
94
99
|
# Record the indent levels of "if" statements to validate the subsequent
|
95
100
|
# elsif and else statements are indented at the appropriate level.
|
96
101
|
@script_level_stack = []
|
@@ -98,15 +103,27 @@ module Haml
|
|
98
103
|
@template_tabs = 0
|
99
104
|
end
|
100
105
|
|
101
|
-
def
|
106
|
+
def call(template)
|
107
|
+
match = template.rstrip.scan(/(([ \t]+)?(.*?))(?:\Z|\r\n|\r|\n)/m)
|
108
|
+
# discard the last match which is always blank
|
109
|
+
match.pop
|
110
|
+
@template = match.each_with_index.map do |(full, whitespace, text), index|
|
111
|
+
Line.new(whitespace, text.rstrip, full, index, self, false)
|
112
|
+
end
|
113
|
+
# Append special end-of-document marker
|
114
|
+
@template << Line.new(nil, '-#', '-#', @template.size, self, true)
|
115
|
+
|
102
116
|
@root = @parent = ParseNode.new(:root)
|
103
|
-
@
|
117
|
+
@flat = false
|
118
|
+
@filter_buffer = nil
|
104
119
|
@indentation = nil
|
105
120
|
@line = next_line
|
106
121
|
|
107
122
|
raise SyntaxError.new(Error.message(:indenting_at_start), @line.index) if @line.tabs != 0
|
108
123
|
|
109
|
-
|
124
|
+
loop do
|
125
|
+
next_line
|
126
|
+
|
110
127
|
process_indent(@line) unless @line.text.empty?
|
111
128
|
|
112
129
|
if flat?
|
@@ -118,75 +135,103 @@ module Haml
|
|
118
135
|
end
|
119
136
|
|
120
137
|
@tab_up = nil
|
121
|
-
process_line(@line
|
122
|
-
if
|
138
|
+
process_line(@line) unless @line.text.empty?
|
139
|
+
if block_opened? || @tab_up
|
123
140
|
@template_tabs += 1
|
124
141
|
@parent = @parent.children.last
|
125
142
|
end
|
126
143
|
|
127
|
-
if
|
144
|
+
if !flat? && @next_line.tabs - @line.tabs > 1
|
128
145
|
raise SyntaxError.new(Error.message(:deeper_indenting, @next_line.tabs - @line.tabs), @next_line.index)
|
129
146
|
end
|
130
147
|
|
131
148
|
@line = @next_line
|
132
149
|
end
|
133
|
-
|
134
150
|
# Close all the open tags
|
135
151
|
close until @parent.type == :root
|
136
152
|
@root
|
137
153
|
rescue Haml::Error => e
|
138
|
-
e.backtrace.unshift "#{@options
|
154
|
+
e.backtrace.unshift "#{@options.filename}:#{(e.line ? e.line + 1 : @line.index + 1) + @options.line - 1}"
|
139
155
|
raise
|
140
156
|
end
|
141
157
|
|
158
|
+
def compute_tabs(line)
|
159
|
+
return 0 if line.text.empty? || !line.whitespace
|
160
|
+
|
161
|
+
if @indentation.nil?
|
162
|
+
@indentation = line.whitespace
|
163
|
+
|
164
|
+
if @indentation.include?(?\s) && @indentation.include?(?\t)
|
165
|
+
raise SyntaxError.new(Error.message(:cant_use_tabs_and_spaces), line.index)
|
166
|
+
end
|
167
|
+
|
168
|
+
@flat_spaces = @indentation * (@template_tabs+1) if flat?
|
169
|
+
return 1
|
170
|
+
end
|
171
|
+
|
172
|
+
tabs = line.whitespace.length / @indentation.length
|
173
|
+
return tabs if line.whitespace == @indentation * tabs
|
174
|
+
return @template_tabs + 1 if flat? && line.whitespace =~ /^#{@flat_spaces}/
|
175
|
+
|
176
|
+
message = Error.message(:inconsistent_indentation,
|
177
|
+
human_indentation(line.whitespace),
|
178
|
+
human_indentation(@indentation)
|
179
|
+
)
|
180
|
+
raise SyntaxError.new(message, line.index)
|
181
|
+
end
|
142
182
|
|
143
183
|
private
|
144
184
|
|
145
185
|
# @private
|
146
|
-
|
186
|
+
Line = Struct.new(:whitespace, :text, :full, :index, :parser, :eod) do
|
147
187
|
alias_method :eod?, :eod
|
148
188
|
|
149
189
|
# @private
|
150
190
|
def tabs
|
151
|
-
|
152
|
-
|
153
|
-
break 0 if line.text.empty? || !(whitespace = line.full[/^\s+/])
|
154
|
-
|
155
|
-
if @indentation.nil?
|
156
|
-
@indentation = whitespace
|
157
|
-
|
158
|
-
if @indentation.include?(?\s) && @indentation.include?(?\t)
|
159
|
-
raise SyntaxError.new(Error.message(:cant_use_tabs_and_spaces), line.index)
|
160
|
-
end
|
161
|
-
|
162
|
-
@flat_spaces = @indentation * (@template_tabs+1) if flat?
|
163
|
-
break 1
|
164
|
-
end
|
165
|
-
|
166
|
-
tabs = whitespace.length / @indentation.length
|
167
|
-
break tabs if whitespace == @indentation * tabs
|
168
|
-
break @template_tabs + 1 if flat? && whitespace =~ /^#{@flat_spaces}/
|
191
|
+
@tabs ||= parser.compute_tabs(self)
|
192
|
+
end
|
169
193
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
raise SyntaxError.new(message, line.index)
|
175
|
-
end
|
194
|
+
def strip!(from)
|
195
|
+
self.text = text[from..-1]
|
196
|
+
self.text.lstrip!
|
197
|
+
self
|
176
198
|
end
|
177
199
|
end
|
178
200
|
|
179
201
|
# @private
|
180
|
-
|
202
|
+
ParseNode = Struct.new(:type, :line, :value, :parent, :children) do
|
181
203
|
def initialize(*args)
|
182
204
|
super
|
183
205
|
self.children ||= []
|
184
206
|
end
|
185
207
|
|
186
208
|
def inspect
|
187
|
-
|
188
|
-
|
189
|
-
|
209
|
+
%Q[(#{type} #{value.inspect}#{children.each_with_object(''.dup) {|c, s| s << "\n#{c.inspect.gsub!(/^/, ' ')}"}})].dup
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# @param [String] new - Hash literal including dynamic values.
|
214
|
+
# @param [String] old - Hash literal including dynamic values or Ruby literal of multiple Hashes which MUST be interpreted as method's last arguments.
|
215
|
+
DynamicAttributes = Struct.new(:new, :old) do
|
216
|
+
undef :old=
|
217
|
+
def old=(value)
|
218
|
+
unless value =~ /\A{.*}\z/m
|
219
|
+
raise ArgumentError.new('Old attributes must start with "{" and end with "}"')
|
220
|
+
end
|
221
|
+
self[:old] = value
|
222
|
+
end
|
223
|
+
|
224
|
+
# This will be a literal for Haml::Buffer#attributes's last argument, `attributes_hashes`.
|
225
|
+
def to_literal
|
226
|
+
[new, stripped_old].compact.join(', ')
|
227
|
+
end
|
228
|
+
|
229
|
+
private
|
230
|
+
|
231
|
+
# For `%foo{ { foo: 1 }, bar: 2 }`, :old is "{ { foo: 1 }, bar: 2 }" and this method returns " { foo: 1 }, bar: 2 " for last argument.
|
232
|
+
def stripped_old
|
233
|
+
return nil if old.nil?
|
234
|
+
old.sub!(/\A{/, '').sub!(/}\z/m, '')
|
190
235
|
end
|
191
236
|
end
|
192
237
|
|
@@ -195,98 +240,104 @@ module Haml
|
|
195
240
|
return unless line.tabs <= @template_tabs && @template_tabs > 0
|
196
241
|
|
197
242
|
to_close = @template_tabs - line.tabs
|
198
|
-
to_close.times {|i| close unless to_close - 1 - i == 0 &&
|
243
|
+
to_close.times {|i| close unless to_close - 1 - i == 0 && continuation_script?(line.text)}
|
244
|
+
end
|
245
|
+
|
246
|
+
def continuation_script?(text)
|
247
|
+
text[0] == SILENT_SCRIPT && mid_block_keyword?(text)
|
248
|
+
end
|
249
|
+
|
250
|
+
def mid_block_keyword?(text)
|
251
|
+
MID_BLOCK_KEYWORDS.include?(block_keyword(text))
|
199
252
|
end
|
200
253
|
|
201
254
|
# Processes a single line of Haml.
|
202
255
|
#
|
203
256
|
# This method doesn't return anything; it simply processes the line and
|
204
257
|
# adds the appropriate code to `@precompiled`.
|
205
|
-
def process_line(
|
206
|
-
|
207
|
-
|
208
|
-
case text[0]
|
209
|
-
when DIV_CLASS; push div(text)
|
258
|
+
def process_line(line)
|
259
|
+
case line.text[0]
|
260
|
+
when DIV_CLASS; push div(line)
|
210
261
|
when DIV_ID
|
211
|
-
return push plain(
|
212
|
-
push div(
|
213
|
-
when ELEMENT; push tag(
|
214
|
-
when COMMENT; push comment(text[1..-1].
|
262
|
+
return push plain(line) if %w[{ @ $].include?(line.text[1])
|
263
|
+
push div(line)
|
264
|
+
when ELEMENT; push tag(line)
|
265
|
+
when COMMENT; push comment(line.text[1..-1].lstrip)
|
215
266
|
when SANITIZE
|
216
|
-
return push plain(
|
217
|
-
return push script(
|
218
|
-
return push flat_script(
|
219
|
-
return push plain(
|
220
|
-
push plain(
|
267
|
+
return push plain(line.strip!(3), :escape_html) if line.text[1, 2] == '=='
|
268
|
+
return push script(line.strip!(2), :escape_html) if line.text[1] == SCRIPT
|
269
|
+
return push flat_script(line.strip!(2), :escape_html) if line.text[1] == FLAT_SCRIPT
|
270
|
+
return push plain(line.strip!(1), :escape_html) if line.text[1] == ?\s || line.text[1..2] == '#{'
|
271
|
+
push plain(line)
|
221
272
|
when SCRIPT
|
222
|
-
return push plain(
|
223
|
-
|
224
|
-
|
225
|
-
when
|
226
|
-
when
|
273
|
+
return push plain(line.strip!(2)) if line.text[1] == SCRIPT
|
274
|
+
line.text = line.text[1..-1]
|
275
|
+
push script(line)
|
276
|
+
when FLAT_SCRIPT; push flat_script(line.strip!(1))
|
277
|
+
when SILENT_SCRIPT
|
278
|
+
return push haml_comment(line.text[2..-1]) if line.text[1] == SILENT_COMMENT
|
279
|
+
push silent_script(line)
|
280
|
+
when FILTER; push filter(line.text[1..-1].downcase)
|
227
281
|
when DOCTYPE
|
228
|
-
return push doctype(text) if text[0
|
229
|
-
return push plain(
|
230
|
-
return push script(
|
231
|
-
return push flat_script(
|
232
|
-
return push plain(
|
233
|
-
push plain(
|
234
|
-
when ESCAPE
|
235
|
-
|
282
|
+
return push doctype(line.text) if line.text[0, 3] == '!!!'
|
283
|
+
return push plain(line.strip!(3), false) if line.text[1, 2] == '=='
|
284
|
+
return push script(line.strip!(2), false) if line.text[1] == SCRIPT
|
285
|
+
return push flat_script(line.strip!(2), false) if line.text[1] == FLAT_SCRIPT
|
286
|
+
return push plain(line.strip!(1), false) if line.text[1] == ?\s || line.text[1..2] == '#{'
|
287
|
+
push plain(line)
|
288
|
+
when ESCAPE
|
289
|
+
line.text = line.text[1..-1]
|
290
|
+
push plain(line)
|
291
|
+
else; push plain(line)
|
236
292
|
end
|
237
293
|
end
|
238
294
|
|
239
295
|
def block_keyword(text)
|
240
|
-
return unless keyword = text.scan(BLOCK_KEYWORD_REGEX)[0]
|
296
|
+
return unless (keyword = text.scan(BLOCK_KEYWORD_REGEX)[0])
|
241
297
|
keyword[0] || keyword[1]
|
242
298
|
end
|
243
299
|
|
244
|
-
def mid_block_keyword?(text)
|
245
|
-
MID_BLOCK_KEYWORDS.include?(block_keyword(text))
|
246
|
-
end
|
247
|
-
|
248
300
|
def push(node)
|
249
301
|
@parent.children << node
|
250
302
|
node.parent = @parent
|
251
303
|
end
|
252
304
|
|
253
|
-
def plain(
|
305
|
+
def plain(line, escape_html = nil)
|
254
306
|
if block_opened?
|
255
307
|
raise SyntaxError.new(Error.message(:illegal_nesting_plain), @next_line.index)
|
256
308
|
end
|
257
309
|
|
258
|
-
unless contains_interpolation?(text)
|
259
|
-
return ParseNode.new(:plain,
|
310
|
+
unless contains_interpolation?(line.text)
|
311
|
+
return ParseNode.new(:plain, line.index + 1, :text => line.text)
|
260
312
|
end
|
261
313
|
|
262
|
-
escape_html = @options
|
263
|
-
|
314
|
+
escape_html = @options.escape_html && @options.mime_type != 'text/plain' if escape_html.nil?
|
315
|
+
line.text = unescape_interpolation(line.text, escape_html)
|
316
|
+
script(line, false)
|
264
317
|
end
|
265
318
|
|
266
|
-
def script(
|
267
|
-
raise SyntaxError.new(Error.message(:no_ruby_code, '=')) if text.empty?
|
268
|
-
|
269
|
-
escape_html = @options
|
319
|
+
def script(line, escape_html = nil, preserve = false)
|
320
|
+
raise SyntaxError.new(Error.message(:no_ruby_code, '=')) if line.text.empty?
|
321
|
+
line = handle_ruby_multiline(line)
|
322
|
+
escape_html = @options.escape_html if escape_html.nil?
|
270
323
|
|
271
|
-
keyword = block_keyword(text)
|
324
|
+
keyword = block_keyword(line.text)
|
272
325
|
check_push_script_stack(keyword)
|
273
326
|
|
274
|
-
ParseNode.new(:script,
|
327
|
+
ParseNode.new(:script, line.index + 1, :text => line.text, :escape_html => escape_html,
|
275
328
|
:preserve => preserve, :keyword => keyword)
|
276
329
|
end
|
277
330
|
|
278
|
-
def flat_script(
|
279
|
-
raise SyntaxError.new(Error.message(:no_ruby_code, '~')) if text.empty?
|
280
|
-
script(
|
331
|
+
def flat_script(line, escape_html = nil)
|
332
|
+
raise SyntaxError.new(Error.message(:no_ruby_code, '~')) if line.text.empty?
|
333
|
+
script(line, escape_html, :preserve)
|
281
334
|
end
|
282
335
|
|
283
|
-
def silent_script(
|
284
|
-
|
285
|
-
|
286
|
-
raise SyntaxError.new(Error.message(:no_end), @index - 1) if text[1..-1].strip == "end"
|
336
|
+
def silent_script(line)
|
337
|
+
raise SyntaxError.new(Error.message(:no_end), line.index) if line.text[1..-1].strip == 'end'
|
287
338
|
|
288
|
-
|
289
|
-
keyword = block_keyword(text)
|
339
|
+
line = handle_ruby_multiline(line)
|
340
|
+
keyword = block_keyword(line.text)
|
290
341
|
|
291
342
|
check_push_script_stack(keyword)
|
292
343
|
|
@@ -308,8 +359,8 @@ module Haml
|
|
308
359
|
end
|
309
360
|
end
|
310
361
|
|
311
|
-
ParseNode.new(:silent_script, @index,
|
312
|
-
:text => text[1..-1], :keyword => keyword)
|
362
|
+
ParseNode.new(:silent_script, @line.index + 1,
|
363
|
+
:text => line.text[1..-1], :keyword => keyword)
|
313
364
|
end
|
314
365
|
|
315
366
|
def check_push_script_stack(keyword)
|
@@ -323,18 +374,25 @@ module Haml
|
|
323
374
|
end
|
324
375
|
|
325
376
|
def haml_comment(text)
|
326
|
-
|
327
|
-
|
377
|
+
if filter_opened?
|
378
|
+
@flat = true
|
379
|
+
@filter_buffer = String.new
|
380
|
+
@filter_buffer << "#{text}\n" unless text.empty?
|
381
|
+
text = @filter_buffer
|
382
|
+
# If we don't know the indentation by now, it'll be set in Line#tabs
|
383
|
+
@flat_spaces = @indentation * (@template_tabs+1) if @indentation
|
384
|
+
end
|
385
|
+
|
386
|
+
ParseNode.new(:haml_comment, @line.index + 1, :text => text)
|
328
387
|
end
|
329
388
|
|
330
389
|
def tag(line)
|
331
390
|
tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
|
332
|
-
nuke_inner_whitespace, action, value, last_line = parse_tag(line)
|
391
|
+
nuke_inner_whitespace, action, value, last_line = parse_tag(line.text)
|
333
392
|
|
334
|
-
preserve_tag = @options
|
393
|
+
preserve_tag = @options.preserve.include?(tag_name)
|
335
394
|
nuke_inner_whitespace ||= preserve_tag
|
336
|
-
|
337
|
-
escape_html = (action == '&' || (action != '!' && @options[:escape_html]))
|
395
|
+
escape_html = (action == '&' || (action != '!' && @options.escape_html))
|
338
396
|
|
339
397
|
case action
|
340
398
|
when '/'; self_closing = true
|
@@ -369,22 +427,20 @@ module Haml
|
|
369
427
|
end
|
370
428
|
|
371
429
|
attributes = Parser.parse_class_and_id(attributes)
|
372
|
-
|
430
|
+
dynamic_attributes = DynamicAttributes.new
|
373
431
|
|
374
432
|
if attributes_hashes[:new]
|
375
433
|
static_attributes, attributes_hash = attributes_hashes[:new]
|
376
|
-
|
377
|
-
|
434
|
+
AttributeBuilder.merge_attributes!(attributes, static_attributes) if static_attributes
|
435
|
+
dynamic_attributes.new = attributes_hash
|
378
436
|
end
|
379
437
|
|
380
438
|
if attributes_hashes[:old]
|
381
439
|
static_attributes = parse_static_hash(attributes_hashes[:old])
|
382
|
-
|
383
|
-
|
440
|
+
AttributeBuilder.merge_attributes!(attributes, static_attributes) if static_attributes
|
441
|
+
dynamic_attributes.old = attributes_hashes[:old] unless static_attributes || @options.suppress_eval
|
384
442
|
end
|
385
443
|
|
386
|
-
attributes_list.compact!
|
387
|
-
|
388
444
|
raise SyntaxError.new(Error.message(:illegal_nesting_self_closing), @next_line.index) if block_opened? && self_closing
|
389
445
|
raise SyntaxError.new(Error.message(:no_ruby_code, action), last_line - 1) if parse && value.empty?
|
390
446
|
raise SyntaxError.new(Error.message(:self_closing_content), last_line - 1) if self_closing && !value.empty?
|
@@ -393,56 +449,70 @@ module Haml
|
|
393
449
|
raise SyntaxError.new(Error.message(:illegal_nesting_line, tag_name), @next_line.index)
|
394
450
|
end
|
395
451
|
|
396
|
-
self_closing ||= !!(!block_opened? && value.empty? && @options
|
452
|
+
self_closing ||= !!(!block_opened? && value.empty? && @options.autoclose.any? {|t| t === tag_name})
|
397
453
|
value = nil if value.empty? && (block_opened? || self_closing)
|
398
|
-
|
454
|
+
line.text = value
|
455
|
+
line = handle_ruby_multiline(line) if parse
|
399
456
|
|
400
|
-
ParseNode.new(:tag,
|
401
|
-
:
|
457
|
+
ParseNode.new(:tag, line.index + 1, :name => tag_name, :attributes => attributes,
|
458
|
+
:dynamic_attributes => dynamic_attributes, :self_closing => self_closing,
|
402
459
|
:nuke_inner_whitespace => nuke_inner_whitespace,
|
403
460
|
:nuke_outer_whitespace => nuke_outer_whitespace, :object_ref => object_ref,
|
404
461
|
:escape_html => escape_html, :preserve_tag => preserve_tag,
|
405
|
-
:preserve_script => preserve_script, :parse => parse, :value =>
|
462
|
+
:preserve_script => preserve_script, :parse => parse, :value => line.text)
|
406
463
|
end
|
407
464
|
|
408
465
|
# Renders a line that creates an XHTML tag and has an implicit div because of
|
409
466
|
# `.` or `#`.
|
410
467
|
def div(line)
|
411
|
-
|
468
|
+
line.text = "%div#{line.text}"
|
469
|
+
tag(line)
|
412
470
|
end
|
413
471
|
|
414
472
|
# Renders an XHTML comment.
|
415
|
-
def comment(
|
416
|
-
|
417
|
-
|
418
|
-
|
473
|
+
def comment(text)
|
474
|
+
if text[0..1] == '!['
|
475
|
+
revealed = true
|
476
|
+
text = text[1..-1]
|
477
|
+
else
|
478
|
+
revealed = false
|
479
|
+
end
|
419
480
|
|
420
|
-
|
481
|
+
conditional, text = balance(text, ?[, ?]) if text[0] == ?[
|
482
|
+
text.strip!
|
483
|
+
|
484
|
+
if contains_interpolation?(text)
|
485
|
+
parse = true
|
486
|
+
text = unescape_interpolation(text)
|
487
|
+
else
|
488
|
+
parse = false
|
489
|
+
end
|
490
|
+
|
491
|
+
if block_opened? && !text.empty?
|
421
492
|
raise SyntaxError.new(Haml::Error.message(:illegal_nesting_content), @next_line.index)
|
422
493
|
end
|
423
494
|
|
424
|
-
ParseNode.new(:comment, @index, :conditional => conditional, :text =>
|
495
|
+
ParseNode.new(:comment, @line.index + 1, :conditional => conditional, :text => text, :revealed => revealed, :parse => parse)
|
425
496
|
end
|
426
497
|
|
427
498
|
# Renders an XHTML doctype or XML shebang.
|
428
|
-
def doctype(
|
499
|
+
def doctype(text)
|
429
500
|
raise SyntaxError.new(Error.message(:illegal_nesting_header), @next_line.index) if block_opened?
|
430
|
-
version, type, encoding =
|
431
|
-
ParseNode.new(:doctype, @index, :version => version, :type => type, :encoding => encoding)
|
501
|
+
version, type, encoding = text[3..-1].strip.downcase.scan(DOCTYPE_REGEX)[0]
|
502
|
+
ParseNode.new(:doctype, @line.index + 1, :version => version, :type => type, :encoding => encoding)
|
432
503
|
end
|
433
504
|
|
434
505
|
def filter(name)
|
435
506
|
raise Error.new(Error.message(:invalid_filter_name, name)) unless name =~ /^\w+$/
|
436
507
|
|
437
|
-
@filter_buffer = String.new
|
438
|
-
|
439
508
|
if filter_opened?
|
440
509
|
@flat = true
|
510
|
+
@filter_buffer = String.new
|
441
511
|
# If we don't know the indentation by now, it'll be set in Line#tabs
|
442
512
|
@flat_spaces = @indentation * (@template_tabs+1) if @indentation
|
443
513
|
end
|
444
514
|
|
445
|
-
ParseNode.new(:filter, @index, :name => name, :text => @filter_buffer)
|
515
|
+
ParseNode.new(:filter, @line.index + 1, :name => name, :text => @filter_buffer)
|
446
516
|
end
|
447
517
|
|
448
518
|
def close
|
@@ -452,13 +522,17 @@ module Haml
|
|
452
522
|
end
|
453
523
|
|
454
524
|
def close_filter(_)
|
455
|
-
|
456
|
-
@flat_spaces = nil
|
457
|
-
@filter_buffer = nil
|
525
|
+
close_flat_section
|
458
526
|
end
|
459
527
|
|
460
528
|
def close_haml_comment(_)
|
461
|
-
|
529
|
+
close_flat_section
|
530
|
+
end
|
531
|
+
|
532
|
+
def close_flat_section
|
533
|
+
@flat = false
|
534
|
+
@flat_spaces = nil
|
535
|
+
@filter_buffer = nil
|
462
536
|
end
|
463
537
|
|
464
538
|
def close_silent_script(node)
|
@@ -466,7 +540,7 @@ module Haml
|
|
466
540
|
|
467
541
|
# Post-process case statements to normalize the nesting of "when" clauses
|
468
542
|
return unless node.value[:keyword] == "case"
|
469
|
-
return unless first = node.children.first
|
543
|
+
return unless (first = node.children.first)
|
470
544
|
return unless first.type == :silent_script && first.value[:keyword] == "when"
|
471
545
|
return if first.children.empty?
|
472
546
|
# If the case node has a "when" child with children, it's the
|
@@ -485,29 +559,39 @@ module Haml
|
|
485
559
|
# that can then be merged with another attributes hash.
|
486
560
|
def self.parse_class_and_id(list)
|
487
561
|
attributes = {}
|
488
|
-
|
562
|
+
return attributes if list.empty?
|
563
|
+
|
564
|
+
list.scan(/([#.])([-:_a-zA-Z0-9\@]+)/) do |type, property|
|
489
565
|
case type
|
490
566
|
when '.'
|
491
|
-
if attributes[
|
492
|
-
attributes[
|
567
|
+
if attributes[CLASS_KEY]
|
568
|
+
attributes[CLASS_KEY] += " "
|
493
569
|
else
|
494
|
-
attributes[
|
570
|
+
attributes[CLASS_KEY] = ""
|
495
571
|
end
|
496
|
-
attributes[
|
497
|
-
when '#'; attributes[
|
572
|
+
attributes[CLASS_KEY] += property
|
573
|
+
when '#'; attributes[ID_KEY] = property
|
498
574
|
end
|
499
575
|
end
|
500
576
|
attributes
|
501
577
|
end
|
502
578
|
|
579
|
+
# This method doesn't use Haml::AttributeParser because currently it depends on Ripper and Rubinius doesn't provide it.
|
580
|
+
# Ideally this logic should be placed in Haml::AttributeParser instead of here and this method should use it.
|
581
|
+
#
|
582
|
+
# @param [String] text - Hash literal or text inside old attributes
|
583
|
+
# @return [Hash,nil] - Return nil if text is not static Hash literal
|
503
584
|
def parse_static_hash(text)
|
504
585
|
attributes = {}
|
586
|
+
return attributes if text.empty?
|
587
|
+
|
588
|
+
text = text[1...-1] # strip brackets
|
505
589
|
scanner = StringScanner.new(text)
|
506
590
|
scanner.scan(/\s+/)
|
507
591
|
until scanner.eos?
|
508
|
-
return unless key = scanner.scan(LITERAL_VALUE_REGEX)
|
592
|
+
return unless (key = scanner.scan(LITERAL_VALUE_REGEX))
|
509
593
|
return unless scanner.scan(/\s*=>\s*/)
|
510
|
-
return unless value = scanner.scan(LITERAL_VALUE_REGEX)
|
594
|
+
return unless (value = scanner.scan(LITERAL_VALUE_REGEX))
|
511
595
|
return unless scanner.scan(/\s*(?:,|$)\s*/)
|
512
596
|
attributes[eval(key).to_s] = eval(value).to_s
|
513
597
|
end
|
@@ -515,20 +599,20 @@ module Haml
|
|
515
599
|
end
|
516
600
|
|
517
601
|
# Parses a line into tag_name, attributes, attributes_hash, object_ref, action, value
|
518
|
-
def parse_tag(
|
519
|
-
match =
|
520
|
-
raise SyntaxError.new(Error.message(:invalid_tag,
|
602
|
+
def parse_tag(text)
|
603
|
+
match = text.scan(/%([-:\w]+)([-:\w.#\@]*)(.+)?/)[0]
|
604
|
+
raise SyntaxError.new(Error.message(:invalid_tag, text)) unless match
|
521
605
|
|
522
606
|
tag_name, attributes, rest = match
|
523
607
|
|
524
|
-
if attributes =~ /[
|
608
|
+
if !attributes.empty? && (attributes =~ /[.#](\.|#|\z)/)
|
525
609
|
raise SyntaxError.new(Error.message(:illegal_element))
|
526
610
|
end
|
527
611
|
|
528
612
|
new_attributes_hash = old_attributes_hash = last_line = nil
|
529
|
-
object_ref =
|
613
|
+
object_ref = :nil
|
530
614
|
attributes_hashes = {}
|
531
|
-
while rest
|
615
|
+
while rest && !rest.empty?
|
532
616
|
case rest[0]
|
533
617
|
when ?{
|
534
618
|
break if old_attributes_hash
|
@@ -539,38 +623,51 @@ module Haml
|
|
539
623
|
new_attributes_hash, rest, last_line = parse_new_attributes(rest)
|
540
624
|
attributes_hashes[:new] = new_attributes_hash
|
541
625
|
when ?[
|
542
|
-
break unless object_ref ==
|
626
|
+
break unless object_ref == :nil
|
543
627
|
object_ref, rest = balance(rest, ?[, ?])
|
544
628
|
else; break
|
545
629
|
end
|
546
630
|
end
|
547
631
|
|
548
|
-
if rest
|
632
|
+
if rest && !rest.empty?
|
549
633
|
nuke_whitespace, action, value = rest.scan(/(<>|><|[><])?([=\/\~&!])?(.*)?/)[0]
|
550
|
-
nuke_whitespace
|
551
|
-
|
552
|
-
|
634
|
+
if nuke_whitespace
|
635
|
+
nuke_outer_whitespace = nuke_whitespace.include? '>'
|
636
|
+
nuke_inner_whitespace = nuke_whitespace.include? '<'
|
637
|
+
end
|
553
638
|
end
|
554
639
|
|
555
|
-
if @options
|
640
|
+
if @options.remove_whitespace
|
556
641
|
nuke_outer_whitespace = true
|
557
642
|
nuke_inner_whitespace = true
|
558
643
|
end
|
559
644
|
|
560
|
-
|
645
|
+
if value.nil?
|
646
|
+
value = ''
|
647
|
+
else
|
648
|
+
value.strip!
|
649
|
+
end
|
561
650
|
[tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
|
562
|
-
nuke_inner_whitespace, action, value, last_line || @index]
|
651
|
+
nuke_inner_whitespace, action, value, last_line || @line.index + 1]
|
563
652
|
end
|
564
653
|
|
565
|
-
|
566
|
-
|
567
|
-
|
654
|
+
# @return [String] attributes_hash - Hash literal starting with `{` and ending with `}`
|
655
|
+
# @return [String] rest
|
656
|
+
# @return [Integer] last_line
|
657
|
+
def parse_old_attributes(text)
|
658
|
+
last_line = @line.index + 1
|
568
659
|
|
569
660
|
begin
|
570
|
-
|
661
|
+
# Old attributes often look like a valid Hash literal, but it sometimes allow code like
|
662
|
+
# `{ hash, foo: bar }`, which is compiled to `_hamlout.attributes({}, nil, hash, foo: bar)`.
|
663
|
+
#
|
664
|
+
# To scan such code correctly, this scans `a( hash, foo: bar }` instead, stops when there is
|
665
|
+
# 1 more :on_embexpr_end (the last '}') than :on_embexpr_beg, and resurrects '{' afterwards.
|
666
|
+
balanced, rest = balance_tokens(text.sub(?{, METHOD_CALL_PREFIX), :on_embexpr_beg, :on_embexpr_end, count: 1)
|
667
|
+
attributes_hash = balanced.sub(METHOD_CALL_PREFIX, ?{)
|
571
668
|
rescue SyntaxError => e
|
572
|
-
if
|
573
|
-
|
669
|
+
if e.message == Error.message(:unbalanced_brackets) && !@template.empty?
|
670
|
+
text << "\n#{@next_line.text}"
|
574
671
|
last_line += 1
|
575
672
|
next_line
|
576
673
|
retry
|
@@ -579,14 +676,15 @@ module Haml
|
|
579
676
|
raise e
|
580
677
|
end
|
581
678
|
|
582
|
-
attributes_hash = attributes_hash[1...-1] if attributes_hash
|
583
679
|
return attributes_hash, rest, last_line
|
584
680
|
end
|
585
681
|
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
682
|
+
# @return [Array<Hash,String,nil>] - [static_attributes (Hash), dynamic_attributes (nil or String starting with `{` and ending with `}`)]
|
683
|
+
# @return [String] rest
|
684
|
+
# @return [Integer] last_line
|
685
|
+
def parse_new_attributes(text)
|
686
|
+
scanner = StringScanner.new(text)
|
687
|
+
last_line = @line.index + 1
|
590
688
|
attributes = {}
|
591
689
|
|
592
690
|
scanner.scan(/\(\s*/)
|
@@ -595,14 +693,15 @@ module Haml
|
|
595
693
|
break if name.nil?
|
596
694
|
|
597
695
|
if name == false
|
598
|
-
|
696
|
+
scanned = Haml::Util.balance(text, ?(, ?))
|
697
|
+
text = scanned ? scanned.first : text
|
599
698
|
raise Haml::SyntaxError.new(Error.message(:invalid_attribute_list, text.inspect), last_line - 1)
|
600
699
|
end
|
601
700
|
attributes[name] = value
|
602
701
|
scanner.scan(/\s*/)
|
603
702
|
|
604
703
|
if scanner.eos?
|
605
|
-
|
704
|
+
text << " #{@next_line.text}"
|
606
705
|
last_line += 1
|
607
706
|
next_line
|
608
707
|
scanner.scan(/\s*/)
|
@@ -610,12 +709,12 @@ module Haml
|
|
610
709
|
end
|
611
710
|
|
612
711
|
static_attributes = {}
|
613
|
-
dynamic_attributes = "{"
|
712
|
+
dynamic_attributes = "{".dup
|
614
713
|
attributes.each do |name, (type, val)|
|
615
714
|
if type == :static
|
616
715
|
static_attributes[name] = val
|
617
716
|
else
|
618
|
-
dynamic_attributes << inspect_obj(name)
|
717
|
+
dynamic_attributes << "#{inspect_obj(name)} => #{val},"
|
619
718
|
end
|
620
719
|
end
|
621
720
|
dynamic_attributes << "}"
|
@@ -625,7 +724,7 @@ module Haml
|
|
625
724
|
end
|
626
725
|
|
627
726
|
def parse_new_attribute(scanner)
|
628
|
-
unless name = scanner.scan(/[-:\w]+/)
|
727
|
+
unless (name = scanner.scan(/[-:\w]+/))
|
629
728
|
return if scanner.scan(/\)/)
|
630
729
|
return false
|
631
730
|
end
|
@@ -634,8 +733,8 @@ module Haml
|
|
634
733
|
return name, [:static, true] unless scanner.scan(/=/) #/end
|
635
734
|
|
636
735
|
scanner.scan(/\s*/)
|
637
|
-
unless quote = scanner.scan(/["']/)
|
638
|
-
return false unless var = scanner.scan(/(@@?|\$)?\w+/)
|
736
|
+
unless (quote = scanner.scan(/["']/))
|
737
|
+
return false unless (var = scanner.scan(/(@@?|\$)?\w+/))
|
639
738
|
return name, [:dynamic, var]
|
640
739
|
end
|
641
740
|
|
@@ -650,35 +749,16 @@ module Haml
|
|
650
749
|
|
651
750
|
return name, [:static, content.first[1]] if content.size == 1
|
652
751
|
return name, [:dynamic,
|
653
|
-
|
654
|
-
end
|
655
|
-
|
656
|
-
def raw_next_line
|
657
|
-
text = @template.shift
|
658
|
-
return unless text
|
659
|
-
|
660
|
-
index = @template_index
|
661
|
-
@template_index += 1
|
662
|
-
|
663
|
-
return text, index
|
752
|
+
%!"#{content.each_with_object(''.dup) {|(t, v), s| s << (t == :str ? inspect_obj(v)[1...-1] : "\#{#{v}}")}}"!]
|
664
753
|
end
|
665
754
|
|
666
755
|
def next_line
|
667
|
-
|
668
|
-
return unless text
|
669
|
-
|
670
|
-
# :eod is a special end-of-document marker
|
671
|
-
line =
|
672
|
-
if text == :eod
|
673
|
-
Line.new '-#', '-#', '-#', index, self, true
|
674
|
-
else
|
675
|
-
Line.new text.strip, text.lstrip.chomp, text, index, self, false
|
676
|
-
end
|
756
|
+
line = @template.shift || raise(StopIteration)
|
677
757
|
|
678
758
|
# `flat?' here is a little outdated,
|
679
759
|
# so we have to manually check if either the previous or current line
|
680
760
|
# closes the flat block, as well as whether a new block is opened.
|
681
|
-
line_defined = instance_variable_defined?(
|
761
|
+
line_defined = instance_variable_defined?(:@line)
|
682
762
|
@line.tabs if line_defined
|
683
763
|
unless (flat? && !closes_flat?(line) && !closes_flat?(@line)) ||
|
684
764
|
(line_defined && @line.text[0] == ?: && line.full =~ %r[^#{@line.full[/^\s+/]}\s])
|
@@ -694,21 +774,17 @@ module Haml
|
|
694
774
|
line && !line.text.empty? && line.full !~ /^#{@flat_spaces}/
|
695
775
|
end
|
696
776
|
|
697
|
-
def un_next_line(line)
|
698
|
-
@template.unshift line
|
699
|
-
@template_index -= 1
|
700
|
-
end
|
701
|
-
|
702
777
|
def handle_multiline(line)
|
703
778
|
return unless is_multiline?(line.text)
|
704
779
|
line.text.slice!(-1)
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
780
|
+
loop do
|
781
|
+
new_line = @template.first
|
782
|
+
break if new_line.eod?
|
783
|
+
next @template.shift if new_line.text.strip.empty?
|
784
|
+
break unless is_multiline?(new_line.text.strip)
|
785
|
+
line.text << new_line.text.strip[0...-1]
|
786
|
+
@template.shift
|
710
787
|
end
|
711
|
-
un_next_line new_line
|
712
788
|
end
|
713
789
|
|
714
790
|
# Checks whether or not `line` is in a multiline sequence.
|
@@ -716,18 +792,18 @@ module Haml
|
|
716
792
|
text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\s && text !~ BLOCK_WITH_SPACES
|
717
793
|
end
|
718
794
|
|
719
|
-
def handle_ruby_multiline(
|
720
|
-
text
|
721
|
-
return
|
722
|
-
un_next_line @next_line.full
|
795
|
+
def handle_ruby_multiline(line)
|
796
|
+
line.text.rstrip!
|
797
|
+
return line unless is_ruby_multiline?(line.text)
|
723
798
|
begin
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
799
|
+
# Use already fetched @next_line in the first loop. Otherwise, fetch next
|
800
|
+
new_line = new_line.nil? ? @next_line : @template.shift
|
801
|
+
break if new_line.eod?
|
802
|
+
next if new_line.text.empty?
|
803
|
+
line.text << " #{new_line.text.rstrip}"
|
804
|
+
end while is_ruby_multiline?(new_line.text)
|
729
805
|
next_line
|
730
|
-
|
806
|
+
line
|
731
807
|
end
|
732
808
|
|
733
809
|
# `text' is a Ruby multiline block if it:
|
@@ -735,15 +811,31 @@ module Haml
|
|
735
811
|
# - but not "?," which is a character literal
|
736
812
|
# (however, "x?," is a method call and not a literal)
|
737
813
|
# - and not "?\," which is a character literal
|
738
|
-
#
|
739
814
|
def is_ruby_multiline?(text)
|
740
815
|
text && text.length > 1 && text[-1] == ?, &&
|
741
|
-
!((text[-3
|
816
|
+
!((text[-3, 2] =~ /\W\?/) || text[-3, 2] == "?\\")
|
742
817
|
end
|
743
818
|
|
744
819
|
def balance(*args)
|
745
|
-
|
746
|
-
|
820
|
+
Haml::Util.balance(*args) or raise(SyntaxError.new(Error.message(:unbalanced_brackets)))
|
821
|
+
end
|
822
|
+
|
823
|
+
# Unlike #balance, this balances Ripper tokens to balance something like `{ a: "}" }` correctly.
|
824
|
+
def balance_tokens(buf, start, finish, count: 0)
|
825
|
+
text = ''.dup
|
826
|
+
Ripper.lex(buf).each do |_, token, str|
|
827
|
+
text << str
|
828
|
+
case token
|
829
|
+
when start
|
830
|
+
count += 1
|
831
|
+
when finish
|
832
|
+
count -= 1
|
833
|
+
end
|
834
|
+
|
835
|
+
if count == 0
|
836
|
+
return text, buf.sub(text, '')
|
837
|
+
end
|
838
|
+
end
|
747
839
|
raise SyntaxError.new(Error.message(:unbalanced_brackets))
|
748
840
|
end
|
749
841
|
|
@@ -754,7 +846,7 @@ module Haml
|
|
754
846
|
# Same semantics as block_opened?, except that block_opened? uses Line#tabs,
|
755
847
|
# which doesn't interact well with filter lines
|
756
848
|
def filter_opened?
|
757
|
-
@next_line.full =~ (@indentation ? /^#{@indentation * @template_tabs}/ : /^\s/)
|
849
|
+
@next_line.full =~ (@indentation ? /^#{@indentation * (@template_tabs + 1)}/ : /^\s/)
|
758
850
|
end
|
759
851
|
|
760
852
|
def flat?
|