brakeman 6.1.2 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +14 -0
- data/README.md +5 -1
- data/bundle/load.rb +16 -13
- data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/Changelog.md +4 -0
- data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/highline.gemspec +4 -1
- data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/terminal.rb +2 -2
- data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/version.rb +1 -1
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/README.md +46 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/Makefile +270 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.c +1838 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.o +0 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.so +0 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/extconf.rb +43 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/win32_vk.inc +1391 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/lib/io/console/size.rb +23 -0
- data/bundle/ruby/3.1.0/gems/io-console-0.7.2/lib/io/console.so +0 -0
- data/bundle/ruby/3.1.0/gems/parallel-1.26.3/lib/parallel/version.rb +4 -0
- data/bundle/ruby/{3.3.0/gems/parallel-1.24.0 → 3.1.0/gems/parallel-1.26.3}/lib/parallel.rb +51 -19
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/BSDL +22 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/COPYING +56 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/README.md +94 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/config.rb +382 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/face.rb +199 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/history.rb +76 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io/ansi.rb +364 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io/dumb.rb +106 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io/windows.rb +503 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/io.rb +41 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor/base.rb +31 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor/composite.rb +17 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor/emacs.rb +517 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor/vi_command.rb +518 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor/vi_insert.rb +517 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_actor.rb +8 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/key_stroke.rb +109 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/kill_ring.rb +125 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/line_editor.rb +2557 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/terminfo.rb +158 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/unicode/east_asian_width.rb +1196 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/unicode.rb +696 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/version.rb +3 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline.rb +516 -0
- data/bundle/ruby/3.1.0/gems/reline-0.5.9/license_of_rb-readline +25 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.3.6/LICENSE.txt +22 -0
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/NEWS.md +306 -0
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/element.rb +16 -31
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/entity.rb +5 -47
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/formatters/pretty.rb +1 -1
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/functions.rb +1 -2
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/node.rb +8 -4
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parseexception.rb +1 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.3.6/lib/rexml/parsers/baseparser.rb +852 -0
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/pullparser.rb +4 -0
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/sax2parser.rb +6 -19
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/streamparser.rb +8 -10
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/treeparser.rb +9 -21
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/rexml.rb +1 -1
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/source.rb +128 -98
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/text.rb +34 -14
- data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/xpath_parser.rb +7 -3
- data/bundle/ruby/{3.3.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.1}/History.rdoc +22 -0
- data/bundle/ruby/{3.3.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.1}/lib/ruby2ruby.rb +162 -26
- data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/History.rdoc +6 -0
- data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/sexp_matcher.rb +1 -1
- data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/CHANGES +44 -8
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/Gemfile +43 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/LICENSE +1 -1
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/README.jp.md +28 -41
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/README.md +66 -43
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/code_attributes.rb +2 -1
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/command.rb +2 -8
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/controls.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/do_inserter.rb +4 -3
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/embedded.rb +17 -17
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/end_inserter.rb +3 -2
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/engine.rb +3 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/erb_converter.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/filter.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/grammar.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/include.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/interpolation.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/logic_less/context.rb +6 -7
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/logic_less/filter.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/logic_less.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/parser.rb +26 -39
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/railtie.rb +19 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/smart/escaper.rb +1 -1
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/smart/filter.rb +3 -2
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/smart/parser.rb +4 -3
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/smart.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/splat/builder.rb +16 -8
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/splat/filter.rb +6 -4
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/template.rb +6 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/translator.rb +4 -3
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim/version.rb +2 -1
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/lib/slim.rb +2 -0
- data/bundle/ruby/{3.3.0/gems/slim-4.1.0 → 3.1.0/gems/slim-5.2.1}/slim.gemspec +14 -5
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/COPYING +56 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/LICENSE.txt +22 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/Makefile +268 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/extconf.rb +10 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.c +1741 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.o +0 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.so +0 -0
- data/bundle/ruby/3.1.0/gems/strscan-3.1.0/lib/strscan.so +0 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/CHANGES +39 -1
- data/bundle/ruby/3.1.0/gems/temple-0.10.3/Gemfile +2 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/README.md +1 -1
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/engine.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/erb/engine.rb +3 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/erb/parser.rb +2 -1
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/erb/template.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/erb/trimming.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/exceptions.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filter.rb +1 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/ambles.rb +22 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/code_merger.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/control_flow.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/dynamic_inliner.rb +2 -1
- data/bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/filters/dynamic_merger.rb +69 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/encoding.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/eraser.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/escapable.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/multi_flattener.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/remove_bom.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/static_analyzer.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/static_merger.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/string_splitter.rb +13 -1
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/filters/validator.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generator.rb +5 -2
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generators/array.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generators/array_buffer.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generators/erb.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generators/rails_output_buffer.rb +4 -4
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/generators/string_buffer.rb +2 -1
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/grammar.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/attribute_merger.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/attribute_remover.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/attribute_sorter.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/dispatcher.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/fast.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/filter.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/pretty.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/html/safe.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/map.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/mixins/dispatcher.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/mixins/engine_dsl.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/mixins/grammar_dsl.rb +4 -2
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/mixins/options.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/mixins/template.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/parser.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/static_analyzer.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/templates/rails.rb +7 -2
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/templates/tilt.rb +2 -9
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/templates.rb +1 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple/utils.rb +5 -15
- data/bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/version.rb +4 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/lib/temple.rb +3 -0
- data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/temple.gemspec +4 -6
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/COPYING +1 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/_emacs_org.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/_handlebars.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/_jbuilder.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/_org.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/asciidoc.rb +15 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/babel.rb +8 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/builder.rb +42 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/cli.rb +134 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/coffee.rb +39 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/commonmarker.rb +95 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/creole.rb +14 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/csv.rb +6 -18
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/erb.rb +23 -21
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erubi.rb +55 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/erubis.rb +19 -11
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/etanni.rb +5 -4
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/haml.rb +94 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/kramdown.rb +13 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/liquid.rb +10 -14
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/livescript.rb +11 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/mapping.rb +228 -109
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/markaby.rb +5 -7
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/maruku.rb +10 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/nokogiri.rb +11 -10
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pandoc.rb +39 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/plain.rb +5 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/prawn.rb +28 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/radius.rb +41 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rdiscount.rb +23 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rdoc.rb +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/redcarpet.rb +31 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/redcloth.rb +13 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rst-pandoc.rb +10 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/sass.rb +78 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/slim.rb +5 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/string.rb +9 -3
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/template.rb +229 -82
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/typescript.rb +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/wikicloth.rb +12 -0
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt/yajl.rb +5 -11
- data/bundle/ruby/{3.3.0/gems/tilt-2.0.11 → 3.1.0/gems/tilt-2.4.0}/lib/tilt.rb +60 -40
- data/lib/brakeman/app_tree.rb +20 -5
- data/lib/brakeman/checks/check_session_settings.rb +1 -1
- data/lib/brakeman/checks/check_unscoped_find.rb +1 -1
- data/lib/brakeman/file_parser.rb +34 -2
- data/lib/brakeman/options.rb +34 -4
- data/lib/brakeman/parsers/erubis_patch.rb +11 -0
- data/lib/brakeman/parsers/rails2_erubis.rb +3 -0
- data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +4 -0
- data/lib/brakeman/parsers/rails3_erubis.rb +5 -1
- data/lib/brakeman/parsers/slim_embedded.rb +2 -0
- data/lib/brakeman/processors/alias_processor.rb +34 -13
- data/lib/brakeman/report/report_markdown.rb +1 -1
- data/lib/brakeman/report/report_table.rb +2 -2
- data/lib/brakeman/report/report_tabs.rb +0 -1
- data/lib/brakeman/report/report_text.rb +8 -1
- data/lib/brakeman/scanner.rb +2 -2
- data/lib/brakeman/tracker/config.rb +9 -1
- data/lib/brakeman/util.rb +1 -3
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning.rb +1 -1
- data/lib/brakeman.rb +2 -0
- data/lib/ruby_parser/bm_sexp.rb +5 -1
- metadata +422 -372
- data/bundle/ruby/3.3.0/gems/parallel-1.24.0/lib/parallel/version.rb +0 -4
- data/bundle/ruby/3.3.0/gems/rexml-3.2.6/lib/rexml/parsers/baseparser.rb +0 -694
- data/bundle/ruby/3.3.0/gems/slim-4.1.0/Gemfile +0 -70
- data/bundle/ruby/3.3.0/gems/slim-4.1.0/lib/slim/template.rb +0 -19
- data/bundle/ruby/3.3.0/gems/temple-0.8.2/Gemfile +0 -3
- data/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/version.rb +0 -3
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/asciidoc.rb +0 -27
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/babel.rb +0 -16
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/bluecloth.rb +0 -24
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/builder.rb +0 -37
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/coffee.rb +0 -58
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/commonmarker.rb +0 -88
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/creole.rb +0 -25
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/dummy.rb +0 -3
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/erubi.rb +0 -32
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/haml.rb +0 -86
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/kramdown.rb +0 -25
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/less.rb +0 -30
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/livescript.rb +0 -23
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/maruku.rb +0 -22
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/pandoc.rb +0 -57
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/plain.rb +0 -16
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/prawn.rb +0 -43
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/radius.rb +0 -48
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/rdiscount.rb +0 -39
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/rdoc.rb +0 -40
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/redcarpet.rb +0 -86
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/redcloth.rb +0 -23
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/rst-pandoc.rb +0 -23
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/sass.rb +0 -78
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/sigil.rb +0 -34
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/typescript.rb +0 -26
- data/bundle/ruby/3.3.0/gems/tilt-2.0.11/lib/tilt/wikicloth.rb +0 -22
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/README.txt +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/erubis-2.7.0/setup.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/CHANGELOG.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/FAQ.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/Gemfile +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/MIT-LICENSE +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/README.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/REFERENCE.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/TODO +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/haml.gemspec +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/attribute_builder.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/attribute_compiler.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/attribute_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/buffer.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/compiler.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/engine.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/error.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/escapable.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/exec.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/filters.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/generator.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_extensions.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_xss_mods.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/safe_erubi_template.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/safe_erubis_template.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers/xss_mods.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/helpers.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/options.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/plugin.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/railtie.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/sass_rails_filter.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/template/options.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/template.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/temple_engine.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/temple_line_counter.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/util.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml/version.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/lib/haml.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/yard/default/fulldoc/html/css/common.sass +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/haml-5.2.2/yard/default/layout/html/footer.erb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/AUTHORS +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/COPYING +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/Gemfile +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/LICENSE +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/README.md +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/TODO +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/builtin_styles.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/color_scheme.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/compatibility.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/custom_errors.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/import.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/io_console_compatible.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/list.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/list_renderer.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/menu/item.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/menu.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/paginator.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/question/answer_converter.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/question.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/question_asker.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/simulate.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/statement.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/string.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/string_extensions.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/style.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/template_renderer.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/terminal/io_console.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/terminal/ncurses.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/terminal/unix_stty.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline/wrapper.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/highline-3.0.1 → 3.1.0/gems/highline-3.1.0}/lib/highline.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/io-console-0.7.2}/LICENSE.txt +0 -0
- /data/bundle/ruby/{3.3.0/gems/parallel-1.24.0 → 3.1.0/gems/parallel-1.26.3}/MIT-LICENSE.txt +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/README.md +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/attlistdecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/attribute.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/cdata.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/child.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/comment.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/doctype.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/document.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/dtd/attlistdecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/dtd/dtd.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/dtd/elementdecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/dtd/entitydecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/dtd/notationdecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/encoding.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/formatters/default.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/formatters/transitive.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/instruction.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/light/node.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/namespace.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/output.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parent.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/lightparser.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/ultralightparser.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/parsers/xpathparser.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/quickpath.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/sax2listener.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/security.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/streamlistener.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/undefinednamespaceexception.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/validation/relaxng.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/validation/validation.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/validation/validationexception.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/xmldecl.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/xmltokens.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml/xpath.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/rexml-3.2.6 → 3.1.0/gems/rexml-3.3.6}/lib/rexml.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.1}/Manifest.txt +0 -0
- /data/bundle/ruby/{3.3.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.1}/README.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/History.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/Manifest.txt +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/README.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/compare/normalize.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/debugging.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/gauntlet.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/rp_extensions.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/rp_stringscanner.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby20_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby20_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby21_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby21_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby22_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby22_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby23_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby23_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby24_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby24_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby25_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby25_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby26_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby26_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby27_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby27_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby30_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby30_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby31_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby31_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby32_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby32_parser.y +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby3_parser.yy +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_lexer.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_lexer.rex +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_lexer.rex.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_lexer_strings.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_parser.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_parser.yy +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/lib/ruby_parser_extras.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/tools/munge.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/ruby_parser-3.20.3/tools/ripper.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/Manifest.txt +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/README.rdoc +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/composite_sexp_processor.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/pt_testcase.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/sexp.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/strict_sexp.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/sexp_processor-4.17.1 → 3.1.0/gems/sexp_processor-4.17.2}/lib/unique.rb +0 -0
- /data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/EXPRESSIONS.md +0 -0
- /data/bundle/ruby/{3.3.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.3}/LICENSE +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/Manifest +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/MIT-LICENSE.txt +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/README.md +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/index.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -0
- /data/bundle/ruby/{3.3.0 → 3.1.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -0
@@ -0,0 +1,852 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative '../parseexception'
|
3
|
+
require_relative '../undefinednamespaceexception'
|
4
|
+
require_relative '../security'
|
5
|
+
require_relative '../source'
|
6
|
+
require 'set'
|
7
|
+
require "strscan"
|
8
|
+
|
9
|
+
module REXML
|
10
|
+
module Parsers
|
11
|
+
unless [].respond_to?(:tally)
|
12
|
+
module EnumerableTally
|
13
|
+
refine Enumerable do
|
14
|
+
def tally
|
15
|
+
counts = {}
|
16
|
+
each do |item|
|
17
|
+
counts[item] ||= 0
|
18
|
+
counts[item] += 1
|
19
|
+
end
|
20
|
+
counts
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
using EnumerableTally
|
25
|
+
end
|
26
|
+
|
27
|
+
if StringScanner::Version < "3.0.8"
|
28
|
+
module StringScannerCaptures
|
29
|
+
refine StringScanner do
|
30
|
+
def captures
|
31
|
+
values_at(*(1...size))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
using StringScannerCaptures
|
36
|
+
end
|
37
|
+
|
38
|
+
# = Using the Pull Parser
|
39
|
+
# <em>This API is experimental, and subject to change.</em>
|
40
|
+
# parser = PullParser.new( "<a>text<b att='val'/>txet</a>" )
|
41
|
+
# while parser.has_next?
|
42
|
+
# res = parser.next
|
43
|
+
# puts res[1]['att'] if res.start_tag? and res[0] == 'b'
|
44
|
+
# end
|
45
|
+
# See the PullEvent class for information on the content of the results.
|
46
|
+
# The data is identical to the arguments passed for the various events to
|
47
|
+
# the StreamListener API.
|
48
|
+
#
|
49
|
+
# Notice that:
|
50
|
+
# parser = PullParser.new( "<a>BAD DOCUMENT" )
|
51
|
+
# while parser.has_next?
|
52
|
+
# res = parser.next
|
53
|
+
# raise res[1] if res.error?
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# Nat Price gave me some good ideas for the API.
|
57
|
+
class BaseParser
|
58
|
+
LETTER = '[:alpha:]'
|
59
|
+
DIGIT = '[:digit:]'
|
60
|
+
|
61
|
+
COMBININGCHAR = '' # TODO
|
62
|
+
EXTENDER = '' # TODO
|
63
|
+
|
64
|
+
NCNAME_STR= "[#{LETTER}_][-[:alnum:]._#{COMBININGCHAR}#{EXTENDER}]*"
|
65
|
+
QNAME_STR= "(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})"
|
66
|
+
QNAME = /(#{QNAME_STR})/
|
67
|
+
|
68
|
+
# Just for backward compatibility. For example, kramdown uses this.
|
69
|
+
# It's not used in REXML.
|
70
|
+
UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"
|
71
|
+
|
72
|
+
NAMECHAR = '[\-\w\.:]'
|
73
|
+
NAME = "([\\w:]#{NAMECHAR}*)"
|
74
|
+
NMTOKEN = "(?:#{NAMECHAR})+"
|
75
|
+
NMTOKENS = "#{NMTOKEN}(\\s+#{NMTOKEN})*"
|
76
|
+
REFERENCE = "&(?:#{NAME};|#\\d+;|#x[0-9a-fA-F]+;)"
|
77
|
+
REFERENCE_RE = /#{REFERENCE}/
|
78
|
+
|
79
|
+
DOCTYPE_START = /\A\s*<!DOCTYPE\s/um
|
80
|
+
DOCTYPE_END = /\A\s*\]\s*>/um
|
81
|
+
ATTRIBUTE_PATTERN = /\s*(#{QNAME_STR})\s*=\s*(["'])(.*?)\4/um
|
82
|
+
COMMENT_START = /\A<!--/u
|
83
|
+
COMMENT_PATTERN = /<!--(.*?)-->/um
|
84
|
+
CDATA_START = /\A<!\[CDATA\[/u
|
85
|
+
CDATA_END = /\A\s*\]\s*>/um
|
86
|
+
CDATA_PATTERN = /<!\[CDATA\[(.*?)\]\]>/um
|
87
|
+
XMLDECL_START = /\A<\?xml\s/u;
|
88
|
+
XMLDECL_PATTERN = /<\?xml\s+(.*?)\?>/um
|
89
|
+
INSTRUCTION_START = /\A<\?/u
|
90
|
+
INSTRUCTION_PATTERN = /<\?#{NAME}(\s+.*?)?\?>/um
|
91
|
+
TAG_MATCH = /\A<((?>#{QNAME_STR}))/um
|
92
|
+
CLOSE_MATCH = /\A\s*<\/(#{QNAME_STR})\s*>/um
|
93
|
+
|
94
|
+
VERSION = /\bversion\s*=\s*["'](.*?)['"]/um
|
95
|
+
ENCODING = /\bencoding\s*=\s*["'](.*?)['"]/um
|
96
|
+
STANDALONE = /\bstandalone\s*=\s*["'](.*?)['"]/um
|
97
|
+
|
98
|
+
ENTITY_START = /\A\s*<!ENTITY/
|
99
|
+
ELEMENTDECL_START = /\A\s*<!ELEMENT/um
|
100
|
+
ELEMENTDECL_PATTERN = /\A\s*(<!ELEMENT.*?)>/um
|
101
|
+
SYSTEMENTITY = /\A\s*(%.*?;)\s*$/um
|
102
|
+
ENUMERATION = "\\(\\s*#{NMTOKEN}(?:\\s*\\|\\s*#{NMTOKEN})*\\s*\\)"
|
103
|
+
NOTATIONTYPE = "NOTATION\\s+\\(\\s*#{NAME}(?:\\s*\\|\\s*#{NAME})*\\s*\\)"
|
104
|
+
ENUMERATEDTYPE = "(?:(?:#{NOTATIONTYPE})|(?:#{ENUMERATION}))"
|
105
|
+
ATTTYPE = "(CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS|#{ENUMERATEDTYPE})"
|
106
|
+
ATTVALUE = "(?:\"((?:[^<&\"]|#{REFERENCE})*)\")|(?:'((?:[^<&']|#{REFERENCE})*)')"
|
107
|
+
DEFAULTDECL = "(#REQUIRED|#IMPLIED|(?:(#FIXED\\s+)?#{ATTVALUE}))"
|
108
|
+
ATTDEF = "\\s+#{NAME}\\s+#{ATTTYPE}\\s+#{DEFAULTDECL}"
|
109
|
+
ATTDEF_RE = /#{ATTDEF}/
|
110
|
+
ATTLISTDECL_START = /\A\s*<!ATTLIST/um
|
111
|
+
ATTLISTDECL_PATTERN = /\A\s*<!ATTLIST\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
112
|
+
|
113
|
+
TEXT_PATTERN = /\A([^<]*)/um
|
114
|
+
|
115
|
+
# Entity constants
|
116
|
+
PUBIDCHAR = "\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
|
117
|
+
SYSTEMLITERAL = %Q{((?:"[^"]*")|(?:'[^']*'))}
|
118
|
+
PUBIDLITERAL = %Q{("[#{PUBIDCHAR}']*"|'[#{PUBIDCHAR}]*')}
|
119
|
+
EXTERNALID = "(?:(?:(SYSTEM)\\s+#{SYSTEMLITERAL})|(?:(PUBLIC)\\s+#{PUBIDLITERAL}\\s+#{SYSTEMLITERAL}))"
|
120
|
+
NDATADECL = "\\s+NDATA\\s+#{NAME}"
|
121
|
+
PEREFERENCE = "%#{NAME};"
|
122
|
+
ENTITYVALUE = %Q{((?:"(?:[^%&"]|#{PEREFERENCE}|#{REFERENCE})*")|(?:'([^%&']|#{PEREFERENCE}|#{REFERENCE})*'))}
|
123
|
+
PEDEF = "(?:#{ENTITYVALUE}|#{EXTERNALID})"
|
124
|
+
ENTITYDEF = "(?:#{ENTITYVALUE}|(?:#{EXTERNALID}(#{NDATADECL})?))"
|
125
|
+
PEDECL = "<!ENTITY\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
|
126
|
+
GEDECL = "<!ENTITY\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
|
127
|
+
ENTITYDECL = /\s*(?:#{GEDECL})|\s*(?:#{PEDECL})/um
|
128
|
+
|
129
|
+
NOTATIONDECL_START = /\A\s*<!NOTATION/um
|
130
|
+
EXTERNAL_ID_PUBLIC = /\A\s*PUBLIC\s+#{PUBIDLITERAL}\s+#{SYSTEMLITERAL}\s*/um
|
131
|
+
EXTERNAL_ID_SYSTEM = /\A\s*SYSTEM\s+#{SYSTEMLITERAL}\s*/um
|
132
|
+
PUBLIC_ID = /\A\s*PUBLIC\s+#{PUBIDLITERAL}\s*/um
|
133
|
+
|
134
|
+
EREFERENCE = /&(?!#{NAME};)/
|
135
|
+
|
136
|
+
DEFAULT_ENTITIES = {
|
137
|
+
'gt' => [/>/, '>', '>', />/],
|
138
|
+
'lt' => [/</, '<', '<', /</],
|
139
|
+
'quot' => [/"/, '"', '"', /"/],
|
140
|
+
"apos" => [/'/, "'", "'", /'/]
|
141
|
+
}
|
142
|
+
|
143
|
+
module Private
|
144
|
+
PEREFERENCE_PATTERN = /#{PEREFERENCE}/um
|
145
|
+
TAG_PATTERN = /((?>#{QNAME_STR}))\s*/um
|
146
|
+
CLOSE_PATTERN = /(#{QNAME_STR})\s*>/um
|
147
|
+
ATTLISTDECL_END = /\s+#{NAME}(?:#{ATTDEF})*\s*>/um
|
148
|
+
NAME_PATTERN = /#{NAME}/um
|
149
|
+
GEDECL_PATTERN = "\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
|
150
|
+
PEDECL_PATTERN = "\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
|
151
|
+
ENTITYDECL_PATTERN = /(?:#{GEDECL_PATTERN})|(?:#{PEDECL_PATTERN})/um
|
152
|
+
CARRIAGE_RETURN_NEWLINE_PATTERN = /\r\n?/
|
153
|
+
CHARACTER_REFERENCES = /�*((?:\d+)|(?:x[a-fA-F0-9]+));/
|
154
|
+
DEFAULT_ENTITIES_PATTERNS = {}
|
155
|
+
default_entities = ['gt', 'lt', 'quot', 'apos', 'amp']
|
156
|
+
default_entities.each do |term|
|
157
|
+
DEFAULT_ENTITIES_PATTERNS[term] = /&#{term};/
|
158
|
+
end
|
159
|
+
end
|
160
|
+
private_constant :Private
|
161
|
+
|
162
|
+
def initialize( source )
|
163
|
+
self.stream = source
|
164
|
+
@listeners = []
|
165
|
+
@prefixes = Set.new
|
166
|
+
@entity_expansion_count = 0
|
167
|
+
end
|
168
|
+
|
169
|
+
def add_listener( listener )
|
170
|
+
@listeners << listener
|
171
|
+
end
|
172
|
+
|
173
|
+
attr_reader :source
|
174
|
+
attr_reader :entity_expansion_count
|
175
|
+
|
176
|
+
def stream=( source )
|
177
|
+
@source = SourceFactory.create_from( source )
|
178
|
+
@closed = nil
|
179
|
+
@have_root = false
|
180
|
+
@document_status = nil
|
181
|
+
@tags = []
|
182
|
+
@stack = []
|
183
|
+
@entities = []
|
184
|
+
@namespaces = {}
|
185
|
+
@namespaces_restore_stack = []
|
186
|
+
end
|
187
|
+
|
188
|
+
def position
|
189
|
+
if @source.respond_to? :position
|
190
|
+
@source.position
|
191
|
+
else
|
192
|
+
# FIXME
|
193
|
+
0
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns true if there are no more events
|
198
|
+
def empty?
|
199
|
+
return (@source.empty? and @stack.empty?)
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns true if there are more events. Synonymous with !empty?
|
203
|
+
def has_next?
|
204
|
+
return !(@source.empty? and @stack.empty?)
|
205
|
+
end
|
206
|
+
|
207
|
+
# Push an event back on the head of the stream. This method
|
208
|
+
# has (theoretically) infinite depth.
|
209
|
+
def unshift token
|
210
|
+
@stack.unshift(token)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Peek at the +depth+ event in the stack. The first element on the stack
|
214
|
+
# is at depth 0. If +depth+ is -1, will parse to the end of the input
|
215
|
+
# stream and return the last event, which is always :end_document.
|
216
|
+
# Be aware that this causes the stream to be parsed up to the +depth+
|
217
|
+
# event, so you can effectively pre-parse the entire document (pull the
|
218
|
+
# entire thing into memory) using this method.
|
219
|
+
def peek depth=0
|
220
|
+
raise %Q[Illegal argument "#{depth}"] if depth < -1
|
221
|
+
temp = []
|
222
|
+
if depth == -1
|
223
|
+
temp.push(pull()) until empty?
|
224
|
+
else
|
225
|
+
while @stack.size+temp.size < depth+1
|
226
|
+
temp.push(pull())
|
227
|
+
end
|
228
|
+
end
|
229
|
+
@stack += temp if temp.size > 0
|
230
|
+
@stack[depth]
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns the next event. This is a +PullEvent+ object.
|
234
|
+
def pull
|
235
|
+
@source.drop_parsed_content
|
236
|
+
|
237
|
+
pull_event.tap do |event|
|
238
|
+
@listeners.each do |listener|
|
239
|
+
listener.receive event
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
def pull_event
|
245
|
+
if @closed
|
246
|
+
x, @closed = @closed, nil
|
247
|
+
return [ :end_element, x ]
|
248
|
+
end
|
249
|
+
if empty?
|
250
|
+
if @document_status == :in_doctype
|
251
|
+
raise ParseException.new("Malformed DOCTYPE: unclosed", @source)
|
252
|
+
end
|
253
|
+
unless @tags.empty?
|
254
|
+
path = "/" + @tags.join("/")
|
255
|
+
raise ParseException.new("Missing end tag for '#{path}'", @source)
|
256
|
+
end
|
257
|
+
return [ :end_document ]
|
258
|
+
end
|
259
|
+
return @stack.shift if @stack.size > 0
|
260
|
+
#STDERR.puts @source.encoding
|
261
|
+
#STDERR.puts "BUFFER = #{@source.buffer.inspect}"
|
262
|
+
|
263
|
+
@source.ensure_buffer
|
264
|
+
if @document_status == nil
|
265
|
+
start_position = @source.position
|
266
|
+
if @source.match("<?", true)
|
267
|
+
return process_instruction
|
268
|
+
elsif @source.match("<!", true)
|
269
|
+
if @source.match("--", true)
|
270
|
+
md = @source.match(/(.*?)-->/um, true)
|
271
|
+
if md.nil?
|
272
|
+
raise REXML::ParseException.new("Unclosed comment", @source)
|
273
|
+
end
|
274
|
+
if /--|-\z/.match?(md[1])
|
275
|
+
raise REXML::ParseException.new("Malformed comment", @source)
|
276
|
+
end
|
277
|
+
return [ :comment, md[1] ]
|
278
|
+
elsif @source.match("DOCTYPE", true)
|
279
|
+
base_error_message = "Malformed DOCTYPE"
|
280
|
+
unless @source.match(/\s+/um, true)
|
281
|
+
if @source.match(">")
|
282
|
+
message = "#{base_error_message}: name is missing"
|
283
|
+
else
|
284
|
+
message = "#{base_error_message}: invalid name"
|
285
|
+
end
|
286
|
+
@source.position = start_position
|
287
|
+
raise REXML::ParseException.new(message, @source)
|
288
|
+
end
|
289
|
+
name = parse_name(base_error_message)
|
290
|
+
if @source.match(/\s*\[/um, true)
|
291
|
+
id = [nil, nil, nil]
|
292
|
+
@document_status = :in_doctype
|
293
|
+
elsif @source.match(/\s*>/um, true)
|
294
|
+
id = [nil, nil, nil]
|
295
|
+
@document_status = :after_doctype
|
296
|
+
@source.ensure_buffer
|
297
|
+
else
|
298
|
+
id = parse_id(base_error_message,
|
299
|
+
accept_external_id: true,
|
300
|
+
accept_public_id: false)
|
301
|
+
if id[0] == "SYSTEM"
|
302
|
+
# For backward compatibility
|
303
|
+
id[1], id[2] = id[2], nil
|
304
|
+
end
|
305
|
+
if @source.match(/\s*\[/um, true)
|
306
|
+
@document_status = :in_doctype
|
307
|
+
elsif @source.match(/\s*>/um, true)
|
308
|
+
@document_status = :after_doctype
|
309
|
+
@source.ensure_buffer
|
310
|
+
else
|
311
|
+
message = "#{base_error_message}: garbage after external ID"
|
312
|
+
raise REXML::ParseException.new(message, @source)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
args = [:start_doctype, name, *id]
|
316
|
+
if @document_status == :after_doctype
|
317
|
+
@source.match(/\s*/um, true)
|
318
|
+
@stack << [ :end_doctype ]
|
319
|
+
end
|
320
|
+
return args
|
321
|
+
else
|
322
|
+
message = "Invalid XML"
|
323
|
+
raise REXML::ParseException.new(message, @source)
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
327
|
+
if @document_status == :in_doctype
|
328
|
+
@source.match(/\s*/um, true) # skip spaces
|
329
|
+
start_position = @source.position
|
330
|
+
if @source.match("<!", true)
|
331
|
+
if @source.match("ELEMENT", true)
|
332
|
+
md = @source.match(/(.*?)>/um, true)
|
333
|
+
raise REXML::ParseException.new( "Bad ELEMENT declaration!", @source ) if md.nil?
|
334
|
+
return [ :elementdecl, "<!ELEMENT" + md[1] ]
|
335
|
+
elsif @source.match("ENTITY", true)
|
336
|
+
match_data = @source.match(Private::ENTITYDECL_PATTERN, true)
|
337
|
+
unless match_data
|
338
|
+
raise REXML::ParseException.new("Malformed entity declaration", @source)
|
339
|
+
end
|
340
|
+
match = [:entitydecl, *match_data.captures.compact]
|
341
|
+
ref = false
|
342
|
+
if match[1] == '%'
|
343
|
+
ref = true
|
344
|
+
match.delete_at 1
|
345
|
+
end
|
346
|
+
# Now we have to sort out what kind of entity reference this is
|
347
|
+
if match[2] == 'SYSTEM'
|
348
|
+
# External reference
|
349
|
+
match[3] = match[3][1..-2] # PUBID
|
350
|
+
match.delete_at(4) if match.size > 4 # Chop out NDATA decl
|
351
|
+
# match is [ :entity, name, SYSTEM, pubid(, ndata)? ]
|
352
|
+
elsif match[2] == 'PUBLIC'
|
353
|
+
# External reference
|
354
|
+
match[3] = match[3][1..-2] # PUBID
|
355
|
+
match[4] = match[4][1..-2] # HREF
|
356
|
+
match.delete_at(5) if match.size > 5 # Chop out NDATA decl
|
357
|
+
# match is [ :entity, name, PUBLIC, pubid, href(, ndata)? ]
|
358
|
+
elsif Private::PEREFERENCE_PATTERN.match?(match[2])
|
359
|
+
raise REXML::ParseException.new("Parameter entity references forbidden in internal subset: #{match[2]}", @source)
|
360
|
+
else
|
361
|
+
match[2] = match[2][1..-2]
|
362
|
+
match.pop if match.size == 4
|
363
|
+
# match is [ :entity, name, value ]
|
364
|
+
end
|
365
|
+
match << '%' if ref
|
366
|
+
return match
|
367
|
+
elsif @source.match("ATTLIST", true)
|
368
|
+
md = @source.match(Private::ATTLISTDECL_END, true)
|
369
|
+
raise REXML::ParseException.new( "Bad ATTLIST declaration!", @source ) if md.nil?
|
370
|
+
element = md[1]
|
371
|
+
contents = md[0]
|
372
|
+
|
373
|
+
pairs = {}
|
374
|
+
values = md[0].strip.scan( ATTDEF_RE )
|
375
|
+
values.each do |attdef|
|
376
|
+
unless attdef[3] == "#IMPLIED"
|
377
|
+
attdef.compact!
|
378
|
+
val = attdef[3]
|
379
|
+
val = attdef[4] if val == "#FIXED "
|
380
|
+
pairs[attdef[0]] = val
|
381
|
+
if attdef[0] =~ /^xmlns:(.*)/
|
382
|
+
@namespaces[$1] = val
|
383
|
+
end
|
384
|
+
end
|
385
|
+
end
|
386
|
+
return [ :attlistdecl, element, pairs, contents ]
|
387
|
+
elsif @source.match("NOTATION", true)
|
388
|
+
base_error_message = "Malformed notation declaration"
|
389
|
+
unless @source.match(/\s+/um, true)
|
390
|
+
if @source.match(">")
|
391
|
+
message = "#{base_error_message}: name is missing"
|
392
|
+
else
|
393
|
+
message = "#{base_error_message}: invalid name"
|
394
|
+
end
|
395
|
+
@source.position = start_position
|
396
|
+
raise REXML::ParseException.new(message, @source)
|
397
|
+
end
|
398
|
+
name = parse_name(base_error_message)
|
399
|
+
id = parse_id(base_error_message,
|
400
|
+
accept_external_id: true,
|
401
|
+
accept_public_id: true)
|
402
|
+
unless @source.match(/\s*>/um, true)
|
403
|
+
message = "#{base_error_message}: garbage before end >"
|
404
|
+
raise REXML::ParseException.new(message, @source)
|
405
|
+
end
|
406
|
+
return [:notationdecl, name, *id]
|
407
|
+
elsif md = @source.match(/--(.*?)-->/um, true)
|
408
|
+
case md[1]
|
409
|
+
when /--/, /-\z/
|
410
|
+
raise REXML::ParseException.new("Malformed comment", @source)
|
411
|
+
end
|
412
|
+
return [ :comment, md[1] ] if md
|
413
|
+
end
|
414
|
+
elsif match = @source.match(/(%.*?;)\s*/um, true)
|
415
|
+
return [ :externalentity, match[1] ]
|
416
|
+
elsif @source.match(/\]\s*>/um, true)
|
417
|
+
@document_status = :after_doctype
|
418
|
+
return [ :end_doctype ]
|
419
|
+
end
|
420
|
+
if @document_status == :in_doctype
|
421
|
+
raise ParseException.new("Malformed DOCTYPE: invalid declaration", @source)
|
422
|
+
end
|
423
|
+
end
|
424
|
+
if @document_status == :after_doctype
|
425
|
+
@source.match(/\s*/um, true)
|
426
|
+
end
|
427
|
+
begin
|
428
|
+
start_position = @source.position
|
429
|
+
if @source.match("<", true)
|
430
|
+
# :text's read_until may remain only "<" in buffer. In the
|
431
|
+
# case, buffer is empty here. So we need to fill buffer
|
432
|
+
# here explicitly.
|
433
|
+
@source.ensure_buffer
|
434
|
+
if @source.match("/", true)
|
435
|
+
@namespaces_restore_stack.pop
|
436
|
+
last_tag = @tags.pop
|
437
|
+
md = @source.match(Private::CLOSE_PATTERN, true)
|
438
|
+
if md and !last_tag
|
439
|
+
message = "Unexpected top-level end tag (got '#{md[1]}')"
|
440
|
+
raise REXML::ParseException.new(message, @source)
|
441
|
+
end
|
442
|
+
if md.nil? or last_tag != md[1]
|
443
|
+
message = "Missing end tag for '#{last_tag}'"
|
444
|
+
message += " (got '#{md[1]}')" if md
|
445
|
+
@source.position = start_position if md.nil?
|
446
|
+
raise REXML::ParseException.new(message, @source)
|
447
|
+
end
|
448
|
+
return [ :end_element, last_tag ]
|
449
|
+
elsif @source.match("!", true)
|
450
|
+
md = @source.match(/([^>]*>)/um)
|
451
|
+
#STDERR.puts "SOURCE BUFFER = #{source.buffer}, #{source.buffer.size}"
|
452
|
+
raise REXML::ParseException.new("Malformed node", @source) unless md
|
453
|
+
if md[0][0] == ?-
|
454
|
+
md = @source.match(/--(.*?)-->/um, true)
|
455
|
+
|
456
|
+
if md.nil? || /--|-\z/.match?(md[1])
|
457
|
+
raise REXML::ParseException.new("Malformed comment", @source)
|
458
|
+
end
|
459
|
+
|
460
|
+
return [ :comment, md[1] ]
|
461
|
+
else
|
462
|
+
md = @source.match(/\[CDATA\[(.*?)\]\]>/um, true)
|
463
|
+
return [ :cdata, md[1] ] if md
|
464
|
+
end
|
465
|
+
raise REXML::ParseException.new( "Declarations can only occur "+
|
466
|
+
"in the doctype declaration.", @source)
|
467
|
+
elsif @source.match("?", true)
|
468
|
+
return process_instruction
|
469
|
+
else
|
470
|
+
# Get the next tag
|
471
|
+
md = @source.match(Private::TAG_PATTERN, true)
|
472
|
+
unless md
|
473
|
+
@source.position = start_position
|
474
|
+
raise REXML::ParseException.new("malformed XML: missing tag start", @source)
|
475
|
+
end
|
476
|
+
tag = md[1]
|
477
|
+
@document_status = :in_element
|
478
|
+
@prefixes.clear
|
479
|
+
@prefixes << md[2] if md[2]
|
480
|
+
push_namespaces_restore
|
481
|
+
attributes, closed = parse_attributes(@prefixes)
|
482
|
+
# Verify that all of the prefixes have been defined
|
483
|
+
for prefix in @prefixes
|
484
|
+
unless @namespaces.key?(prefix)
|
485
|
+
raise UndefinedNamespaceException.new(prefix,@source,self)
|
486
|
+
end
|
487
|
+
end
|
488
|
+
|
489
|
+
if closed
|
490
|
+
@closed = tag
|
491
|
+
pop_namespaces_restore
|
492
|
+
else
|
493
|
+
if @tags.empty? and @have_root
|
494
|
+
raise ParseException.new("Malformed XML: Extra tag at the end of the document (got '<#{tag}')", @source)
|
495
|
+
end
|
496
|
+
@tags.push( tag )
|
497
|
+
end
|
498
|
+
@have_root = true
|
499
|
+
return [ :start_element, tag, attributes ]
|
500
|
+
end
|
501
|
+
else
|
502
|
+
text = @source.read_until("<")
|
503
|
+
if text.chomp!("<")
|
504
|
+
@source.position -= "<".bytesize
|
505
|
+
end
|
506
|
+
if @tags.empty?
|
507
|
+
unless /\A\s*\z/.match?(text)
|
508
|
+
if @have_root
|
509
|
+
raise ParseException.new("Malformed XML: Extra content at the end of the document (got '#{text}')", @source)
|
510
|
+
else
|
511
|
+
raise ParseException.new("Malformed XML: Content at the start of the document (got '#{text}')", @source)
|
512
|
+
end
|
513
|
+
end
|
514
|
+
return pull_event if @have_root
|
515
|
+
end
|
516
|
+
return [ :text, text ]
|
517
|
+
end
|
518
|
+
rescue REXML::UndefinedNamespaceException
|
519
|
+
raise
|
520
|
+
rescue REXML::ParseException
|
521
|
+
raise
|
522
|
+
rescue => error
|
523
|
+
raise REXML::ParseException.new( "Exception parsing",
|
524
|
+
@source, self, (error ? error : $!) )
|
525
|
+
end
|
526
|
+
return [ :dummy ]
|
527
|
+
end
|
528
|
+
private :pull_event
|
529
|
+
|
530
|
+
def entity( reference, entities )
|
531
|
+
return unless entities
|
532
|
+
|
533
|
+
value = entities[ reference ]
|
534
|
+
return if value.nil?
|
535
|
+
|
536
|
+
record_entity_expansion
|
537
|
+
unnormalize( value, entities )
|
538
|
+
end
|
539
|
+
|
540
|
+
# Escapes all possible entities
|
541
|
+
def normalize( input, entities=nil, entity_filter=nil )
|
542
|
+
copy = input.clone
|
543
|
+
# Doing it like this rather than in a loop improves the speed
|
544
|
+
copy.gsub!( EREFERENCE, '&' )
|
545
|
+
entities.each do |key, value|
|
546
|
+
copy.gsub!( value, "&#{key};" ) unless entity_filter and
|
547
|
+
entity_filter.include?(entity)
|
548
|
+
end if entities
|
549
|
+
copy.gsub!( EREFERENCE, '&' )
|
550
|
+
DEFAULT_ENTITIES.each do |key, value|
|
551
|
+
copy.gsub!( value[3], value[1] )
|
552
|
+
end
|
553
|
+
copy
|
554
|
+
end
|
555
|
+
|
556
|
+
# Unescapes all possible entities
|
557
|
+
def unnormalize( string, entities=nil, filter=nil )
|
558
|
+
if string.include?("\r")
|
559
|
+
rv = string.gsub( Private::CARRIAGE_RETURN_NEWLINE_PATTERN, "\n" )
|
560
|
+
else
|
561
|
+
rv = string.dup
|
562
|
+
end
|
563
|
+
matches = rv.scan( REFERENCE_RE )
|
564
|
+
return rv if matches.size == 0
|
565
|
+
rv.gsub!( Private::CHARACTER_REFERENCES ) {
|
566
|
+
m=$1
|
567
|
+
m = "0#{m}" if m[0] == ?x
|
568
|
+
[Integer(m)].pack('U*')
|
569
|
+
}
|
570
|
+
matches.collect!{|x|x[0]}.compact!
|
571
|
+
if filter
|
572
|
+
matches.reject! do |entity_reference|
|
573
|
+
filter.include?(entity_reference)
|
574
|
+
end
|
575
|
+
end
|
576
|
+
if matches.size > 0
|
577
|
+
matches.tally.each do |entity_reference, n|
|
578
|
+
entity_expansion_count_before = @entity_expansion_count
|
579
|
+
entity_value = entity( entity_reference, entities )
|
580
|
+
if entity_value
|
581
|
+
if n > 1
|
582
|
+
entity_expansion_count_delta =
|
583
|
+
@entity_expansion_count - entity_expansion_count_before
|
584
|
+
record_entity_expansion(entity_expansion_count_delta * (n - 1))
|
585
|
+
end
|
586
|
+
re = Private::DEFAULT_ENTITIES_PATTERNS[entity_reference] || /&#{entity_reference};/
|
587
|
+
rv.gsub!( re, entity_value )
|
588
|
+
if rv.bytesize > Security.entity_expansion_text_limit
|
589
|
+
raise "entity expansion has grown too large"
|
590
|
+
end
|
591
|
+
else
|
592
|
+
er = DEFAULT_ENTITIES[entity_reference]
|
593
|
+
rv.gsub!( er[0], er[2] ) if er
|
594
|
+
end
|
595
|
+
end
|
596
|
+
rv.gsub!( Private::DEFAULT_ENTITIES_PATTERNS['amp'], '&' )
|
597
|
+
end
|
598
|
+
rv
|
599
|
+
end
|
600
|
+
|
601
|
+
private
|
602
|
+
def add_namespace(prefix, uri)
|
603
|
+
@namespaces_restore_stack.last[prefix] = @namespaces[prefix]
|
604
|
+
if uri.nil?
|
605
|
+
@namespaces.delete(prefix)
|
606
|
+
else
|
607
|
+
@namespaces[prefix] = uri
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
def push_namespaces_restore
|
612
|
+
namespaces_restore = {}
|
613
|
+
@namespaces_restore_stack.push(namespaces_restore)
|
614
|
+
namespaces_restore
|
615
|
+
end
|
616
|
+
|
617
|
+
def pop_namespaces_restore
|
618
|
+
namespaces_restore = @namespaces_restore_stack.pop
|
619
|
+
namespaces_restore.each do |prefix, uri|
|
620
|
+
if uri.nil?
|
621
|
+
@namespaces.delete(prefix)
|
622
|
+
else
|
623
|
+
@namespaces[prefix] = uri
|
624
|
+
end
|
625
|
+
end
|
626
|
+
end
|
627
|
+
|
628
|
+
def record_entity_expansion(delta=1)
|
629
|
+
@entity_expansion_count += delta
|
630
|
+
if @entity_expansion_count > Security.entity_expansion_limit
|
631
|
+
raise "number of entity expansions exceeded, processing aborted."
|
632
|
+
end
|
633
|
+
end
|
634
|
+
|
635
|
+
def need_source_encoding_update?(xml_declaration_encoding)
|
636
|
+
return false if xml_declaration_encoding.nil?
|
637
|
+
return false if /\AUTF-16\z/i =~ xml_declaration_encoding
|
638
|
+
true
|
639
|
+
end
|
640
|
+
|
641
|
+
def parse_name(base_error_message)
|
642
|
+
md = @source.match(Private::NAME_PATTERN, true)
|
643
|
+
unless md
|
644
|
+
if @source.match(/\S/um)
|
645
|
+
message = "#{base_error_message}: invalid name"
|
646
|
+
else
|
647
|
+
message = "#{base_error_message}: name is missing"
|
648
|
+
end
|
649
|
+
raise REXML::ParseException.new(message, @source)
|
650
|
+
end
|
651
|
+
md[0]
|
652
|
+
end
|
653
|
+
|
654
|
+
def parse_id(base_error_message,
|
655
|
+
accept_external_id:,
|
656
|
+
accept_public_id:)
|
657
|
+
if accept_external_id and (md = @source.match(EXTERNAL_ID_PUBLIC, true))
|
658
|
+
pubid = system = nil
|
659
|
+
pubid_literal = md[1]
|
660
|
+
pubid = pubid_literal[1..-2] if pubid_literal # Remove quote
|
661
|
+
system_literal = md[2]
|
662
|
+
system = system_literal[1..-2] if system_literal # Remove quote
|
663
|
+
["PUBLIC", pubid, system]
|
664
|
+
elsif accept_public_id and (md = @source.match(PUBLIC_ID, true))
|
665
|
+
pubid = system = nil
|
666
|
+
pubid_literal = md[1]
|
667
|
+
pubid = pubid_literal[1..-2] if pubid_literal # Remove quote
|
668
|
+
["PUBLIC", pubid, nil]
|
669
|
+
elsif accept_external_id and (md = @source.match(EXTERNAL_ID_SYSTEM, true))
|
670
|
+
system = nil
|
671
|
+
system_literal = md[1]
|
672
|
+
system = system_literal[1..-2] if system_literal # Remove quote
|
673
|
+
["SYSTEM", nil, system]
|
674
|
+
else
|
675
|
+
details = parse_id_invalid_details(accept_external_id: accept_external_id,
|
676
|
+
accept_public_id: accept_public_id)
|
677
|
+
message = "#{base_error_message}: #{details}"
|
678
|
+
raise REXML::ParseException.new(message, @source)
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
def parse_id_invalid_details(accept_external_id:,
|
683
|
+
accept_public_id:)
|
684
|
+
public = /\A\s*PUBLIC/um
|
685
|
+
system = /\A\s*SYSTEM/um
|
686
|
+
if (accept_external_id or accept_public_id) and @source.match(/#{public}/um)
|
687
|
+
if @source.match(/#{public}(?:\s+[^'"]|\s*[\[>])/um)
|
688
|
+
return "public ID literal is missing"
|
689
|
+
end
|
690
|
+
unless @source.match(/#{public}\s+#{PUBIDLITERAL}/um)
|
691
|
+
return "invalid public ID literal"
|
692
|
+
end
|
693
|
+
if accept_public_id
|
694
|
+
if @source.match(/#{public}\s+#{PUBIDLITERAL}\s+[^'"]/um)
|
695
|
+
return "system ID literal is missing"
|
696
|
+
end
|
697
|
+
unless @source.match(/#{public}\s+#{PUBIDLITERAL}\s+#{SYSTEMLITERAL}/um)
|
698
|
+
return "invalid system literal"
|
699
|
+
end
|
700
|
+
"garbage after system literal"
|
701
|
+
else
|
702
|
+
"garbage after public ID literal"
|
703
|
+
end
|
704
|
+
elsif accept_external_id and @source.match(/#{system}/um)
|
705
|
+
if @source.match(/#{system}(?:\s+[^'"]|\s*[\[>])/um)
|
706
|
+
return "system literal is missing"
|
707
|
+
end
|
708
|
+
unless @source.match(/#{system}\s+#{SYSTEMLITERAL}/um)
|
709
|
+
return "invalid system literal"
|
710
|
+
end
|
711
|
+
"garbage after system literal"
|
712
|
+
else
|
713
|
+
unless @source.match(/\A\s*(?:PUBLIC|SYSTEM)\s/um)
|
714
|
+
return "invalid ID type"
|
715
|
+
end
|
716
|
+
"ID type is missing"
|
717
|
+
end
|
718
|
+
end
|
719
|
+
|
720
|
+
def process_instruction
|
721
|
+
name = parse_name("Malformed XML: Invalid processing instruction node")
|
722
|
+
if @source.match(/\s+/um, true)
|
723
|
+
match_data = @source.match(/(.*?)\?>/um, true)
|
724
|
+
unless match_data
|
725
|
+
raise ParseException.new("Malformed XML: Unclosed processing instruction", @source)
|
726
|
+
end
|
727
|
+
content = match_data[1]
|
728
|
+
else
|
729
|
+
content = nil
|
730
|
+
unless @source.match("?>", true)
|
731
|
+
raise ParseException.new("Malformed XML: Unclosed processing instruction", @source)
|
732
|
+
end
|
733
|
+
end
|
734
|
+
if name == "xml"
|
735
|
+
if @document_status
|
736
|
+
raise ParseException.new("Malformed XML: XML declaration is not at the start", @source)
|
737
|
+
end
|
738
|
+
version = VERSION.match(content)
|
739
|
+
version = version[1] unless version.nil?
|
740
|
+
encoding = ENCODING.match(content)
|
741
|
+
encoding = encoding[1] unless encoding.nil?
|
742
|
+
if need_source_encoding_update?(encoding)
|
743
|
+
@source.encoding = encoding
|
744
|
+
end
|
745
|
+
if encoding.nil? and /\AUTF-16(?:BE|LE)\z/i =~ @source.encoding
|
746
|
+
encoding = "UTF-16"
|
747
|
+
end
|
748
|
+
standalone = STANDALONE.match(content)
|
749
|
+
standalone = standalone[1] unless standalone.nil?
|
750
|
+
return [ :xmldecl, version, encoding, standalone ]
|
751
|
+
end
|
752
|
+
[:processing_instruction, name, content]
|
753
|
+
end
|
754
|
+
|
755
|
+
def parse_attributes(prefixes)
|
756
|
+
attributes = {}
|
757
|
+
expanded_names = {}
|
758
|
+
closed = false
|
759
|
+
while true
|
760
|
+
if @source.match(">", true)
|
761
|
+
return attributes, closed
|
762
|
+
elsif @source.match("/>", true)
|
763
|
+
closed = true
|
764
|
+
return attributes, closed
|
765
|
+
elsif match = @source.match(QNAME, true)
|
766
|
+
name = match[1]
|
767
|
+
prefix = match[2]
|
768
|
+
local_part = match[3]
|
769
|
+
|
770
|
+
unless @source.match(/\s*=\s*/um, true)
|
771
|
+
message = "Missing attribute equal: <#{name}>"
|
772
|
+
raise REXML::ParseException.new(message, @source)
|
773
|
+
end
|
774
|
+
unless match = @source.match(/(['"])/, true)
|
775
|
+
message = "Missing attribute value start quote: <#{name}>"
|
776
|
+
raise REXML::ParseException.new(message, @source)
|
777
|
+
end
|
778
|
+
quote = match[1]
|
779
|
+
start_position = @source.position
|
780
|
+
value = @source.read_until(quote)
|
781
|
+
unless value.chomp!(quote)
|
782
|
+
@source.position = start_position
|
783
|
+
message = "Missing attribute value end quote: <#{name}>: <#{quote}>"
|
784
|
+
raise REXML::ParseException.new(message, @source)
|
785
|
+
end
|
786
|
+
@source.match(/\s*/um, true)
|
787
|
+
if prefix == "xmlns"
|
788
|
+
if local_part == "xml"
|
789
|
+
if value != "http://www.w3.org/XML/1998/namespace"
|
790
|
+
msg = "The 'xml' prefix must not be bound to any other namespace "+
|
791
|
+
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
792
|
+
raise REXML::ParseException.new( msg, @source, self )
|
793
|
+
end
|
794
|
+
elsif local_part == "xmlns"
|
795
|
+
msg = "The 'xmlns' prefix must not be declared "+
|
796
|
+
"(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
|
797
|
+
raise REXML::ParseException.new( msg, @source, self)
|
798
|
+
end
|
799
|
+
add_namespace(local_part, value)
|
800
|
+
elsif prefix
|
801
|
+
prefixes << prefix unless prefix == "xml"
|
802
|
+
end
|
803
|
+
|
804
|
+
if attributes[name]
|
805
|
+
msg = "Duplicate attribute #{name.inspect}"
|
806
|
+
raise REXML::ParseException.new(msg, @source, self)
|
807
|
+
end
|
808
|
+
|
809
|
+
unless prefix == "xmlns"
|
810
|
+
uri = @namespaces[prefix]
|
811
|
+
expanded_name = [uri, local_part]
|
812
|
+
existing_prefix = expanded_names[expanded_name]
|
813
|
+
if existing_prefix
|
814
|
+
message = "Namespace conflict in adding attribute " +
|
815
|
+
"\"#{local_part}\": " +
|
816
|
+
"Prefix \"#{existing_prefix}\" = \"#{uri}\" and " +
|
817
|
+
"prefix \"#{prefix}\" = \"#{uri}\""
|
818
|
+
raise REXML::ParseException.new(message, @source, self)
|
819
|
+
end
|
820
|
+
expanded_names[expanded_name] = prefix
|
821
|
+
end
|
822
|
+
|
823
|
+
attributes[name] = value
|
824
|
+
else
|
825
|
+
message = "Invalid attribute name: <#{@source.buffer.split(%r{[/>\s]}).first}>"
|
826
|
+
raise REXML::ParseException.new(message, @source)
|
827
|
+
end
|
828
|
+
end
|
829
|
+
end
|
830
|
+
end
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
834
|
+
=begin
|
835
|
+
case event[0]
|
836
|
+
when :start_element
|
837
|
+
when :text
|
838
|
+
when :end_element
|
839
|
+
when :processing_instruction
|
840
|
+
when :cdata
|
841
|
+
when :comment
|
842
|
+
when :xmldecl
|
843
|
+
when :start_doctype
|
844
|
+
when :end_doctype
|
845
|
+
when :externalentity
|
846
|
+
when :elementdecl
|
847
|
+
when :entity
|
848
|
+
when :attlistdecl
|
849
|
+
when :notationdecl
|
850
|
+
when :end_doctype
|
851
|
+
end
|
852
|
+
=end
|