brakeman 4.6.1 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of brakeman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +11 -0
- data/bundle/load.rb +7 -7
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/CHANGELOG.md +122 -4
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/FAQ.md +4 -14
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/Gemfile +19 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/MIT-LICENSE +2 -2
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/README.md +80 -42
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/REFERENCE.md +121 -64
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/TODO +24 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/haml.gemspec +44 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml.rb +2 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_builder.rb +164 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_compiler.rb +224 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_parser.rb +150 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/buffer.rb +25 -132
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/compiler.rb +330 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/engine.rb +34 -41
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/error.rb +65 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/escapable.rb +50 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/exec.rb +38 -20
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/filters.rb +22 -27
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/generator.rb +42 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers.rb +129 -90
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_extensions.rb +4 -2
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_mods.rb +45 -60
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_xss_mods.rb +2 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubi_template.rb +20 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/safe_erubis_template.rb +5 -1
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/xss_mods.rb +19 -12
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/options.rb +63 -69
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/parser.rb +292 -228
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/plugin.rb +37 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/railtie.rb +48 -0
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/sass_rails_filter.rb +18 -4
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/template.rb +13 -6
- data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/template/options.rb +13 -2
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/temple_engine.rb +123 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/temple_line_counter.rb +30 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/util.rb +258 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/version.rb +5 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/yard/default/fulldoc/html/css/common.sass +15 -0
- data/bundle/ruby/2.6.0/gems/haml-5.1.2/yard/default/layout/html/footer.erb +12 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/AUTHORS +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/COPYING +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/Changelog.md +3 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/Gemfile +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/LICENSE +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/README.md +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/TODO +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/appveyor.yml +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/highline.gemspec +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/builtin_styles.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/color_scheme.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/compatibility.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/custom_errors.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/import.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/io_console_compatible.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/list.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/list_renderer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/menu.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/menu/item.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/paginator.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question/answer_converter.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question_asker.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/simulate.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/statement.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/string.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/string_extensions.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/style.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/template_renderer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/io_console.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/ncurses.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/unix_stty.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/version.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/wrapper.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/History.rdoc +6 -0
- data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/Manifest.txt +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/README.rdoc +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/lib/ruby2ruby.rb +3 -3
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/History.rdoc +38 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/Manifest.txt +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/README.rdoc +3 -3
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/compare/normalize.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/debugging.md +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/rp_extensions.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby20_parser.rb +7045 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1/lib/ruby_parser.yy → ruby_parser-3.14.0/lib/ruby20_parser.y} +390 -397
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby21_parser.rb +7116 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby21_parser.y +399 -254
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby22_parser.rb +7149 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby22_parser.y +400 -255
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby23_parser.rb +7166 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby23_parser.y +400 -255
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby24_parser.rb +7178 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby24_parser.y +404 -257
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby25_parser.rb +7178 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby25_parser.y +404 -257
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby26_parser.rb +7198 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby26_parser.y +410 -261
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rb +424 -432
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rex +0 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rex.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_parser.rb +27 -27
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby_parser.yy +2732 -0
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_parser_extras.rb +627 -406
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/tools/munge.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/tools/ripper.rb +13 -2
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/History.rdoc +13 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/Manifest.txt +1 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/README.rdoc +0 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/pt_testcase.rb +0 -0
- data/bundle/ruby/2.6.0/gems/sexp_processor-4.13.0/lib/sexp.rb +381 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1/lib/sexp.rb → sexp_processor-4.13.0/lib/sexp_matcher.rb} +25 -385
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/strict_sexp.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/unique.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/CHANGES +5 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/EXPRESSIONS.md +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/Gemfile +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/LICENSE +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/README.md +1 -1
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/string_splitter.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generator.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/map.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/dispatcher.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/static_analyzer.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates/rails.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/utils.rb +0 -0
- data/bundle/ruby/2.6.0/gems/temple-0.8.2/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/temple.gemspec +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/COPYING +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt.rb +1 -1
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/commonmarker.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/pandoc.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rst-pandoc.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/string.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/template.rb +7 -12
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/yajl.rb +0 -0
- data/lib/brakeman/checks/base_check.rb +23 -1
- data/lib/brakeman/checks/check_cookie_serialization.rb +1 -1
- data/lib/brakeman/checks/check_cross_site_scripting.rb +1 -1
- data/lib/brakeman/checks/check_execute.rb +26 -1
- data/lib/brakeman/differ.rb +16 -28
- data/lib/brakeman/parsers/haml_embedded.rb +1 -1
- data/lib/brakeman/parsers/template_parser.rb +3 -1
- data/lib/brakeman/processors/alias_processor.rb +10 -0
- data/lib/brakeman/processors/base_processor.rb +2 -0
- data/lib/brakeman/processors/haml_template_processor.rb +86 -122
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +1 -1
- data/lib/brakeman/processors/template_alias_processor.rb +28 -0
- data/lib/brakeman/tracker/config.rb +33 -92
- data/lib/brakeman/version.rb +1 -1
- metadata +215 -206
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/compiler.rb +0 -540
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/error.rb +0 -61
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/railtie.rb +0 -22
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +0 -41
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/util.rb +0 -377
- data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/version.rb +0 -3
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.rb +0 -6869
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.y +0 -2431
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby21_parser.rb +0 -6944
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby22_parser.rb +0 -6968
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby23_parser.rb +0 -6987
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby24_parser.rb +0 -6994
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby25_parser.rb +0 -6994
- data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby26_parser.rb +0 -7012
- data/bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.6.0/gems/tilt-2.0.9/CHANGELOG.md +0 -132
- data/bundle/ruby/2.6.0/gems/tilt-2.0.9/Gemfile +0 -70
- data/bundle/ruby/2.6.0/gems/tilt-2.0.9/HACKING +0 -16
- data/bundle/ruby/2.6.0/gems/tilt-2.0.9/README.md +0 -233
- data/bundle/ruby/2.6.0/gems/tilt-2.0.9/tilt.gemspec +0 -130
@@ -151,7 +151,7 @@ ARGF.each_line do |line|
|
|
151
151
|
next if last_token == token
|
152
152
|
puts "next token is %p (%p)" % [token, last_token]
|
153
153
|
last_token = token
|
154
|
-
when /^Next token is token (
|
154
|
+
when /^Next token is token ("[^"]+"|\S+)/ then
|
155
155
|
token = munge $1
|
156
156
|
next if last_token == token
|
157
157
|
puts "next token is %p (%p)" % [token, last_token]
|
@@ -11,14 +11,25 @@ if ARGV.empty? then
|
|
11
11
|
ARGV << "-"
|
12
12
|
end
|
13
13
|
|
14
|
+
class MySexpBuilder < Ripper::SexpBuilderPP
|
15
|
+
def on_parse_error msg
|
16
|
+
Kernel.warn msg
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
14
20
|
ARGV.each do |path|
|
15
21
|
src = path == "-" ? $stdin.read : File.read(path)
|
16
|
-
rip =
|
22
|
+
rip = MySexpBuilder.new src
|
17
23
|
rip.yydebug = $d
|
18
24
|
|
19
25
|
sexp = rip.parse
|
20
26
|
|
21
|
-
|
27
|
+
if rip.error? then
|
28
|
+
warn "skipping"
|
29
|
+
next
|
30
|
+
end
|
31
|
+
|
32
|
+
puts "accept"
|
22
33
|
|
23
34
|
if $p then
|
24
35
|
pp sexp
|
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 4.13.0 / 2019-09-24
|
2
|
+
|
3
|
+
* 4 minor enhancements:
|
4
|
+
|
5
|
+
* Added Sexp.q (query) and deprecated Sexp.s to distinguish better and match inspect output.
|
6
|
+
* Extended Sexp::Matcher::Parser to allow `not?` patterns.
|
7
|
+
* Extended Sexp::Matcher::Parser to cover more method names.
|
8
|
+
* Split out all pattern-oriented code to sexp_matcher.rb.
|
9
|
+
|
10
|
+
* 1 bug fix:
|
11
|
+
|
12
|
+
* Fixed bug w/ ruby's Array#eql? and #hash not looking at ivars.
|
13
|
+
|
1
14
|
=== 4.12.1 / 2019-06-03
|
2
15
|
|
3
16
|
* 1 minor enhancement:
|
File without changes
|
File without changes
|
data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/pt_testcase.rb
RENAMED
File without changes
|
@@ -0,0 +1,381 @@
|
|
1
|
+
$TESTING ||= false # unless defined $TESTING
|
2
|
+
|
3
|
+
##
|
4
|
+
# Sexps are the basic storage mechanism of SexpProcessor. Sexps have
|
5
|
+
# a +type+ (to be renamed +node_type+) which is the first element of
|
6
|
+
# the Sexp. The type is used by SexpProcessor to determine whom to
|
7
|
+
# dispatch the Sexp to for processing.
|
8
|
+
|
9
|
+
class Sexp < Array # ZenTest FULL
|
10
|
+
##
|
11
|
+
# A setter for the line this sexp was found on. Usually set by ruby_parser.
|
12
|
+
|
13
|
+
attr_writer :line
|
14
|
+
|
15
|
+
##
|
16
|
+
# Accessors for the file. Usually set by ruby_parser.
|
17
|
+
|
18
|
+
attr_accessor :file
|
19
|
+
|
20
|
+
##
|
21
|
+
# Optional comments above/aside this sexp. Usually set by ruby_parser.
|
22
|
+
|
23
|
+
attr_accessor :comments
|
24
|
+
|
25
|
+
@@array_types = [ :array, :args ] # TODO: remove
|
26
|
+
|
27
|
+
##
|
28
|
+
# Create a new Sexp containing +args+.
|
29
|
+
|
30
|
+
def initialize *args
|
31
|
+
super(args)
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# Creates a new Sexp from Array +a+.
|
36
|
+
|
37
|
+
def self.from_array a
|
38
|
+
ary = Array === a ? a : [a]
|
39
|
+
|
40
|
+
self.new.concat(ary.map { |x|
|
41
|
+
case x
|
42
|
+
when Sexp
|
43
|
+
x
|
44
|
+
when Array
|
45
|
+
self.from_array(x)
|
46
|
+
else
|
47
|
+
x
|
48
|
+
end
|
49
|
+
})
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Creates a new sexp with the new contents of +body+, but with the
|
54
|
+
# same +file+, +line+, and +comment+ as self.
|
55
|
+
|
56
|
+
def new(*body)
|
57
|
+
r = self.class.new.concat(body) # ensures a sexp from map
|
58
|
+
r.file = self.file if self.file
|
59
|
+
r.line = self.line if self.line
|
60
|
+
r.comments = self.comments if self.comments
|
61
|
+
r
|
62
|
+
end
|
63
|
+
|
64
|
+
def map &blk # :nodoc:
|
65
|
+
self.new.concat(super(&blk)) # ensures a sexp from map
|
66
|
+
end
|
67
|
+
|
68
|
+
def == obj # :nodoc:
|
69
|
+
obj.class == self.class and super # only because of a bug in ruby
|
70
|
+
end
|
71
|
+
|
72
|
+
def eql? o
|
73
|
+
self.class == o.class && super
|
74
|
+
end
|
75
|
+
|
76
|
+
def hash
|
77
|
+
[self.class, *self].hash
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Returns true if the node_type is +array+ or +args+.
|
82
|
+
#
|
83
|
+
# REFACTOR: to TypedSexp - we only care when we have units.
|
84
|
+
|
85
|
+
def array_type?
|
86
|
+
warn "DEPRECATED: please file an issue if you actually use this. from #{caller.first}"
|
87
|
+
type = self.sexp_type
|
88
|
+
@@array_types.include? type
|
89
|
+
end
|
90
|
+
|
91
|
+
def compact # :nodoc:
|
92
|
+
self.delete_if(&:nil?)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Recursively enumerates the sexp yielding to +block+ for every element.
|
97
|
+
#
|
98
|
+
# Returning :skip will stop traversing that subtree:
|
99
|
+
#
|
100
|
+
# sexp.deep_each do |s|
|
101
|
+
# next :skip if s.sexp_type == :if
|
102
|
+
# # ...
|
103
|
+
# end
|
104
|
+
|
105
|
+
def deep_each &block
|
106
|
+
return enum_for(:deep_each) unless block_given?
|
107
|
+
|
108
|
+
self.each_sexp do |sexp|
|
109
|
+
next if block[sexp] == :skip
|
110
|
+
sexp.deep_each(&block)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Return the maximum depth of the sexp. One-based.
|
116
|
+
|
117
|
+
def depth
|
118
|
+
1 + (each_sexp.map(&:depth).max || 0)
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Enumeratates the sexp yielding to +b+ when the node_type == +t+.
|
123
|
+
|
124
|
+
def each_of_type t, &b
|
125
|
+
return enum_for(:each_of_type) unless block_given?
|
126
|
+
|
127
|
+
each_sexp do | sexp |
|
128
|
+
sexp.each_of_type(t, &b)
|
129
|
+
yield sexp if sexp.sexp_type == t
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
##
|
134
|
+
# Recursively enumerates all sub-sexps skipping non-Sexp elements.
|
135
|
+
|
136
|
+
def each_sexp
|
137
|
+
return enum_for(:each_sexp) unless block_given?
|
138
|
+
|
139
|
+
self.each do |sexp|
|
140
|
+
next unless Sexp === sexp
|
141
|
+
|
142
|
+
yield sexp
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# Replaces all elements whose node_type is +from+ with +to+. Used
|
148
|
+
# only for the most trivial of rewrites.
|
149
|
+
|
150
|
+
def find_and_replace_all from, to
|
151
|
+
each_with_index do | elem, index |
|
152
|
+
if Sexp === elem then
|
153
|
+
elem.find_and_replace_all(from, to)
|
154
|
+
elsif elem == from
|
155
|
+
self[index] = to
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Replaces all Sexps matching +pattern+ with Sexp +repl+.
|
162
|
+
|
163
|
+
def gsub pattern, repl
|
164
|
+
return repl if pattern == self
|
165
|
+
|
166
|
+
new = self.map { |subset|
|
167
|
+
case subset
|
168
|
+
when Sexp then
|
169
|
+
if Matcher === pattern && pattern.satisfy?(subset) then # TODO: make === be satisfy? maybe?
|
170
|
+
repl.dup rescue repl
|
171
|
+
else
|
172
|
+
subset.gsub pattern, repl
|
173
|
+
end
|
174
|
+
else
|
175
|
+
subset
|
176
|
+
end
|
177
|
+
}
|
178
|
+
|
179
|
+
Sexp.from_array new
|
180
|
+
end
|
181
|
+
|
182
|
+
def inspect # :nodoc:
|
183
|
+
sexp_str = self.map(&:inspect).join ", "
|
184
|
+
if ENV["VERBOSE"] && line then
|
185
|
+
"s(#{sexp_str}).line(#{line})"
|
186
|
+
else
|
187
|
+
"s(#{sexp_str})"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def find_node name, delete = false # :nodoc:
|
192
|
+
matches = find_nodes name
|
193
|
+
|
194
|
+
case matches.size
|
195
|
+
when 0 then
|
196
|
+
nil
|
197
|
+
when 1 then
|
198
|
+
match = matches.first
|
199
|
+
delete match if delete
|
200
|
+
match
|
201
|
+
else
|
202
|
+
raise NoMethodError, "multiple nodes for #{name} were found in #{inspect}"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# Find every node with type +name+.
|
208
|
+
|
209
|
+
def find_nodes name
|
210
|
+
each_sexp.find_all { |sexp| sexp.sexp_type == name }
|
211
|
+
end
|
212
|
+
|
213
|
+
UNASSIGNED = Object.new
|
214
|
+
|
215
|
+
##
|
216
|
+
# If passed a line number, sets the line and returns self. Otherwise
|
217
|
+
# returns the line number. This allows you to do message cascades
|
218
|
+
# and still get the sexp back.
|
219
|
+
|
220
|
+
def line n = UNASSIGNED
|
221
|
+
if n != UNASSIGNED then
|
222
|
+
raise ArgumentError, "setting %p.line %p" % [self, n] unless Integer === n
|
223
|
+
@line = n
|
224
|
+
self
|
225
|
+
else
|
226
|
+
@line ||= nil
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# Returns the maximum line number of the children of self.
|
232
|
+
|
233
|
+
def line_max
|
234
|
+
@line_max ||= self.deep_each.map(&:line).max
|
235
|
+
end
|
236
|
+
|
237
|
+
##
|
238
|
+
# Returns the size of the sexp, flattened.
|
239
|
+
|
240
|
+
def mass
|
241
|
+
@mass ||= inject(1) { |t, s| Sexp === s ? t + s.mass : t }
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# Returns the node named +node+, deleting it if +delete+ is true.
|
246
|
+
|
247
|
+
def method_missing meth, delete = false
|
248
|
+
r = find_node meth, delete
|
249
|
+
if ENV["DEBUG"] then
|
250
|
+
if r.nil? then
|
251
|
+
warn "%p.method_missing(%p) => nil from %s" % [self, meth, caller.first]
|
252
|
+
elsif ENV["VERBOSE"]
|
253
|
+
warn "%p.method_missing(%p) from %s" % [self, meth, caller.first]
|
254
|
+
end
|
255
|
+
end
|
256
|
+
r
|
257
|
+
end
|
258
|
+
|
259
|
+
def respond_to? msg, private = false # :nodoc:
|
260
|
+
# why do I need this? Because ruby 2.0 is broken. That's why.
|
261
|
+
super
|
262
|
+
end
|
263
|
+
|
264
|
+
def pretty_print q # :nodoc:
|
265
|
+
nnd = ")"
|
266
|
+
nnd << ".line(#{line})" if line && ENV["VERBOSE"]
|
267
|
+
|
268
|
+
q.group(1, "s(", nnd) do
|
269
|
+
q.seplist(self) {|v| q.pp v }
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Returns the node type of the Sexp.
|
275
|
+
|
276
|
+
def sexp_type
|
277
|
+
first
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Sets the node type of the Sexp.
|
282
|
+
|
283
|
+
def sexp_type= v
|
284
|
+
self[0] = v
|
285
|
+
end
|
286
|
+
|
287
|
+
##
|
288
|
+
# Returns the Sexp body (starting at +from+, defaulting to 1), ie
|
289
|
+
# the values without the node type.
|
290
|
+
|
291
|
+
def sexp_body from = 1
|
292
|
+
self.new.concat(self[from..-1] || [])
|
293
|
+
end
|
294
|
+
|
295
|
+
##
|
296
|
+
# Returns the Sexp body, ie the values without the node type.
|
297
|
+
|
298
|
+
def sexp_body= v
|
299
|
+
self[1..-1] = v
|
300
|
+
end
|
301
|
+
|
302
|
+
alias :head :sexp_type
|
303
|
+
alias :rest :sexp_body
|
304
|
+
|
305
|
+
##
|
306
|
+
# If run with debug, Sexp will raise if you shift on an empty
|
307
|
+
# Sexp. Helps with debugging.
|
308
|
+
|
309
|
+
def shift
|
310
|
+
raise "I'm empty" if self.empty?
|
311
|
+
super
|
312
|
+
end if ($DEBUG or $TESTING)
|
313
|
+
|
314
|
+
##
|
315
|
+
# Returns the bare bones structure of the sexp.
|
316
|
+
# s(:a, :b, s(:c, :d), :e) => s(:a, s(:c))
|
317
|
+
|
318
|
+
def structure
|
319
|
+
if Array === self.sexp_type then
|
320
|
+
warn "NOTE: form s(s(:subsexp)).structure is deprecated. Removing in 5.0"
|
321
|
+
s(:bogus, *self).structure # TODO: remove >= 4.2.0
|
322
|
+
else
|
323
|
+
s(self.sexp_type, *each_sexp.map(&:structure))
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
##
|
328
|
+
# Replaces the Sexp matching +pattern+ with +repl+.
|
329
|
+
|
330
|
+
def sub pattern, repl
|
331
|
+
return repl.dup if pattern == self
|
332
|
+
return repl.dup if Matcher === pattern && pattern.satisfy?(self)
|
333
|
+
|
334
|
+
done = false
|
335
|
+
|
336
|
+
new = self.map do |subset|
|
337
|
+
if done then
|
338
|
+
subset
|
339
|
+
else
|
340
|
+
case subset
|
341
|
+
when Sexp then
|
342
|
+
if pattern == subset then
|
343
|
+
done = true
|
344
|
+
repl.dup rescue repl
|
345
|
+
elsif Matcher === pattern && pattern.satisfy?(subset) then
|
346
|
+
done = true
|
347
|
+
repl.dup rescue repl
|
348
|
+
else
|
349
|
+
subset.sub pattern, repl
|
350
|
+
end
|
351
|
+
else
|
352
|
+
subset
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
Sexp.from_array new
|
358
|
+
end
|
359
|
+
|
360
|
+
def to_a # :nodoc:
|
361
|
+
self.map { |o| Sexp === o ? o.to_a : o }
|
362
|
+
end
|
363
|
+
|
364
|
+
alias to_s inspect # :nodoc:
|
365
|
+
end
|
366
|
+
|
367
|
+
##
|
368
|
+
# This is a very important shortcut to make using Sexps much more awesome.
|
369
|
+
#
|
370
|
+
# In its normal form +s(...)+, creates a Sexp instance. If passed a
|
371
|
+
# block, it creates a Sexp::Matcher using the factory methods on Sexp.
|
372
|
+
#
|
373
|
+
# See Matcher and other factory class methods on Sexp.
|
374
|
+
|
375
|
+
def s *args, &blk
|
376
|
+
return Sexp.class_eval(&blk) if blk
|
377
|
+
Sexp.new(*args)
|
378
|
+
end
|
379
|
+
|
380
|
+
require "sexp_matcher" unless defined? Sexp::Matcher
|
381
|
+
require "strict_sexp" if ENV["STRICT_SEXP"].to_i > 0
|