brakeman 4.7.1 → 5.2.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 +163 -1
- data/README.md +24 -7
- data/bundle/load.rb +15 -13
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/README.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/setup.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/CHANGELOG.md +24 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/FAQ.md +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/Gemfile +1 -4
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/MIT-LICENSE +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/README.md +21 -16
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/REFERENCE.md +39 -10
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/TODO +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/haml.gemspec +2 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_builder.rb +58 -3
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_compiler.rb +45 -32
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_parser.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/buffer.rb +0 -56
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/compiler.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/engine.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/error.rb +0 -0
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/escapable.rb +77 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/exec.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/filters.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/generator.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_extensions.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_mods.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_xss_mods.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/safe_erubi_template.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/safe_erubis_template.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/xss_mods.rb +6 -3
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers.rb +7 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/options.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/parser.rb +32 -4
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/plugin.rb +18 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/railtie.rb +5 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/sass_rails_filter.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/template/options.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/template.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/temple_engine.rb +2 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/temple_line_counter.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/util.rb +1 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/version.rb +1 -1
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/yard/default/fulldoc/html/css/common.sass +0 -0
- data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/yard/default/layout/html/footer.erb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/AUTHORS +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/COPYING +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/Changelog.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/Gemfile +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/LICENSE +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/README.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/TODO +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/appveyor.yml +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/highline.gemspec +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/builtin_styles.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/color_scheme.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/compatibility.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/custom_errors.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/import.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/io_console_compatible.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/list.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/list_renderer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/menu/item.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/menu.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/paginator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question/answer_converter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question_asker.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/simulate.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/statement.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/string.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/string_extensions.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/style.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/template_renderer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/io_console.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/ncurses.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/unix_stty.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/version.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/wrapper.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline.rb +0 -0
- data/bundle/ruby/2.7.0/gems/parallel-1.21.0/MIT-LICENSE.txt +20 -0
- data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/processor_count.rb +45 -0
- data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/version.rb +4 -0
- data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb +532 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/NEWS.md +178 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/README.md +48 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/History.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/Manifest.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/README.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/lib/ruby2ruby.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/History.rdoc +166 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/Manifest.txt +7 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/README.rdoc +1 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/compare/normalize.rb +51 -6
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/debugging.md +190 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/gauntlet.md +106 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/rp_extensions.rb +15 -36
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/rp_stringscanner.rb +33 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby20_parser.rb +7128 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby20_parser.y +422 -301
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby21_parser.rb +7182 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby21_parser.y +417 -298
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby22_parser.rb +7228 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby22_parser.y +421 -300
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby23_parser.rb +7237 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby23_parser.y +421 -300
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby24_parser.rb +7268 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby24_parser.y +421 -300
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.rb +7268 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0/lib/ruby26_parser.y → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.y} +420 -313
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.rb +7287 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0/lib/ruby_parser.yy → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.y} +421 -404
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.rb +8517 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0/lib/ruby25_parser.y → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.y} +1032 -299
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.rb +8751 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.y +3472 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby3_parser.yy +3476 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rb +308 -605
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rex +33 -27
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rex.rb +65 -31
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_lexer_strings.rb +638 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_parser.rb +4 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_parser.yy +3487 -0
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_parser_extras.rb +343 -133
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/tools/munge.rb +43 -10
- data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 2.7.0/gems/ruby_parser-3.18.1}/tools/ripper.rb +15 -10
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -0
- data/bundle/ruby/{2.6.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.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -0
- data/bundle/ruby/{2.6.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.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/CHANGES.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/Gemfile +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/LICENSE.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/README.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -0
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/History.rdoc +55 -0
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/Manifest.txt +0 -0
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/README.rdoc +0 -0
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/pt_testcase.rb +9 -4
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp.rb +19 -9
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp_matcher.rb +44 -7
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/strict_sexp.rb +25 -3
- data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/unique.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/CHANGES +4 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/Gemfile +12 -13
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/LICENSE +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.jp.md +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.md +0 -0
- data/bundle/ruby/{2.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/command.rb +13 -13
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/controls.rb +0 -0
- data/bundle/ruby/{2.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/embedded.rb +0 -0
- data/bundle/ruby/{2.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/engine.rb +0 -0
- data/bundle/ruby/{2.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/filter.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/grammar.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/include.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/interpolation.rb +0 -0
- data/bundle/ruby/{2.6.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.6.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.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/parser.rb +1 -1
- data/bundle/ruby/{2.6.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.6.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.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart.rb +0 -0
- data/bundle/ruby/{2.6.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.6.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.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/template.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/translator.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/version.rb +1 -1
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/slim.gemspec +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/CHANGES +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/EXPRESSIONS.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/Gemfile +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/LICENSE +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/README.md +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/engine.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/string_splitter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/map.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/dispatcher.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/parser.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/static_analyzer.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates/rails.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/utils.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/version.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/temple.gemspec +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Manifest +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/COPYING +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/commonmarker.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/less.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/pandoc.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rst-pandoc.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/string.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/template.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/CHANGELOG.md +12 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/README.md +3 -3
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/constants.rb +2 -2
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/index.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/string_ext.rb +0 -0
- data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width.rb +1 -1
- data/lib/brakeman/app_tree.rb +37 -4
- data/lib/brakeman/checks/base_check.rb +30 -11
- 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_csrf_token_forgery_cve.rb +28 -0
- data/lib/brakeman/checks/check_deserialize.rb +21 -1
- data/lib/brakeman/checks/check_detailed_exceptions.rb +1 -1
- data/lib/brakeman/checks/check_eol_rails.rb +23 -0
- data/lib/brakeman/checks/check_eol_ruby.rb +26 -0
- data/lib/brakeman/checks/check_evaluation.rb +1 -1
- data/lib/brakeman/checks/check_execute.rb +52 -6
- data/lib/brakeman/checks/check_json_entity_escape.rb +38 -0
- data/lib/brakeman/checks/check_json_parsing.rb +1 -1
- 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 +38 -10
- 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_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_render.rb +15 -1
- data/lib/brakeman/checks/check_sanitize_methods.rb +2 -1
- data/lib/brakeman/checks/check_skip_before_filter.rb +4 -4
- data/lib/brakeman/checks/check_sql.rb +83 -41
- data/lib/brakeman/checks/check_symbol_dos.rb +1 -1
- data/lib/brakeman/checks/check_template_injection.rb +32 -0
- data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +68 -0
- data/lib/brakeman/checks/check_verb_confusion.rb +75 -0
- data/lib/brakeman/checks/eol_check.rb +47 -0
- data/lib/brakeman/commandline.rb +25 -1
- data/lib/brakeman/differ.rb +0 -5
- data/lib/brakeman/file_parser.rb +58 -22
- data/lib/brakeman/options.rb +39 -2
- data/lib/brakeman/parsers/template_parser.rb +26 -3
- data/lib/brakeman/processor.rb +1 -1
- data/lib/brakeman/processors/alias_processor.rb +132 -24
- data/lib/brakeman/processors/base_processor.rb +4 -4
- data/lib/brakeman/processors/controller_alias_processor.rb +6 -43
- data/lib/brakeman/processors/controller_processor.rb +1 -1
- data/lib/brakeman/processors/gem_processor.rb +3 -0
- data/lib/brakeman/processors/haml_template_processor.rb +17 -1
- data/lib/brakeman/processors/lib/call_conversion_helper.rb +13 -7
- data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
- data/lib/brakeman/processors/lib/find_all_calls.rb +30 -14
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +16 -16
- data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -0
- data/lib/brakeman/processors/lib/rails4_config_processor.rb +2 -1
- data/lib/brakeman/processors/lib/render_helper.rb +3 -1
- data/lib/brakeman/processors/library_processor.rb +9 -0
- data/lib/brakeman/processors/model_processor.rb +32 -0
- data/lib/brakeman/processors/output_processor.rb +1 -1
- data/lib/brakeman/processors/template_alias_processor.rb +5 -0
- data/lib/brakeman/report/ignore/config.rb +10 -2
- data/lib/brakeman/report/ignore/interactive.rb +1 -1
- data/lib/brakeman/report/report_base.rb +0 -2
- data/lib/brakeman/report/report_csv.rb +37 -60
- data/lib/brakeman/report/report_github.rb +31 -0
- 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 +133 -0
- data/lib/brakeman/report/report_sonar.rb +38 -0
- data/lib/brakeman/report/report_tabs.rb +1 -1
- data/lib/brakeman/report/report_text.rb +38 -17
- data/lib/brakeman/report.rb +22 -1
- data/lib/brakeman/rescanner.rb +7 -5
- data/lib/brakeman/scanner.rb +65 -31
- data/lib/brakeman/tracker/collection.rb +57 -7
- data/lib/brakeman/tracker/config.rb +88 -5
- data/lib/brakeman/tracker/constants.rb +8 -7
- data/lib/brakeman/tracker/controller.rb +1 -1
- data/lib/brakeman/tracker/method_info.rb +70 -0
- data/lib/brakeman/tracker.rb +42 -5
- data/lib/brakeman/util.rb +63 -24
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning.rb +10 -2
- data/lib/brakeman/warning_codes.rb +13 -0
- data/lib/brakeman.rb +49 -6
- data/lib/ruby_parser/bm_sexp.rb +33 -9
- metadata +438 -352
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/escapable.rb +0 -50
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/debugging.md +0 -18
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/rp_stringscanner.rb +0 -64
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby20_parser.rb +0 -7045
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby21_parser.rb +0 -7116
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby22_parser.rb +0 -7149
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby23_parser.rb +0 -7166
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby24_parser.rb +0 -7178
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby25_parser.rb +0 -7178
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby26_parser.rb +0 -7198
- data/bundle/ruby/2.6.0/gems/unicode-display_width-1.6.0/data/display_width.marshal.gz +0 -0
@@ -0,0 +1,694 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
require_relative '../parseexception'
|
3
|
+
require_relative '../undefinednamespaceexception'
|
4
|
+
require_relative '../source'
|
5
|
+
require 'set'
|
6
|
+
require "strscan"
|
7
|
+
|
8
|
+
module REXML
|
9
|
+
module Parsers
|
10
|
+
# = Using the Pull Parser
|
11
|
+
# <em>This API is experimental, and subject to change.</em>
|
12
|
+
# parser = PullParser.new( "<a>text<b att='val'/>txet</a>" )
|
13
|
+
# while parser.has_next?
|
14
|
+
# res = parser.next
|
15
|
+
# puts res[1]['att'] if res.start_tag? and res[0] == 'b'
|
16
|
+
# end
|
17
|
+
# See the PullEvent class for information on the content of the results.
|
18
|
+
# The data is identical to the arguments passed for the various events to
|
19
|
+
# the StreamListener API.
|
20
|
+
#
|
21
|
+
# Notice that:
|
22
|
+
# parser = PullParser.new( "<a>BAD DOCUMENT" )
|
23
|
+
# while parser.has_next?
|
24
|
+
# res = parser.next
|
25
|
+
# raise res[1] if res.error?
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# Nat Price gave me some good ideas for the API.
|
29
|
+
class BaseParser
|
30
|
+
LETTER = '[:alpha:]'
|
31
|
+
DIGIT = '[:digit:]'
|
32
|
+
|
33
|
+
COMBININGCHAR = '' # TODO
|
34
|
+
EXTENDER = '' # TODO
|
35
|
+
|
36
|
+
NCNAME_STR= "[#{LETTER}_][-[:alnum:]._#{COMBININGCHAR}#{EXTENDER}]*"
|
37
|
+
QNAME_STR= "(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})"
|
38
|
+
QNAME = /(#{QNAME_STR})/
|
39
|
+
|
40
|
+
# Just for backward compatibility. For example, kramdown uses this.
|
41
|
+
# It's not used in REXML.
|
42
|
+
UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
|
43
|
+
|
44
|
+
NAMECHAR = '[\-\w\.:]'
|
45
|
+
NAME = "([\\w:]#{NAMECHAR}*)"
|
46
|
+
NMTOKEN = "(?:#{NAMECHAR})+"
|
47
|
+
NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
|
48
|
+
REFERENCE = "&(?:#{NAME};|#\\d+;|#x[0-9a-fA-F]+;)"
|
49
|
+
REFERENCE_RE = /#{REFERENCE}/
|
50
|
+
|
51
|
+
DOCTYPE_START = /\A\s*<!DOCTYPE\s/um
|
52
|
+
DOCTYPE_END = /\A\s*\]\s*>/um
|
53
|
+
ATTRIBUTE_PATTERN = /\s*(#{QNAME_STR})\s*=\s*(["'])(.*?)\4/um
|
54
|
+
COMMENT_START = /\A<!--/u
|
55
|
+
COMMENT_PATTERN = /<!--(.*?)-->/um
|
56
|
+
CDATA_START = /\A<!\[CDATA\[/u
|
57
|
+
CDATA_END = /\A\s*\]\s*>/um
|
58
|
+
CDATA_PATTERN = /<!\[CDATA\[(.*?)\]\]>/um
|
59
|
+
XMLDECL_START = /\A<\?xml\s/u;
|
60
|
+
XMLDECL_PATTERN = /<\?xml\s+(.*?)\?>/um
|
61
|
+
INSTRUCTION_START = /\A<\?/u
|
62
|
+
INSTRUCTION_PATTERN = /<\?#{NAME}(\s+.*?)?\?>/um
|
63
|
+
TAG_MATCH = /\A<((?>#{QNAME_STR}))/um
|
64
|
+
CLOSE_MATCH = /\A\s*<\/(#{QNAME_STR})\s*>/um
|
65
|
+
|
66
|
+
VERSION = /\bversion\s*=\s*["'](.*?)['"]/um
|
67
|
+
ENCODING = /\bencoding\s*=\s*["'](.*?)['"]/um
|
68
|
+
STANDALONE = /\bstandalone\s*=\s*["'](.*?)['"]/um
|
69
|
+
|
70
|
+
ENTITY_START = /\A\s*<!ENTITY/
|
71
|
+
ELEMENTDECL_START = /\A\s*<!ELEMENT/um
|
72
|
+
ELEMENTDECL_PATTERN = /\A\s*(<!ELEMENT.*?)>/um
|
73
|
+
SYSTEMENTITY = /\A\s*(%.*?;)\s*$/um
|
74
|
+
ENUMERATION = "\\(\\s*#{NMTOKEN}(?:\\s*\\|\\s*#{NMTOKEN})*\\s*\\)"
|
75
|
+
NOTATIONTYPE = "NOTATION\\s+\\(\\s*#{NAME}(?:\\s*\\|\\s*#{NAME})*\\s*\\)"
|
76
|
+
ENUMERATEDTYPE = "(?:(?:#{NOTATIONTYPE})|(?:#{ENUMERATION}))"
|
77
|
+
ATTTYPE = "(CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS|#{ENUMERATEDTYPE})"
|
78
|
+
ATTVALUE = "(?:\"((?:[^<&\"]|#{REFERENCE})*)\")|(?:'((?:[^<&']|#{REFERENCE})*)')"
|
79
|
+
DEFAULTDECL = "(#REQUIRED|#IMPLIED|(?:(#FIXED\\s+)?#{ATTVALUE}))"
|
80
|
+
ATTDEF = "\\s+#{NAME}\\s+#{ATTTYPE}\\s+#{DEFAULTDECL}"
|
81
|
+
ATTDEF_RE = /#{ATTDEF}/
|
82
|
+
ATTLISTDECL_START = /\A\s*<!ATTLIST/um
|
83
|
+
ATTLISTDECL_PATTERN = /\A\s*<!ATTLIST\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
84
|
+
|
85
|
+
TEXT_PATTERN = /\A([^<]*)/um
|
86
|
+
|
87
|
+
# Entity constants
|
88
|
+
PUBIDCHAR = "\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
|
89
|
+
SYSTEMLITERAL = %Q{((?:"[^"]*")|(?:'[^']*'))}
|
90
|
+
PUBIDLITERAL = %Q{("[#{PUBIDCHAR}']*"|'[#{PUBIDCHAR}]*')}
|
91
|
+
EXTERNALID = "(?:(?:(SYSTEM)\\s+#{SYSTEMLITERAL})|(?:(PUBLIC)\\s+#{PUBIDLITERAL}\\s+#{SYSTEMLITERAL}))"
|
92
|
+
NDATADECL = "\\s+NDATA\\s+#{NAME}"
|
93
|
+
PEREFERENCE = "%#{NAME};"
|
94
|
+
ENTITYVALUE = %Q{((?:"(?:[^%&"]|#{PEREFERENCE}|#{REFERENCE})*")|(?:'([^%&']|#{PEREFERENCE}|#{REFERENCE})*'))}
|
95
|
+
PEDEF = "(?:#{ENTITYVALUE}|#{EXTERNALID})"
|
96
|
+
ENTITYDEF = "(?:#{ENTITYVALUE}|(?:#{EXTERNALID}(#{NDATADECL})?))"
|
97
|
+
PEDECL = "<!ENTITY\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
|
98
|
+
GEDECL = "<!ENTITY\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
|
99
|
+
ENTITYDECL = /\s*(?:#{GEDECL})|(?:#{PEDECL})/um
|
100
|
+
|
101
|
+
NOTATIONDECL_START = /\A\s*<!NOTATION/um
|
102
|
+
EXTERNAL_ID_PUBLIC = /\A\s*PUBLIC\s+#{PUBIDLITERAL}\s+#{SYSTEMLITERAL}\s*/um
|
103
|
+
EXTERNAL_ID_SYSTEM = /\A\s*SYSTEM\s+#{SYSTEMLITERAL}\s*/um
|
104
|
+
PUBLIC_ID = /\A\s*PUBLIC\s+#{PUBIDLITERAL}\s*/um
|
105
|
+
|
106
|
+
EREFERENCE = /&(?!#{NAME};)/
|
107
|
+
|
108
|
+
DEFAULT_ENTITIES = {
|
109
|
+
'gt' => [/>/, '>', '>', />/],
|
110
|
+
'lt' => [/</, '<', '<', /</],
|
111
|
+
'quot' => [/"/, '"', '"', /"/],
|
112
|
+
"apos" => [/'/, "'", "'", /'/]
|
113
|
+
}
|
114
|
+
|
115
|
+
def initialize( source )
|
116
|
+
self.stream = source
|
117
|
+
@listeners = []
|
118
|
+
end
|
119
|
+
|
120
|
+
def add_listener( listener )
|
121
|
+
@listeners << listener
|
122
|
+
end
|
123
|
+
|
124
|
+
attr_reader :source
|
125
|
+
|
126
|
+
def stream=( source )
|
127
|
+
@source = SourceFactory.create_from( source )
|
128
|
+
@closed = nil
|
129
|
+
@document_status = nil
|
130
|
+
@tags = []
|
131
|
+
@stack = []
|
132
|
+
@entities = []
|
133
|
+
@nsstack = []
|
134
|
+
end
|
135
|
+
|
136
|
+
def position
|
137
|
+
if @source.respond_to? :position
|
138
|
+
@source.position
|
139
|
+
else
|
140
|
+
# FIXME
|
141
|
+
0
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns true if there are no more events
|
146
|
+
def empty?
|
147
|
+
return (@source.empty? and @stack.empty?)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Returns true if there are more events. Synonymous with !empty?
|
151
|
+
def has_next?
|
152
|
+
return !(@source.empty? and @stack.empty?)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Push an event back on the head of the stream. This method
|
156
|
+
# has (theoretically) infinite depth.
|
157
|
+
def unshift token
|
158
|
+
@stack.unshift(token)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Peek at the +depth+ event in the stack. The first element on the stack
|
162
|
+
# is at depth 0. If +depth+ is -1, will parse to the end of the input
|
163
|
+
# stream and return the last event, which is always :end_document.
|
164
|
+
# Be aware that this causes the stream to be parsed up to the +depth+
|
165
|
+
# event, so you can effectively pre-parse the entire document (pull the
|
166
|
+
# entire thing into memory) using this method.
|
167
|
+
def peek depth=0
|
168
|
+
raise %Q[Illegal argument "#{depth}"] if depth < -1
|
169
|
+
temp = []
|
170
|
+
if depth == -1
|
171
|
+
temp.push(pull()) until empty?
|
172
|
+
else
|
173
|
+
while @stack.size+temp.size < depth+1
|
174
|
+
temp.push(pull())
|
175
|
+
end
|
176
|
+
end
|
177
|
+
@stack += temp if temp.size > 0
|
178
|
+
@stack[depth]
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the next event. This is a +PullEvent+ object.
|
182
|
+
def pull
|
183
|
+
pull_event.tap do |event|
|
184
|
+
@listeners.each do |listener|
|
185
|
+
listener.receive event
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def pull_event
|
191
|
+
if @closed
|
192
|
+
x, @closed = @closed, nil
|
193
|
+
return [ :end_element, x ]
|
194
|
+
end
|
195
|
+
return [ :end_document ] if empty?
|
196
|
+
return @stack.shift if @stack.size > 0
|
197
|
+
#STDERR.puts @source.encoding
|
198
|
+
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
|
199
|
+
if @document_status == nil
|
200
|
+
word = @source.match( /\A((?:\s+)|(?:<[^>]*>))/um )
|
201
|
+
word = word[1] unless word.nil?
|
202
|
+
#STDERR.puts "WORD = #{word.inspect}"
|
203
|
+
case word
|
204
|
+
when COMMENT_START
|
205
|
+
return [ :comment, @source.match( COMMENT_PATTERN, true )[1] ]
|
206
|
+
when XMLDECL_START
|
207
|
+
#STDERR.puts "XMLDECL"
|
208
|
+
results = @source.match( XMLDECL_PATTERN, true )[1]
|
209
|
+
version = VERSION.match( results )
|
210
|
+
version = version[1] unless version.nil?
|
211
|
+
encoding = ENCODING.match(results)
|
212
|
+
encoding = encoding[1] unless encoding.nil?
|
213
|
+
if need_source_encoding_update?(encoding)
|
214
|
+
@source.encoding = encoding
|
215
|
+
end
|
216
|
+
if encoding.nil? and /\AUTF-16(?:BE|LE)\z/i =~ @source.encoding
|
217
|
+
encoding = "UTF-16"
|
218
|
+
end
|
219
|
+
standalone = STANDALONE.match(results)
|
220
|
+
standalone = standalone[1] unless standalone.nil?
|
221
|
+
return [ :xmldecl, version, encoding, standalone ]
|
222
|
+
when INSTRUCTION_START
|
223
|
+
return process_instruction
|
224
|
+
when DOCTYPE_START
|
225
|
+
base_error_message = "Malformed DOCTYPE"
|
226
|
+
@source.match(DOCTYPE_START, true)
|
227
|
+
@nsstack.unshift(curr_ns=Set.new)
|
228
|
+
name = parse_name(base_error_message)
|
229
|
+
if @source.match(/\A\s*\[/um, true)
|
230
|
+
id = [nil, nil, nil]
|
231
|
+
@document_status = :in_doctype
|
232
|
+
elsif @source.match(/\A\s*>/um, true)
|
233
|
+
id = [nil, nil, nil]
|
234
|
+
@document_status = :after_doctype
|
235
|
+
else
|
236
|
+
id = parse_id(base_error_message,
|
237
|
+
accept_external_id: true,
|
238
|
+
accept_public_id: false)
|
239
|
+
if id[0] == "SYSTEM"
|
240
|
+
# For backward compatibility
|
241
|
+
id[1], id[2] = id[2], nil
|
242
|
+
end
|
243
|
+
if @source.match(/\A\s*\[/um, true)
|
244
|
+
@document_status = :in_doctype
|
245
|
+
elsif @source.match(/\A\s*>/um, true)
|
246
|
+
@document_status = :after_doctype
|
247
|
+
else
|
248
|
+
message = "#{base_error_message}: garbage after external ID"
|
249
|
+
raise REXML::ParseException.new(message, @source)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
args = [:start_doctype, name, *id]
|
253
|
+
if @document_status == :after_doctype
|
254
|
+
@source.match(/\A\s*/um, true)
|
255
|
+
@stack << [ :end_doctype ]
|
256
|
+
end
|
257
|
+
return args
|
258
|
+
when /\A\s+/
|
259
|
+
else
|
260
|
+
@document_status = :after_doctype
|
261
|
+
if @source.encoding == "UTF-8"
|
262
|
+
@source.buffer.force_encoding(::Encoding::UTF_8)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
if @document_status == :in_doctype
|
267
|
+
md = @source.match(/\A\s*(.*?>)/um)
|
268
|
+
case md[1]
|
269
|
+
when SYSTEMENTITY
|
270
|
+
match = @source.match( SYSTEMENTITY, true )[1]
|
271
|
+
return [ :externalentity, match ]
|
272
|
+
|
273
|
+
when ELEMENTDECL_START
|
274
|
+
return [ :elementdecl, @source.match( ELEMENTDECL_PATTERN, true )[1] ]
|
275
|
+
|
276
|
+
when ENTITY_START
|
277
|
+
match = @source.match( ENTITYDECL, true ).to_a.compact
|
278
|
+
match[0] = :entitydecl
|
279
|
+
ref = false
|
280
|
+
if match[1] == '%'
|
281
|
+
ref = true
|
282
|
+
match.delete_at 1
|
283
|
+
end
|
284
|
+
# Now we have to sort out what kind of entity reference this is
|
285
|
+
if match[2] == 'SYSTEM'
|
286
|
+
# External reference
|
287
|
+
match[3] = match[3][1..-2] # PUBID
|
288
|
+
match.delete_at(4) if match.size > 4 # Chop out NDATA decl
|
289
|
+
# match is [ :entity, name, SYSTEM, pubid(, ndata)? ]
|
290
|
+
elsif match[2] == 'PUBLIC'
|
291
|
+
# External reference
|
292
|
+
match[3] = match[3][1..-2] # PUBID
|
293
|
+
match[4] = match[4][1..-2] # HREF
|
294
|
+
match.delete_at(5) if match.size > 5 # Chop out NDATA decl
|
295
|
+
# match is [ :entity, name, PUBLIC, pubid, href(, ndata)? ]
|
296
|
+
else
|
297
|
+
match[2] = match[2][1..-2]
|
298
|
+
match.pop if match.size == 4
|
299
|
+
# match is [ :entity, name, value ]
|
300
|
+
end
|
301
|
+
match << '%' if ref
|
302
|
+
return match
|
303
|
+
when ATTLISTDECL_START
|
304
|
+
md = @source.match( ATTLISTDECL_PATTERN, true )
|
305
|
+
raise REXML::ParseException.new( "Bad ATTLIST declaration!", @source ) if md.nil?
|
306
|
+
element = md[1]
|
307
|
+
contents = md[0]
|
308
|
+
|
309
|
+
pairs = {}
|
310
|
+
values = md[0].scan( ATTDEF_RE )
|
311
|
+
values.each do |attdef|
|
312
|
+
unless attdef[3] == "#IMPLIED"
|
313
|
+
attdef.compact!
|
314
|
+
val = attdef[3]
|
315
|
+
val = attdef[4] if val == "#FIXED "
|
316
|
+
pairs[attdef[0]] = val
|
317
|
+
if attdef[0] =~ /^xmlns:(.*)/
|
318
|
+
@nsstack[0] << $1
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
return [ :attlistdecl, element, pairs, contents ]
|
323
|
+
when NOTATIONDECL_START
|
324
|
+
base_error_message = "Malformed notation declaration"
|
325
|
+
unless @source.match(/\A\s*<!NOTATION\s+/um, true)
|
326
|
+
if @source.match(/\A\s*<!NOTATION\s*>/um)
|
327
|
+
message = "#{base_error_message}: name is missing"
|
328
|
+
else
|
329
|
+
message = "#{base_error_message}: invalid declaration name"
|
330
|
+
end
|
331
|
+
raise REXML::ParseException.new(message, @source)
|
332
|
+
end
|
333
|
+
name = parse_name(base_error_message)
|
334
|
+
id = parse_id(base_error_message,
|
335
|
+
accept_external_id: true,
|
336
|
+
accept_public_id: true)
|
337
|
+
unless @source.match(/\A\s*>/um, true)
|
338
|
+
message = "#{base_error_message}: garbage before end >"
|
339
|
+
raise REXML::ParseException.new(message, @source)
|
340
|
+
end
|
341
|
+
return [:notationdecl, name, *id]
|
342
|
+
when DOCTYPE_END
|
343
|
+
@document_status = :after_doctype
|
344
|
+
@source.match( DOCTYPE_END, true )
|
345
|
+
return [ :end_doctype ]
|
346
|
+
end
|
347
|
+
end
|
348
|
+
if @document_status == :after_doctype
|
349
|
+
@source.match(/\A\s*/um, true)
|
350
|
+
end
|
351
|
+
begin
|
352
|
+
@source.read if @source.buffer.size<2
|
353
|
+
if @source.buffer[0] == ?<
|
354
|
+
if @source.buffer[1] == ?/
|
355
|
+
@nsstack.shift
|
356
|
+
last_tag = @tags.pop
|
357
|
+
md = @source.match( CLOSE_MATCH, true )
|
358
|
+
if md and !last_tag
|
359
|
+
message = "Unexpected top-level end tag (got '#{md[1]}')"
|
360
|
+
raise REXML::ParseException.new(message, @source)
|
361
|
+
end
|
362
|
+
if md.nil? or last_tag != md[1]
|
363
|
+
message = "Missing end tag for '#{last_tag}'"
|
364
|
+
message << " (got '#{md[1]}')" if md
|
365
|
+
raise REXML::ParseException.new(message, @source)
|
366
|
+
end
|
367
|
+
return [ :end_element, last_tag ]
|
368
|
+
elsif @source.buffer[1] == ?!
|
369
|
+
md = @source.match(/\A(\s*[^>]*>)/um)
|
370
|
+
#STDERR.puts "SOURCE BUFFER = #{source.buffer}, #{source.buffer.size}"
|
371
|
+
raise REXML::ParseException.new("Malformed node", @source) unless md
|
372
|
+
if md[0][2] == ?-
|
373
|
+
md = @source.match( COMMENT_PATTERN, true )
|
374
|
+
|
375
|
+
case md[1]
|
376
|
+
when /--/, /-\z/
|
377
|
+
raise REXML::ParseException.new("Malformed comment", @source)
|
378
|
+
end
|
379
|
+
|
380
|
+
return [ :comment, md[1] ] if md
|
381
|
+
else
|
382
|
+
md = @source.match( CDATA_PATTERN, true )
|
383
|
+
return [ :cdata, md[1] ] if md
|
384
|
+
end
|
385
|
+
raise REXML::ParseException.new( "Declarations can only occur "+
|
386
|
+
"in the doctype declaration.", @source)
|
387
|
+
elsif @source.buffer[1] == ??
|
388
|
+
return process_instruction
|
389
|
+
else
|
390
|
+
# Get the next tag
|
391
|
+
md = @source.match(TAG_MATCH, true)
|
392
|
+
unless md
|
393
|
+
raise REXML::ParseException.new("malformed XML: missing tag start", @source)
|
394
|
+
end
|
395
|
+
@document_status = :in_element
|
396
|
+
prefixes = Set.new
|
397
|
+
prefixes << md[2] if md[2]
|
398
|
+
@nsstack.unshift(curr_ns=Set.new)
|
399
|
+
attributes, closed = parse_attributes(prefixes, curr_ns)
|
400
|
+
# Verify that all of the prefixes have been defined
|
401
|
+
for prefix in prefixes
|
402
|
+
unless @nsstack.find{|k| k.member?(prefix)}
|
403
|
+
raise UndefinedNamespaceException.new(prefix,@source,self)
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
if closed
|
408
|
+
@closed = md[1]
|
409
|
+
@nsstack.shift
|
410
|
+
else
|
411
|
+
@tags.push( md[1] )
|
412
|
+
end
|
413
|
+
return [ :start_element, md[1], attributes ]
|
414
|
+
end
|
415
|
+
else
|
416
|
+
md = @source.match( TEXT_PATTERN, true )
|
417
|
+
if md[0].length == 0
|
418
|
+
@source.match( /(\s+)/, true )
|
419
|
+
end
|
420
|
+
#STDERR.puts "GOT #{md[1].inspect}" unless md[0].length == 0
|
421
|
+
#return [ :text, "" ] if md[0].length == 0
|
422
|
+
# unnormalized = Text::unnormalize( md[1], self )
|
423
|
+
# return PullEvent.new( :text, md[1], unnormalized )
|
424
|
+
return [ :text, md[1] ]
|
425
|
+
end
|
426
|
+
rescue REXML::UndefinedNamespaceException
|
427
|
+
raise
|
428
|
+
rescue REXML::ParseException
|
429
|
+
raise
|
430
|
+
rescue => error
|
431
|
+
raise REXML::ParseException.new( "Exception parsing",
|
432
|
+
@source, self, (error ? error : $!) )
|
433
|
+
end
|
434
|
+
return [ :dummy ]
|
435
|
+
end
|
436
|
+
private :pull_event
|
437
|
+
|
438
|
+
def entity( reference, entities )
|
439
|
+
value = nil
|
440
|
+
value = entities[ reference ] if entities
|
441
|
+
if not value
|
442
|
+
value = DEFAULT_ENTITIES[ reference ]
|
443
|
+
value = value[2] if value
|
444
|
+
end
|
445
|
+
unnormalize( value, entities ) if value
|
446
|
+
end
|
447
|
+
|
448
|
+
# Escapes all possible entities
|
449
|
+
def normalize( input, entities=nil, entity_filter=nil )
|
450
|
+
copy = input.clone
|
451
|
+
# Doing it like this rather than in a loop improves the speed
|
452
|
+
copy.gsub!( EREFERENCE, '&' )
|
453
|
+
entities.each do |key, value|
|
454
|
+
copy.gsub!( value, "&#{key};" ) unless entity_filter and
|
455
|
+
entity_filter.include?(entity)
|
456
|
+
end if entities
|
457
|
+
copy.gsub!( EREFERENCE, '&' )
|
458
|
+
DEFAULT_ENTITIES.each do |key, value|
|
459
|
+
copy.gsub!( value[3], value[1] )
|
460
|
+
end
|
461
|
+
copy
|
462
|
+
end
|
463
|
+
|
464
|
+
# Unescapes all possible entities
|
465
|
+
def unnormalize( string, entities=nil, filter=nil )
|
466
|
+
rv = string.clone
|
467
|
+
rv.gsub!( /\r\n?/, "\n" )
|
468
|
+
matches = rv.scan( REFERENCE_RE )
|
469
|
+
return rv if matches.size == 0
|
470
|
+
rv.gsub!( /�*((?:\d+)|(?:x[a-fA-F0-9]+));/ ) {
|
471
|
+
m=$1
|
472
|
+
m = "0#{m}" if m[0] == ?x
|
473
|
+
[Integer(m)].pack('U*')
|
474
|
+
}
|
475
|
+
matches.collect!{|x|x[0]}.compact!
|
476
|
+
if matches.size > 0
|
477
|
+
matches.each do |entity_reference|
|
478
|
+
unless filter and filter.include?(entity_reference)
|
479
|
+
entity_value = entity( entity_reference, entities )
|
480
|
+
if entity_value
|
481
|
+
re = /&#{entity_reference};/
|
482
|
+
rv.gsub!( re, entity_value )
|
483
|
+
else
|
484
|
+
er = DEFAULT_ENTITIES[entity_reference]
|
485
|
+
rv.gsub!( er[0], er[2] ) if er
|
486
|
+
end
|
487
|
+
end
|
488
|
+
end
|
489
|
+
rv.gsub!( /&/, '&' )
|
490
|
+
end
|
491
|
+
rv
|
492
|
+
end
|
493
|
+
|
494
|
+
private
|
495
|
+
def need_source_encoding_update?(xml_declaration_encoding)
|
496
|
+
return false if xml_declaration_encoding.nil?
|
497
|
+
return false if /\AUTF-16\z/i =~ xml_declaration_encoding
|
498
|
+
true
|
499
|
+
end
|
500
|
+
|
501
|
+
def parse_name(base_error_message)
|
502
|
+
md = @source.match(/\A\s*#{NAME}/um, true)
|
503
|
+
unless md
|
504
|
+
if @source.match(/\A\s*\S/um)
|
505
|
+
message = "#{base_error_message}: invalid name"
|
506
|
+
else
|
507
|
+
message = "#{base_error_message}: name is missing"
|
508
|
+
end
|
509
|
+
raise REXML::ParseException.new(message, @source)
|
510
|
+
end
|
511
|
+
md[1]
|
512
|
+
end
|
513
|
+
|
514
|
+
def parse_id(base_error_message,
|
515
|
+
accept_external_id:,
|
516
|
+
accept_public_id:)
|
517
|
+
if accept_external_id and (md = @source.match(EXTERNAL_ID_PUBLIC, true))
|
518
|
+
pubid = system = nil
|
519
|
+
pubid_literal = md[1]
|
520
|
+
pubid = pubid_literal[1..-2] if pubid_literal # Remove quote
|
521
|
+
system_literal = md[2]
|
522
|
+
system = system_literal[1..-2] if system_literal # Remove quote
|
523
|
+
["PUBLIC", pubid, system]
|
524
|
+
elsif accept_public_id and (md = @source.match(PUBLIC_ID, true))
|
525
|
+
pubid = system = nil
|
526
|
+
pubid_literal = md[1]
|
527
|
+
pubid = pubid_literal[1..-2] if pubid_literal # Remove quote
|
528
|
+
["PUBLIC", pubid, nil]
|
529
|
+
elsif accept_external_id and (md = @source.match(EXTERNAL_ID_SYSTEM, true))
|
530
|
+
system = nil
|
531
|
+
system_literal = md[1]
|
532
|
+
system = system_literal[1..-2] if system_literal # Remove quote
|
533
|
+
["SYSTEM", nil, system]
|
534
|
+
else
|
535
|
+
details = parse_id_invalid_details(accept_external_id: accept_external_id,
|
536
|
+
accept_public_id: accept_public_id)
|
537
|
+
message = "#{base_error_message}: #{details}"
|
538
|
+
raise REXML::ParseException.new(message, @source)
|
539
|
+
end
|
540
|
+
end
|
541
|
+
|
542
|
+
def parse_id_invalid_details(accept_external_id:,
|
543
|
+
accept_public_id:)
|
544
|
+
public = /\A\s*PUBLIC/um
|
545
|
+
system = /\A\s*SYSTEM/um
|
546
|
+
if (accept_external_id or accept_public_id) and @source.match(/#{public}/um)
|
547
|
+
if @source.match(/#{public}(?:\s+[^'"]|\s*[\[>])/um)
|
548
|
+
return "public ID literal is missing"
|
549
|
+
end
|
550
|
+
unless @source.match(/#{public}\s+#{PUBIDLITERAL}/um)
|
551
|
+
return "invalid public ID literal"
|
552
|
+
end
|
553
|
+
if accept_public_id
|
554
|
+
if @source.match(/#{public}\s+#{PUBIDLITERAL}\s+[^'"]/um)
|
555
|
+
return "system ID literal is missing"
|
556
|
+
end
|
557
|
+
unless @source.match(/#{public}\s+#{PUBIDLITERAL}\s+#{SYSTEMLITERAL}/um)
|
558
|
+
return "invalid system literal"
|
559
|
+
end
|
560
|
+
"garbage after system literal"
|
561
|
+
else
|
562
|
+
"garbage after public ID literal"
|
563
|
+
end
|
564
|
+
elsif accept_external_id and @source.match(/#{system}/um)
|
565
|
+
if @source.match(/#{system}(?:\s+[^'"]|\s*[\[>])/um)
|
566
|
+
return "system literal is missing"
|
567
|
+
end
|
568
|
+
unless @source.match(/#{system}\s+#{SYSTEMLITERAL}/um)
|
569
|
+
return "invalid system literal"
|
570
|
+
end
|
571
|
+
"garbage after system literal"
|
572
|
+
else
|
573
|
+
unless @source.match(/\A\s*(?:PUBLIC|SYSTEM)\s/um)
|
574
|
+
return "invalid ID type"
|
575
|
+
end
|
576
|
+
"ID type is missing"
|
577
|
+
end
|
578
|
+
end
|
579
|
+
|
580
|
+
def process_instruction
|
581
|
+
match_data = @source.match(INSTRUCTION_PATTERN, true)
|
582
|
+
unless match_data
|
583
|
+
message = "Invalid processing instruction node"
|
584
|
+
raise REXML::ParseException.new(message, @source)
|
585
|
+
end
|
586
|
+
[:processing_instruction, match_data[1], match_data[2]]
|
587
|
+
end
|
588
|
+
|
589
|
+
def parse_attributes(prefixes, curr_ns)
|
590
|
+
attributes = {}
|
591
|
+
closed = false
|
592
|
+
match_data = @source.match(/^(.*?)(\/)?>/um, true)
|
593
|
+
if match_data.nil?
|
594
|
+
message = "Start tag isn't ended"
|
595
|
+
raise REXML::ParseException.new(message, @source)
|
596
|
+
end
|
597
|
+
|
598
|
+
raw_attributes = match_data[1]
|
599
|
+
closed = !match_data[2].nil?
|
600
|
+
return attributes, closed if raw_attributes.nil?
|
601
|
+
return attributes, closed if raw_attributes.empty?
|
602
|
+
|
603
|
+
scanner = StringScanner.new(raw_attributes)
|
604
|
+
until scanner.eos?
|
605
|
+
if scanner.scan(/\s+/)
|
606
|
+
break if scanner.eos?
|
607
|
+
end
|
608
|
+
|
609
|
+
pos = scanner.pos
|
610
|
+
loop do
|
611
|
+
break if scanner.scan(ATTRIBUTE_PATTERN)
|
612
|
+
unless scanner.scan(QNAME)
|
613
|
+
message = "Invalid attribute name: <#{scanner.rest}>"
|
614
|
+
raise REXML::ParseException.new(message, @source)
|
615
|
+
end
|
616
|
+
name = scanner[0]
|
617
|
+
unless scanner.scan(/\s*=\s*/um)
|
618
|
+
message = "Missing attribute equal: <#{name}>"
|
619
|
+
raise REXML::ParseException.new(message, @source)
|
620
|
+
end
|
621
|
+
quote = scanner.scan(/['"]/)
|
622
|
+
unless quote
|
623
|
+
message = "Missing attribute value start quote: <#{name}>"
|
624
|
+
raise REXML::ParseException.new(message, @source)
|
625
|
+
end
|
626
|
+
unless scanner.scan(/.*#{Regexp.escape(quote)}/um)
|
627
|
+
match_data = @source.match(/^(.*?)(\/)?>/um, true)
|
628
|
+
if match_data
|
629
|
+
scanner << "/" if closed
|
630
|
+
scanner << ">"
|
631
|
+
scanner << match_data[1]
|
632
|
+
scanner.pos = pos
|
633
|
+
closed = !match_data[2].nil?
|
634
|
+
next
|
635
|
+
end
|
636
|
+
message =
|
637
|
+
"Missing attribute value end quote: <#{name}>: <#{quote}>"
|
638
|
+
raise REXML::ParseException.new(message, @source)
|
639
|
+
end
|
640
|
+
end
|
641
|
+
name = scanner[1]
|
642
|
+
prefix = scanner[2]
|
643
|
+
local_part = scanner[3]
|
644
|
+
# quote = scanner[4]
|
645
|
+
value = scanner[5]
|
646
|
+
if prefix == "xmlns"
|
647
|
+
if local_part == "xml"
|
648
|
+
if value != "http://www.w3.org/XML/1998/namespace"
|
649
|
+
msg = "The 'xml' prefix must not be bound to any other namespace "+
|
650
|
+
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
651
|
+
raise REXML::ParseException.new( msg, @source, self )
|
652
|
+
end
|
653
|
+
elsif local_part == "xmlns"
|
654
|
+
msg = "The 'xmlns' prefix must not be declared "+
|
655
|
+
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
656
|
+
raise REXML::ParseException.new( msg, @source, self)
|
657
|
+
end
|
658
|
+
curr_ns << local_part
|
659
|
+
elsif prefix
|
660
|
+
prefixes << prefix unless prefix == "xml"
|
661
|
+
end
|
662
|
+
|
663
|
+
if attributes.has_key?(name)
|
664
|
+
msg = "Duplicate attribute #{name.inspect}"
|
665
|
+
raise REXML::ParseException.new(msg, @source, self)
|
666
|
+
end
|
667
|
+
|
668
|
+
attributes[name] = value
|
669
|
+
end
|
670
|
+
return attributes, closed
|
671
|
+
end
|
672
|
+
end
|
673
|
+
end
|
674
|
+
end
|
675
|
+
|
676
|
+
=begin
|
677
|
+
case event[0]
|
678
|
+
when :start_element
|
679
|
+
when :text
|
680
|
+
when :end_element
|
681
|
+
when :processing_instruction
|
682
|
+
when :cdata
|
683
|
+
when :comment
|
684
|
+
when :xmldecl
|
685
|
+
when :start_doctype
|
686
|
+
when :end_doctype
|
687
|
+
when :externalentity
|
688
|
+
when :elementdecl
|
689
|
+
when :entity
|
690
|
+
when :attlistdecl
|
691
|
+
when :notationdecl
|
692
|
+
when :end_doctype
|
693
|
+
end
|
694
|
+
=end
|