brakeman 7.1.2 → 8.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +48 -0
- data/README.md +1 -1
- data/bundle/load.rb +7 -7
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/NEWS.md +39 -1
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/README.md +1 -1
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/parser.rb +7 -2
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/row.rb +26 -2
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/version.rb +1 -1
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv.rb +30 -58
- data/bundle/ruby/3.2.0/gems/erubi-1.13.1/CHANGELOG +111 -0
- data/bundle/ruby/3.2.0/gems/{erubis-2.7.0 → erubi-1.13.1}/MIT-LICENSE +1 -0
- data/bundle/ruby/3.2.0/gems/erubi-1.13.1/README.rdoc +151 -0
- data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_block.rb +91 -0
- data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_end.rb +58 -0
- data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi.rb +299 -0
- data/bundle/ruby/3.2.0/gems/parallel-1.28.0/lib/parallel/version.rb +4 -0
- data/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/lib/parallel.rb +11 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/ansi.rb +6 -4
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/windows.rb +49 -23
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io.rb +8 -2
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/line_editor.rb +49 -21
- data/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/version.rb +3 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline.rb +10 -9
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/CHANGES +8 -2
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/Gemfile +5 -2
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/LICENSE +1 -1
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/README.jp.md +10 -12
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/README.md +21 -26
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/embedded.rb +1 -1
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less/context.rb +4 -3
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/splat/builder.rb +18 -19
- data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/version.rb +1 -1
- data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/CHANGES +8 -0
- data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/README.md +1 -1
- data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/static_analyzer.rb +1 -1
- data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/string_splitter.rb +61 -5
- data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/parser_engine.rb +34 -0
- data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/static_analyzer.rb +148 -0
- data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/version.rb +1 -1
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/COPYING +1 -1
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/asciidoc.rb +12 -5
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/babel.rb +5 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/builder.rb +4 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/coffee.rb +14 -4
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/commonmarker.rb +65 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/csv.rb +63 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/erb.rb +130 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/erubi.rb +41 -8
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/etanni.rb +7 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/haml.rb +67 -1
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/kramdown.rb +59 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/liquid.rb +93 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/livescript.rb +11 -4
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/mapping.rb +8 -8
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/markaby.rb +11 -2
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/nokogiri.rb +13 -2
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/pandoc.rb +81 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/pipeline.rb +6 -1
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/plain.rb +5 -1
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/prawn.rb +17 -6
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/radius.rb +96 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdiscount.rb +82 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdoc.rb +41 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcarpet.rb +73 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcloth.rb +40 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rst-pandoc.rb +33 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/sass.rb +16 -3
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/slim.rb +18 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/string.rb +10 -2
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/template.rb +5 -5
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/typescript.rb +5 -0
- data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/yajl.rb +91 -0
- data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt.rb +1 -2
- data/lib/brakeman/app_tree.rb +7 -2
- data/lib/brakeman/checks/check_eol_rails.rb +2 -1
- data/lib/brakeman/checks/check_eol_ruby.rb +1 -0
- data/lib/brakeman/checks/check_execute.rb +23 -19
- data/lib/brakeman/checks/check_model_attributes.rb +1 -1
- data/lib/brakeman/checks/check_render.rb +1 -27
- data/lib/brakeman/checks/check_render_rce.rb +43 -0
- data/lib/brakeman/checks/check_session_settings.rb +1 -1
- data/lib/brakeman/checks/check_sql.rb +4 -3
- data/lib/brakeman/checks.rb +31 -25
- data/lib/brakeman/commandline.rb +17 -5
- data/lib/brakeman/file_parser.rb +3 -2
- data/lib/brakeman/logger.rb +265 -0
- data/lib/brakeman/options.rb +6 -11
- data/lib/brakeman/parsers/rails_erubi.rb +82 -0
- data/lib/brakeman/parsers/template_parser.rb +7 -15
- data/lib/brakeman/processor.rb +2 -2
- data/lib/brakeman/processors/base_processor.rb +13 -6
- data/lib/brakeman/processors/controller_alias_processor.rb +1 -1
- data/lib/brakeman/processors/controller_processor.rb +3 -3
- data/lib/brakeman/processors/{erubis_template_processor.rb → erubi_template_procesor.rb} +3 -3
- data/lib/brakeman/processors/gem_processor.rb +1 -1
- data/lib/brakeman/processors/haml_template_processor.rb +3 -1
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +4 -3
- data/lib/brakeman/processors/lib/rails2_route_processor.rb +1 -1
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +10 -1
- data/lib/brakeman/processors/lib/render_helper.rb +4 -2
- data/lib/brakeman/processors/lib/render_path.rb +1 -1
- data/lib/brakeman/processors/model_processor.rb +1 -1
- data/lib/brakeman/report/ignore/config.rb +1 -1
- data/lib/brakeman/scanner.rb +33 -51
- data/lib/brakeman/tracker/collection.rb +12 -2
- data/lib/brakeman/tracker/config.rb +17 -13
- data/lib/brakeman/tracker/constants.rb +17 -2
- data/lib/brakeman/tracker/controller.rb +1 -1
- data/lib/brakeman/tracker.rb +7 -15
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman.rb +109 -55
- metadata +182 -210
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/CHANGES.txt +0 -828
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/README.txt +0 -102
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/erubis +0 -3468
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -132
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/inline-require +0 -179
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/context.rb +0 -83
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -357
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -117
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -113
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -110
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -119
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -126
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -95
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -99
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -125
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -114
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -127
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -120
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -723
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/error.rb +0 -23
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -88
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -85
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -47
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -197
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -353
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -9
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/main.rb +0 -516
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -58
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -144
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/util.rb +0 -22
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis.rb +0 -73
- data/bundle/ruby/3.2.0/gems/erubis-2.7.0/setup.rb +0 -1331
- data/bundle/ruby/3.2.0/gems/parallel-1.27.0/lib/parallel/version.rb +0 -4
- data/bundle/ruby/3.2.0/gems/reline-0.6.3/lib/reline/version.rb +0 -3
- data/bundle/ruby/3.2.0/gems/temple-0.10.4/lib/temple/static_analyzer.rb +0 -78
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/creole.rb +0 -16
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/csv.rb +0 -53
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/erb.rb +0 -65
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/kramdown.rb +0 -13
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/liquid.rb +0 -37
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/pandoc.rb +0 -39
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/radius.rb +0 -41
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rdiscount.rb +0 -23
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rdoc.rb +0 -11
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/redcarpet.rb +0 -31
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/redcloth.rb +0 -13
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rst-pandoc.rb +0 -10
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/slim.rb +0 -5
- data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/yajl.rb +0 -81
- data/lib/brakeman/parsers/erubis_patch.rb +0 -11
- data/lib/brakeman/parsers/rails2_erubis.rb +0 -9
- data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +0 -52
- data/lib/brakeman/parsers/rails3_erubis.rb +0 -85
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/LICENSE.txt +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/core_ext/array.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/core_ext/string.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/fields_converter.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/input_record_separator.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/table.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/writer.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/MIT-LICENSE.txt +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/BSDL +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/COPYING +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/README.md +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/config.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/face.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/history.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/dumb.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/base.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/composite.rb +0 -0
- data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/emacs.rb +2 -2
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_command.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_insert.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_stroke.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/kill_ring.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode/east_asian_width.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/license_of_rb-readline +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/code_attributes.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/command.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/controls.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/do_inserter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/end_inserter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/engine.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/erb_converter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/grammar.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/include.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/interpolation.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/parser.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/railtie.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/escaper.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/parser.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/splat/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/template.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/translator.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/slim.gemspec +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/EXPRESSIONS.md +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/Gemfile +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/LICENSE +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/engine.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/engine.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/parser.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/template.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/trimming.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/exceptions.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/ambles.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/code_merger.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/control_flow.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/dynamic_inliner.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/dynamic_merger.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/encoding.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/eraser.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/escapable.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/multi_flattener.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/remove_bom.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/static_merger.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/validator.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generator.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/array.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/array_buffer.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/erb.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/rails_output_buffer.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/string_buffer.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/grammar.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_merger.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_remover.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_sorter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/dispatcher.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/fast.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/filter.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/pretty.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/safe.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/map.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/dispatcher.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/engine_dsl.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/grammar_dsl.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/options.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/template.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/parser.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates/rails.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates/tilt.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/utils.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/temple.gemspec +0 -0
- /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_emacs_org.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_handlebars.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_jbuilder.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_org.rb +0 -0
- /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/cli.rb +0 -0
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
###
|
|
2
|
-
### $Release: 2.7.0 $
|
|
3
|
-
### copyright(c) 2006-2011 kuwata-lab.com all rights reserved.
|
|
4
|
-
###
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require 'erubis'
|
|
8
|
-
require 'erubis/preprocessing'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
module Erubis
|
|
12
|
-
|
|
13
|
-
class Eruby
|
|
14
|
-
include ErboutEnhancer # will generate '_erbout = _buf = ""; '
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
class FastEruby
|
|
18
|
-
include ErboutEnhancer # will generate '_erbout = _buf = ""; '
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
module Helpers
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
## helper module for Ruby on Rails
|
|
25
|
-
##
|
|
26
|
-
## howto:
|
|
27
|
-
##
|
|
28
|
-
## 1. add the folliwng code in your 'config/environment.rb'
|
|
29
|
-
##
|
|
30
|
-
## require 'erubis/helpers/rails_helper'
|
|
31
|
-
## #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby
|
|
32
|
-
## #Erubis::Helpers::RailsHelper.init_properties = {}
|
|
33
|
-
## #Erubis::Helpers::RailsHelper.show_src = false # set true for debugging
|
|
34
|
-
## #Erubis::Helpers::RailsHelper.preprocessing = true # set true to enable preprocessing
|
|
35
|
-
##
|
|
36
|
-
## 2. restart web server.
|
|
37
|
-
##
|
|
38
|
-
## if Erubis::Helper::Rails.show_src is true, Erubis prints converted Ruby code
|
|
39
|
-
## into log file ('log/development.log' or so). if false, it doesn't.
|
|
40
|
-
## if nil, Erubis prints converted Ruby code if ENV['RAILS_ENV'] == 'development'.
|
|
41
|
-
##
|
|
42
|
-
module RailsHelper
|
|
43
|
-
|
|
44
|
-
#cattr_accessor :init_properties
|
|
45
|
-
@@engine_class = ::Erubis::Eruby
|
|
46
|
-
#@@engine_class = ::Erubis::FastEruby
|
|
47
|
-
def self.engine_class
|
|
48
|
-
@@engine_class
|
|
49
|
-
end
|
|
50
|
-
def self.engine_class=(klass)
|
|
51
|
-
@@engine_class = klass
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
#cattr_accessor :init_properties
|
|
55
|
-
@@init_properties = {}
|
|
56
|
-
def self.init_properties
|
|
57
|
-
@@init_properties
|
|
58
|
-
end
|
|
59
|
-
def self.init_properties=(hash)
|
|
60
|
-
@@init_properties = hash
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
#cattr_accessor :show_src
|
|
64
|
-
@@show_src = nil
|
|
65
|
-
def self.show_src
|
|
66
|
-
@@show_src
|
|
67
|
-
end
|
|
68
|
-
def self.show_src=(flag)
|
|
69
|
-
@@show_src = flag
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
#cattr_accessor :preprocessing
|
|
73
|
-
@@preprocessing = false
|
|
74
|
-
def self.preprocessing
|
|
75
|
-
@@preprocessing
|
|
76
|
-
end
|
|
77
|
-
def self.preprocessing=(flag)
|
|
78
|
-
@@preprocessing = flag
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
## define class for backward-compatibility
|
|
83
|
-
class PreprocessingEruby < Erubis::PreprocessingEruby # :nodoc:
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
module TemplateConverter
|
|
88
|
-
## covert eRuby string into ruby code
|
|
89
|
-
def _convert_template(template) # :nodoc:
|
|
90
|
-
#src = ::Erubis::Eruby.new(template).src
|
|
91
|
-
klass = ::Erubis::Helpers::RailsHelper.engine_class
|
|
92
|
-
properties = ::Erubis::Helpers::RailsHelper.init_properties
|
|
93
|
-
show_src = ::Erubis::Helpers::RailsHelper.show_src
|
|
94
|
-
show_src = ENV['RAILS_ENV'] == 'development' if show_src.nil?
|
|
95
|
-
## preprocessing
|
|
96
|
-
if ::Erubis::Helpers::RailsHelper.preprocessing
|
|
97
|
-
preprocessor = _create_preprocessor(template)
|
|
98
|
-
template = preprocessor.evaluate(_preprocessing_context_object())
|
|
99
|
-
_logger_info "** Erubis: preprocessed==<<'END'\n#{template}END\n" if show_src
|
|
100
|
-
end
|
|
101
|
-
## convert into ruby code
|
|
102
|
-
src = klass.new(template, properties).src
|
|
103
|
-
#src.insert(0, '_erbout = ')
|
|
104
|
-
_logger_info "** Erubis: src==<<'END'\n#{src}END\n" if show_src
|
|
105
|
-
return src
|
|
106
|
-
end
|
|
107
|
-
def _create_preprocessor(template)
|
|
108
|
-
return PreprocessingEruby.new(template, :escape=>true)
|
|
109
|
-
end
|
|
110
|
-
def _preprocessing_context_object
|
|
111
|
-
return self
|
|
112
|
-
end
|
|
113
|
-
def _logger_info(message)
|
|
114
|
-
logger.info message
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
class ActionView::Base # :nodoc:
|
|
126
|
-
include ::Erubis::Helpers::RailsHelper::TemplateConverter
|
|
127
|
-
include ::Erubis::PreprocessingHelper
|
|
128
|
-
private
|
|
129
|
-
# convert template into ruby code
|
|
130
|
-
def convert_template_into_ruby_code(template)
|
|
131
|
-
#ERB.new(template, nil, @@erb_trim_mode).src
|
|
132
|
-
return _convert_template(template)
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
require 'action_pack/version'
|
|
138
|
-
|
|
139
|
-
rails22 = false
|
|
140
|
-
|
|
141
|
-
if ActionPack::VERSION::MAJOR >= 2 ### Rails 2.X
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if ActionPack::VERSION::MINOR >=2 ### Rails 2.2, 2.3 or higher
|
|
145
|
-
|
|
146
|
-
rails22 = true
|
|
147
|
-
module ActionView
|
|
148
|
-
module TemplateHandlers
|
|
149
|
-
class ErubisHandler < TemplateHandler
|
|
150
|
-
include Compilable
|
|
151
|
-
include ::Erubis::Helpers::RailsHelper::TemplateConverter
|
|
152
|
-
include ::Erubis::PreprocessingHelper
|
|
153
|
-
def compile(template)
|
|
154
|
-
#src = ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src
|
|
155
|
-
return _convert_template("<% __in_erb_template=true %>#{template.source}")
|
|
156
|
-
end
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
handler_klass = TemplateHandlers::ErubisHandler
|
|
160
|
-
Template.register_default_template_handler :erb, handler_klass
|
|
161
|
-
Template.register_template_handler :rhtml, handler_klass
|
|
162
|
-
end
|
|
163
|
-
module Erubis::Helpers::RailsHelper::TemplateConverter
|
|
164
|
-
def _logger_info(message)
|
|
165
|
-
#logger.info message # logger.info seems not available in Rails 2.2
|
|
166
|
-
ActionController::Base.new.logger.info message
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
elsif ActionPack::VERSION::MINOR >=1 ### Rails 2.1
|
|
171
|
-
|
|
172
|
-
module ActionView
|
|
173
|
-
module TemplateHandlers # :nodoc:
|
|
174
|
-
class ErubisHandler < TemplateHandler
|
|
175
|
-
include Compilable
|
|
176
|
-
include Erubis::Helpers::RailsHelper::TemplateConverter
|
|
177
|
-
include Erubis::PreprocessingHelper
|
|
178
|
-
#
|
|
179
|
-
def compile(template)
|
|
180
|
-
return _convert_template(template.source) # template.is_a?(ActionView::Template)
|
|
181
|
-
end
|
|
182
|
-
def logger #:nodoc:
|
|
183
|
-
return @view.controller.logger
|
|
184
|
-
end
|
|
185
|
-
def _preprocessing_context_object #:nodoc:
|
|
186
|
-
return @view.controller.instance_variable_get('@template')
|
|
187
|
-
end
|
|
188
|
-
#
|
|
189
|
-
def cache_fragment(block, name = {}, options = nil) #:nodoc:
|
|
190
|
-
@view.fragment_for(block, name, options) do
|
|
191
|
-
#eval(ActionView::Base.erb_variable, block.binding)
|
|
192
|
-
eval('_buf', block.binding)
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
handler_klass = TemplateHandlers::ErubisHandler
|
|
198
|
-
Template.register_default_template_handler :erb, handler_klass
|
|
199
|
-
Template.register_template_handler :rhtml, handler_klass
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
elsif ActionPack::VERSION::TINY >= 2 ### Rails 2.0.X (X >= 2)
|
|
203
|
-
|
|
204
|
-
module ActionView
|
|
205
|
-
module TemplateHandlers # :nodoc:
|
|
206
|
-
class ErubisHandler < TemplateHandler
|
|
207
|
-
include Erubis::Helpers::RailsHelper::TemplateConverter
|
|
208
|
-
include Erubis::PreprocessingHelper
|
|
209
|
-
def compile(template)
|
|
210
|
-
return _convert_template(template) # template.is_a?(String)
|
|
211
|
-
end
|
|
212
|
-
def logger #:nodoc:
|
|
213
|
-
return @view.controller.logger
|
|
214
|
-
end
|
|
215
|
-
def _preprocessing_context_object #:nodoc:
|
|
216
|
-
return @view.controller.instance_variable_get('@template')
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
Base.class_eval do
|
|
221
|
-
handler_klass = TemplateHandlers::ErubisHandler
|
|
222
|
-
register_default_template_handler :erb, handler_klass
|
|
223
|
-
register_template_handler :rhtml, handler_klass
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
else ### Rails 2.0.0 or 2.0.1
|
|
228
|
-
|
|
229
|
-
class ActionView::Base # :nodoc:
|
|
230
|
-
private
|
|
231
|
-
# Method to create the source code for a given template.
|
|
232
|
-
def create_template_source(extension, template, render_symbol, locals)
|
|
233
|
-
if template_requires_setup?(extension)
|
|
234
|
-
body = case extension.to_sym
|
|
235
|
-
when :rxml, :builder
|
|
236
|
-
content_type_handler = (controller.respond_to?(:response) ? "controller.response" : "controller")
|
|
237
|
-
"#{content_type_handler}.content_type ||= Mime::XML\n" +
|
|
238
|
-
"xml = Builder::XmlMarkup.new(:indent => 2)\n" +
|
|
239
|
-
template +
|
|
240
|
-
"\nxml.target!\n"
|
|
241
|
-
when :rjs
|
|
242
|
-
"controller.response.content_type ||= Mime::JS\n" +
|
|
243
|
-
"update_page do |page|\n#{template}\nend"
|
|
244
|
-
end
|
|
245
|
-
else
|
|
246
|
-
#body = ERB.new(template, nil, @@erb_trim_mode).src
|
|
247
|
-
body = convert_template_into_ruby_code(template)
|
|
248
|
-
end
|
|
249
|
-
#
|
|
250
|
-
@@template_args[render_symbol] ||= {}
|
|
251
|
-
locals_keys = @@template_args[render_symbol].keys | locals
|
|
252
|
-
@@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h }
|
|
253
|
-
#
|
|
254
|
-
locals_code = ""
|
|
255
|
-
locals_keys.each do |key|
|
|
256
|
-
locals_code << "#{key} = local_assigns[:#{key}]\n"
|
|
257
|
-
end
|
|
258
|
-
#
|
|
259
|
-
"def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend"
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
end #if
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
else ### Rails 1.X
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if ActionPack::VERSION::MINOR > 12 ### Rails 1.2
|
|
270
|
-
|
|
271
|
-
class ActionView::Base # :nodoc:
|
|
272
|
-
private
|
|
273
|
-
# Create source code for given template
|
|
274
|
-
def create_template_source(extension, template, render_symbol, locals)
|
|
275
|
-
if template_requires_setup?(extension)
|
|
276
|
-
body = case extension.to_sym
|
|
277
|
-
when :rxml
|
|
278
|
-
"controller.response.content_type ||= 'application/xml'\n" +
|
|
279
|
-
"xml = Builder::XmlMarkup.new(:indent => 2)\n" +
|
|
280
|
-
template
|
|
281
|
-
when :rjs
|
|
282
|
-
"controller.response.content_type ||= 'text/javascript'\n" +
|
|
283
|
-
"update_page do |page|\n#{template}\nend"
|
|
284
|
-
end
|
|
285
|
-
else
|
|
286
|
-
#body = ERB.new(template, nil, @@erb_trim_mode).src
|
|
287
|
-
body = convert_template_into_ruby_code(template)
|
|
288
|
-
end
|
|
289
|
-
#
|
|
290
|
-
@@template_args[render_symbol] ||= {}
|
|
291
|
-
locals_keys = @@template_args[render_symbol].keys | locals
|
|
292
|
-
@@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h }
|
|
293
|
-
#
|
|
294
|
-
locals_code = ""
|
|
295
|
-
locals_keys.each do |key|
|
|
296
|
-
locals_code << "#{key} = local_assigns[:#{key}]\n"
|
|
297
|
-
end
|
|
298
|
-
#
|
|
299
|
-
"def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend"
|
|
300
|
-
end
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
else ### Rails 1.1
|
|
304
|
-
|
|
305
|
-
class ActionView::Base # :nodoc:
|
|
306
|
-
private
|
|
307
|
-
# Create source code for given template
|
|
308
|
-
def create_template_source(extension, template, render_symbol, locals)
|
|
309
|
-
if template_requires_setup?(extension)
|
|
310
|
-
body = case extension.to_sym
|
|
311
|
-
when :rxml
|
|
312
|
-
"xml = Builder::XmlMarkup.new(:indent => 2)\n" +
|
|
313
|
-
"@controller.headers['Content-Type'] ||= 'application/xml'\n" +
|
|
314
|
-
template
|
|
315
|
-
when :rjs
|
|
316
|
-
"@controller.headers['Content-Type'] ||= 'text/javascript'\n" +
|
|
317
|
-
"update_page do |page|\n#{template}\nend"
|
|
318
|
-
end
|
|
319
|
-
else
|
|
320
|
-
#body = ERB.new(template, nil, @@erb_trim_mode).src
|
|
321
|
-
body = convert_template_into_ruby_code(template)
|
|
322
|
-
end
|
|
323
|
-
#
|
|
324
|
-
@@template_args[render_symbol] ||= {}
|
|
325
|
-
locals_keys = @@template_args[render_symbol].keys | locals
|
|
326
|
-
@@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h }
|
|
327
|
-
#
|
|
328
|
-
locals_code = ""
|
|
329
|
-
locals_keys.each do |key|
|
|
330
|
-
locals_code << "#{key} = local_assigns[:#{key}] if local_assigns.has_key?(:#{key})\n"
|
|
331
|
-
end
|
|
332
|
-
#
|
|
333
|
-
"def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend"
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
end #if
|
|
338
|
-
|
|
339
|
-
## make h() method faster (only for Rails 1.X)
|
|
340
|
-
module ERB::Util # :nodoc:
|
|
341
|
-
ESCAPE_TABLE = { '&'=>'&', '<'=>'<', '>'=>'>', '"'=>'"', "'"=>''', }
|
|
342
|
-
def h(value)
|
|
343
|
-
value.to_s.gsub(/[&<>"]/) {|s| ESCAPE_TABLE[s] }
|
|
344
|
-
end
|
|
345
|
-
module_function :h
|
|
346
|
-
end
|
|
347
|
-
|
|
348
|
-
end ###
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
## finish
|
|
352
|
-
ActionController::Base.new.logger.info "** Erubis #{::Erubis::VERSION}"
|
|
353
|
-
$stdout.puts "** Erubis #{::Erubis::VERSION}" if rails22
|