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.
Files changed (271) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +48 -0
  3. data/README.md +1 -1
  4. data/bundle/load.rb +7 -7
  5. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/NEWS.md +39 -1
  6. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/README.md +1 -1
  7. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/parser.rb +7 -2
  8. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/row.rb +26 -2
  9. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/version.rb +1 -1
  10. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv.rb +30 -58
  11. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/CHANGELOG +111 -0
  12. data/bundle/ruby/3.2.0/gems/{erubis-2.7.0 → erubi-1.13.1}/MIT-LICENSE +1 -0
  13. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/README.rdoc +151 -0
  14. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_block.rb +91 -0
  15. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_end.rb +58 -0
  16. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi.rb +299 -0
  17. data/bundle/ruby/3.2.0/gems/parallel-1.28.0/lib/parallel/version.rb +4 -0
  18. data/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/lib/parallel.rb +11 -0
  19. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/ansi.rb +6 -4
  20. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/windows.rb +49 -23
  21. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io.rb +8 -2
  22. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/line_editor.rb +49 -21
  23. data/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/version.rb +3 -0
  24. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline.rb +10 -9
  25. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/CHANGES +8 -2
  26. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/Gemfile +5 -2
  27. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/LICENSE +1 -1
  28. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/README.jp.md +10 -12
  29. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/README.md +21 -26
  30. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/embedded.rb +1 -1
  31. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less/context.rb +4 -3
  32. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/splat/builder.rb +18 -19
  33. data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/version.rb +1 -1
  34. data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/CHANGES +8 -0
  35. data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/README.md +1 -1
  36. data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/static_analyzer.rb +1 -1
  37. data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/string_splitter.rb +61 -5
  38. data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/parser_engine.rb +34 -0
  39. data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/static_analyzer.rb +148 -0
  40. data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/version.rb +1 -1
  41. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/COPYING +1 -1
  42. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/asciidoc.rb +12 -5
  43. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/babel.rb +5 -0
  44. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/builder.rb +4 -0
  45. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/coffee.rb +14 -4
  46. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/commonmarker.rb +65 -0
  47. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/csv.rb +63 -0
  48. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/erb.rb +130 -0
  49. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/erubi.rb +41 -8
  50. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/etanni.rb +7 -0
  51. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/haml.rb +67 -1
  52. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/kramdown.rb +59 -0
  53. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/liquid.rb +93 -0
  54. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/livescript.rb +11 -4
  55. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/mapping.rb +8 -8
  56. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/markaby.rb +11 -2
  57. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/nokogiri.rb +13 -2
  58. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/pandoc.rb +81 -0
  59. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/pipeline.rb +6 -1
  60. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/plain.rb +5 -1
  61. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/prawn.rb +17 -6
  62. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/radius.rb +96 -0
  63. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdiscount.rb +82 -0
  64. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdoc.rb +41 -0
  65. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcarpet.rb +73 -0
  66. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcloth.rb +40 -0
  67. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rst-pandoc.rb +33 -0
  68. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/sass.rb +16 -3
  69. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/slim.rb +18 -0
  70. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/string.rb +10 -2
  71. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/template.rb +5 -5
  72. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/typescript.rb +5 -0
  73. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/yajl.rb +91 -0
  74. data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt.rb +1 -2
  75. data/lib/brakeman/app_tree.rb +7 -2
  76. data/lib/brakeman/checks/check_eol_rails.rb +2 -1
  77. data/lib/brakeman/checks/check_eol_ruby.rb +1 -0
  78. data/lib/brakeman/checks/check_execute.rb +23 -19
  79. data/lib/brakeman/checks/check_model_attributes.rb +1 -1
  80. data/lib/brakeman/checks/check_render.rb +1 -27
  81. data/lib/brakeman/checks/check_render_rce.rb +43 -0
  82. data/lib/brakeman/checks/check_session_settings.rb +1 -1
  83. data/lib/brakeman/checks/check_sql.rb +4 -3
  84. data/lib/brakeman/checks.rb +31 -25
  85. data/lib/brakeman/commandline.rb +17 -5
  86. data/lib/brakeman/file_parser.rb +3 -2
  87. data/lib/brakeman/logger.rb +265 -0
  88. data/lib/brakeman/options.rb +6 -11
  89. data/lib/brakeman/parsers/rails_erubi.rb +82 -0
  90. data/lib/brakeman/parsers/template_parser.rb +7 -15
  91. data/lib/brakeman/processor.rb +2 -2
  92. data/lib/brakeman/processors/base_processor.rb +13 -6
  93. data/lib/brakeman/processors/controller_alias_processor.rb +1 -1
  94. data/lib/brakeman/processors/controller_processor.rb +3 -3
  95. data/lib/brakeman/processors/{erubis_template_processor.rb → erubi_template_procesor.rb} +3 -3
  96. data/lib/brakeman/processors/gem_processor.rb +1 -1
  97. data/lib/brakeman/processors/haml_template_processor.rb +3 -1
  98. data/lib/brakeman/processors/lib/rails2_config_processor.rb +4 -3
  99. data/lib/brakeman/processors/lib/rails2_route_processor.rb +1 -1
  100. data/lib/brakeman/processors/lib/rails3_config_processor.rb +10 -1
  101. data/lib/brakeman/processors/lib/render_helper.rb +4 -2
  102. data/lib/brakeman/processors/lib/render_path.rb +1 -1
  103. data/lib/brakeman/processors/model_processor.rb +1 -1
  104. data/lib/brakeman/report/ignore/config.rb +1 -1
  105. data/lib/brakeman/scanner.rb +33 -51
  106. data/lib/brakeman/tracker/collection.rb +12 -2
  107. data/lib/brakeman/tracker/config.rb +17 -13
  108. data/lib/brakeman/tracker/constants.rb +17 -2
  109. data/lib/brakeman/tracker/controller.rb +1 -1
  110. data/lib/brakeman/tracker.rb +7 -15
  111. data/lib/brakeman/version.rb +1 -1
  112. data/lib/brakeman.rb +109 -55
  113. metadata +182 -210
  114. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/CHANGES.txt +0 -828
  115. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/README.txt +0 -102
  116. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/erubis +0 -3468
  117. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -132
  118. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/contrib/inline-require +0 -179
  119. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/context.rb +0 -83
  120. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -357
  121. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -117
  122. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -113
  123. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -110
  124. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -119
  125. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -126
  126. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -95
  127. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -99
  128. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -125
  129. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -114
  130. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -127
  131. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -120
  132. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -723
  133. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/error.rb +0 -23
  134. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -88
  135. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -85
  136. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -47
  137. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -197
  138. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -353
  139. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -9
  140. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/main.rb +0 -516
  141. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -58
  142. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -144
  143. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis/util.rb +0 -22
  144. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/lib/erubis.rb +0 -73
  145. data/bundle/ruby/3.2.0/gems/erubis-2.7.0/setup.rb +0 -1331
  146. data/bundle/ruby/3.2.0/gems/parallel-1.27.0/lib/parallel/version.rb +0 -4
  147. data/bundle/ruby/3.2.0/gems/reline-0.6.3/lib/reline/version.rb +0 -3
  148. data/bundle/ruby/3.2.0/gems/temple-0.10.4/lib/temple/static_analyzer.rb +0 -78
  149. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/creole.rb +0 -16
  150. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/csv.rb +0 -53
  151. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/erb.rb +0 -65
  152. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/kramdown.rb +0 -13
  153. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/liquid.rb +0 -37
  154. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/pandoc.rb +0 -39
  155. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/radius.rb +0 -41
  156. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rdiscount.rb +0 -23
  157. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rdoc.rb +0 -11
  158. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/redcarpet.rb +0 -31
  159. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/redcloth.rb +0 -13
  160. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/rst-pandoc.rb +0 -10
  161. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/slim.rb +0 -5
  162. data/bundle/ruby/3.2.0/gems/tilt-2.6.1/lib/tilt/yajl.rb +0 -81
  163. data/lib/brakeman/parsers/erubis_patch.rb +0 -11
  164. data/lib/brakeman/parsers/rails2_erubis.rb +0 -9
  165. data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +0 -52
  166. data/lib/brakeman/parsers/rails3_erubis.rb +0 -85
  167. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/LICENSE.txt +0 -0
  168. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/core_ext/array.rb +0 -0
  169. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/core_ext/string.rb +0 -0
  170. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/fields_converter.rb +0 -0
  171. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/input_record_separator.rb +0 -0
  172. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/table.rb +0 -0
  173. data/bundle/ruby/3.2.0/gems/{csv-3.3.5 → csv-3.3.6}/lib/csv/writer.rb +0 -0
  174. data/bundle/ruby/3.2.0/gems/{parallel-1.27.0 → parallel-1.28.0}/MIT-LICENSE.txt +0 -0
  175. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/BSDL +0 -0
  176. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/COPYING +0 -0
  177. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/README.md +0 -0
  178. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/config.rb +0 -0
  179. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/face.rb +0 -0
  180. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/history.rb +0 -0
  181. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/dumb.rb +0 -0
  182. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/base.rb +0 -0
  183. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/composite.rb +0 -0
  184. data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/emacs.rb +2 -2
  185. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_command.rb +0 -0
  186. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_insert.rb +0 -0
  187. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor.rb +0 -0
  188. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_stroke.rb +0 -0
  189. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/kill_ring.rb +0 -0
  190. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode/east_asian_width.rb +0 -0
  191. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode.rb +0 -0
  192. /data/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/license_of_rb-readline +0 -0
  193. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/code_attributes.rb +0 -0
  194. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/command.rb +0 -0
  195. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/controls.rb +0 -0
  196. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/do_inserter.rb +0 -0
  197. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/end_inserter.rb +0 -0
  198. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/engine.rb +0 -0
  199. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/erb_converter.rb +0 -0
  200. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/filter.rb +0 -0
  201. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/grammar.rb +0 -0
  202. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/include.rb +0 -0
  203. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/interpolation.rb +0 -0
  204. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less/filter.rb +0 -0
  205. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/logic_less.rb +0 -0
  206. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/parser.rb +0 -0
  207. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/railtie.rb +0 -0
  208. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/escaper.rb +0 -0
  209. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/filter.rb +0 -0
  210. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart/parser.rb +0 -0
  211. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/smart.rb +0 -0
  212. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/splat/filter.rb +0 -0
  213. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/template.rb +0 -0
  214. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim/translator.rb +0 -0
  215. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/lib/slim.rb +0 -0
  216. /data/bundle/ruby/3.2.0/gems/{slim-5.2.1 → slim-5.2.2}/slim.gemspec +0 -0
  217. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/EXPRESSIONS.md +0 -0
  218. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/Gemfile +0 -0
  219. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/LICENSE +0 -0
  220. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/engine.rb +0 -0
  221. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/engine.rb +0 -0
  222. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/parser.rb +0 -0
  223. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/template.rb +0 -0
  224. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/erb/trimming.rb +0 -0
  225. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/exceptions.rb +0 -0
  226. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filter.rb +0 -0
  227. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/ambles.rb +0 -0
  228. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/code_merger.rb +0 -0
  229. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/control_flow.rb +0 -0
  230. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/dynamic_inliner.rb +0 -0
  231. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/dynamic_merger.rb +0 -0
  232. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/encoding.rb +0 -0
  233. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/eraser.rb +0 -0
  234. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/escapable.rb +0 -0
  235. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/multi_flattener.rb +0 -0
  236. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/remove_bom.rb +0 -0
  237. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/static_merger.rb +0 -0
  238. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/filters/validator.rb +0 -0
  239. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generator.rb +0 -0
  240. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/array.rb +0 -0
  241. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/array_buffer.rb +0 -0
  242. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/erb.rb +0 -0
  243. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/rails_output_buffer.rb +0 -0
  244. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/generators/string_buffer.rb +0 -0
  245. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/grammar.rb +0 -0
  246. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_merger.rb +0 -0
  247. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_remover.rb +0 -0
  248. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/attribute_sorter.rb +0 -0
  249. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/dispatcher.rb +0 -0
  250. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/fast.rb +0 -0
  251. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/filter.rb +0 -0
  252. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/pretty.rb +0 -0
  253. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/html/safe.rb +0 -0
  254. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/map.rb +0 -0
  255. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/dispatcher.rb +0 -0
  256. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/engine_dsl.rb +0 -0
  257. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/grammar_dsl.rb +0 -0
  258. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/options.rb +0 -0
  259. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/mixins/template.rb +0 -0
  260. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/parser.rb +0 -0
  261. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates/rails.rb +0 -0
  262. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates/tilt.rb +0 -0
  263. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/templates.rb +0 -0
  264. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple/utils.rb +0 -0
  265. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/lib/temple.rb +0 -0
  266. /data/bundle/ruby/3.2.0/gems/{temple-0.10.4 → temple-0.10.6}/temple.gemspec +0 -0
  267. /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_emacs_org.rb +0 -0
  268. /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_handlebars.rb +0 -0
  269. /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_jbuilder.rb +0 -0
  270. /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/_org.rb +0 -0
  271. /data/bundle/ruby/3.2.0/gems/{tilt-2.6.1 → tilt-2.8.0}/lib/tilt/cli.rb +0 -0
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module Parallel
3
- VERSION = Version = '1.27.0' # rubocop:disable Naming/ConstantName
4
- end
@@ -1,3 +0,0 @@
1
- module Reline
2
- VERSION = '0.6.3'
3
- end
@@ -1,78 +0,0 @@
1
- # frozen_string_literal: true
2
- begin
3
- require 'ripper'
4
- rescue LoadError
5
- end
6
-
7
- module Temple
8
- module StaticAnalyzer
9
- STATIC_TOKENS = [
10
- :on_tstring_beg, :on_tstring_end, :on_tstring_content,
11
- :on_embexpr_beg, :on_embexpr_end,
12
- :on_lbracket, :on_rbracket,
13
- :on_qwords_beg, :on_words_sep, :on_qwords_sep,
14
- :on_lparen, :on_rparen,
15
- :on_lbrace, :on_rbrace, :on_label,
16
- :on_int, :on_float, :on_imaginary,
17
- :on_comma, :on_sp, :on_ignored_nl,
18
- ].freeze
19
-
20
- DYNAMIC_TOKENS = [
21
- :on_ident, :on_period,
22
- ].freeze
23
-
24
- STATIC_KEYWORDS = [
25
- 'true', 'false', 'nil',
26
- ].freeze
27
-
28
- STATIC_OPERATORS = [
29
- '=>',
30
- ].freeze
31
-
32
- class << self
33
- def available?
34
- defined?(Ripper) && Ripper.respond_to?(:lex)
35
- end
36
-
37
- def static?(code)
38
- return false if code.nil? || code.strip.empty?
39
- return false if syntax_error?(code)
40
-
41
- Ripper.lex(code).each do |_, token, str|
42
- case token
43
- when *STATIC_TOKENS
44
- # noop
45
- when :on_kw
46
- return false unless STATIC_KEYWORDS.include?(str)
47
- when :on_op
48
- return false unless STATIC_OPERATORS.include?(str)
49
- when *DYNAMIC_TOKENS
50
- return false
51
- else
52
- return false
53
- end
54
- end
55
- true
56
- end
57
-
58
- def syntax_error?(code)
59
- SyntaxChecker.new(code).parse
60
- false
61
- rescue SyntaxChecker::ParseError
62
- true
63
- end
64
- end
65
-
66
- if defined?(Ripper)
67
- class SyntaxChecker < Ripper
68
- class ParseError < StandardError; end
69
-
70
- private
71
-
72
- def on_parse_error(*)
73
- raise ParseError
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'creole'
4
-
5
- warn 'tilt/creole is deprecated, as creole requires modifying string literals', uplevel: 1
6
-
7
- allowed_opts = [:allowed_schemes, :extensions, :no_escape].freeze
8
-
9
- # Creole implementation. See: http://www.wikicreole.org/
10
- Tilt::CreoleTemplate = Tilt::StaticTemplate.subclass do
11
- opts = {}
12
- allowed_opts.each do |k|
13
- opts[k] = @options[k] if @options[k]
14
- end
15
- Creole::Parser.new(@data, opts).to_html
16
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'csv'
4
-
5
- module Tilt
6
-
7
- # CSV Template implementation. See:
8
- # http://ruby-doc.org/stdlib/libdoc/csv/rdoc/CSV.html
9
- #
10
- # == Example
11
- #
12
- # # Example of csv template
13
- # tpl = <<-EOS
14
- # # header
15
- # csv << ['NAME', 'ID']
16
- #
17
- # # data rows
18
- # @people.each do |person|
19
- # csv << [person[:name], person[:id]]
20
- # end
21
- # EOS
22
- #
23
- # @people = [
24
- # {:name => "Joshua Peek", :id => 1},
25
- # {:name => "Ryan Tomayko", :id => 2},
26
- # {:name => "Simone Carletti", :id => 3}
27
- # ]
28
- #
29
- # template = Tilt::CSVTemplate.new { tpl }
30
- # template.render(self)
31
- #
32
- class CSVTemplate < Template
33
- self.default_mime_type = 'text/csv'
34
-
35
- def prepare
36
- @outvar = @options.delete(:outvar) || '_csvout'
37
- end
38
-
39
- def precompiled_template(locals)
40
- <<-RUBY
41
- #{@outvar} = CSV.generate(**#{@options}) do |csv|
42
- #{@data}
43
- end
44
- RUBY
45
- end
46
-
47
- def precompiled(locals)
48
- source, offset = super
49
- [source, offset + 1]
50
- end
51
-
52
- end
53
- end
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'erb'
4
-
5
- module Tilt
6
- # ERB template implementation. See:
7
- # http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html
8
- class ERBTemplate < Template
9
- SUPPORTS_KVARGS = ::ERB.instance_method(:initialize).parameters.assoc(:key) rescue false
10
-
11
- def prepare
12
- @freeze_string_literals = !!@options[:freeze]
13
- @outvar = @options[:outvar] || '_erbout'
14
- trim = case @options[:trim]
15
- when false
16
- nil
17
- when nil, true
18
- '<>'
19
- else
20
- @options[:trim]
21
- end
22
- @engine = if SUPPORTS_KVARGS
23
- ::ERB.new(@data, trim_mode: trim, eoutvar: @outvar)
24
- # :nocov:
25
- else
26
- ::ERB.new(@data, options[:safe], trim, @outvar)
27
- # :nocov:
28
- end
29
- end
30
-
31
- def precompiled_template(locals)
32
- source = @engine.src
33
- source
34
- end
35
-
36
- def precompiled_preamble(locals)
37
- <<-RUBY
38
- begin
39
- __original_outvar = #{@outvar} if defined?(#{@outvar})
40
- #{super}
41
- RUBY
42
- end
43
-
44
- def precompiled_postamble(locals)
45
- <<-RUBY
46
- #{super}
47
- ensure
48
- #{@outvar} = __original_outvar
49
- end
50
- RUBY
51
- end
52
-
53
- # ERB generates a line to specify the character coding of the generated
54
- # source in 1.9. Account for this in the line offset.
55
- def precompiled(locals)
56
- source, offset = super
57
- [source, offset + 1]
58
- end
59
-
60
- def freeze_string_literals?
61
- @freeze_string_literals
62
- end
63
- end
64
- end
65
-
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'kramdown'
4
-
5
- dumb_quotes = [39, 39, 34, 34].freeze
6
-
7
- # Kramdown Markdown implementation. See: https://kramdown.gettalong.org/
8
- Tilt::KramdownTemplate = Tilt::StaticTemplate.subclass do
9
- # dup as Krawmdown modifies the passed option with map!
10
- @options[:smart_quotes] = dumb_quotes.dup unless @options[:smartypants]
11
-
12
- Kramdown::Document.new(@data, @options).to_html
13
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'liquid'
4
-
5
- module Tilt
6
- # Liquid template implementation. See:
7
- # http://liquidmarkup.org/
8
- #
9
- # Liquid is designed to be a *safe* template system and therefore
10
- # does not provide direct access to execuatable scopes. In order to
11
- # support a +scope+, the +scope+ must be able to represent itself
12
- # as a hash by responding to #to_h. If the +scope+ does not respond
13
- # to #to_h it will be ignored.
14
- #
15
- # LiquidTemplate does not support yield blocks.
16
- class LiquidTemplate < Template
17
- def prepare
18
- @options[:line_numbers] = true unless @options.has_key?(:line_numbers)
19
- @engine = ::Liquid::Template.parse(@data, @options)
20
- end
21
-
22
- def evaluate(scope, locs)
23
- locals = {}
24
- if scope.respond_to?(:to_h)
25
- scope.to_h.each{|k, v| locals[k.to_s] = v}
26
- end
27
- locs.each{|k, v| locals[k.to_s] = v}
28
- locals['yield'] = block_given? ? yield : ''
29
- locals['content'] = locals['yield']
30
- @engine.render(locals)
31
- end
32
-
33
- def allows_script?
34
- false
35
- end
36
- end
37
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'pandoc-ruby'
4
-
5
- # Pandoc markdown implementation. See: http://pandoc.org/
6
- Tilt::PandocTemplate = Tilt::StaticTemplate.subclass do
7
- # turn options hash into an array
8
- # Map tilt options to pandoc options
9
- # Replace hash keys with value true with symbol for key
10
- # Remove hash keys with value false
11
- # Leave other hash keys untouched
12
- pandoc_options = []
13
- from = "markdown"
14
- smart_extension = "-smart"
15
- @options.each do |k,v|
16
- case k
17
- when :smartypants
18
- smart_extension = "+smart" if v
19
- when :escape_html
20
- from = "markdown-raw_html" if v
21
- when :commonmark
22
- from = "commonmark" if v
23
- when :markdown_strict
24
- from = "markdown_strict" if v
25
- else
26
- case v
27
- when true
28
- pandoc_options << k
29
- when false
30
- # do nothing
31
- else
32
- pandoc_options << { k => v }
33
- end
34
- end
35
- end
36
- pandoc_options << { :f => from + smart_extension }
37
-
38
- PandocRuby.new(@data, *pandoc_options).to_html.strip
39
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'radius'
4
-
5
- module Tilt
6
- # Radius Template
7
- # http://github.com/jlong/radius/
8
- class RadiusTemplate < Template
9
- class ContextClass < Radius::Context
10
- attr_accessor :tilt_scope
11
-
12
- def tag_missing(name, attributes)
13
- tilt_scope.__send__(name)
14
- end
15
-
16
- def dup
17
- i = super
18
- i.tilt_scope = tilt_scope
19
- i
20
- end
21
- end
22
-
23
- def evaluate(scope, locals, &block)
24
- context = ContextClass.new
25
- context.tilt_scope = scope
26
- context.define_tag("yield", &block) if block
27
- locals.each do |tag, value|
28
- context.define_tag(tag) do
29
- value
30
- end
31
- end
32
-
33
- @options[:tag_prefix] = 'r' unless @options.has_key?(:tag_prefix)
34
- Radius::Parser.new(context, @options).parse(@data)
35
- end
36
-
37
- def allows_script?
38
- false
39
- end
40
- end
41
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'rdiscount'
4
-
5
- aliases = {
6
- :escape_html => :filter_html,
7
- :smartypants => :smart
8
- }.freeze
9
-
10
- _flags = [:smart, :filter_html, :smartypants, :escape_html].freeze
11
-
12
- # Discount Markdown implementation. See:
13
- # http://github.com/rtomayko/rdiscount
14
- #
15
- # RDiscount is a simple text filter. It does not support +scope+ or
16
- # +locals+. The +:smart+ and +:filter_html+ options may be set true
17
- # to enable those flags on the underlying RDiscount object.
18
- Tilt::RDiscountTemplate = Tilt::StaticTemplate.subclass do
19
- flags = _flags.select { |flag| @options[flag] }.
20
- map! { |flag| aliases[flag] || flag }
21
-
22
- RDiscount.new(@data, *flags).to_html
23
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'rdoc'
4
- require 'rdoc/markup'
5
- require 'rdoc/markup/to_html'
6
- require 'rdoc/options'
7
-
8
- # RDoc template. See: https://github.com/ruby/rdoc
9
- Tilt::RDocTemplate = Tilt::StaticTemplate.subclass do
10
- RDoc::Markup::ToHtml.new(RDoc::Options.new, nil).convert(@data).to_s
11
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'redcarpet'
4
-
5
- aliases = {:escape_html => :filter_html, :smartypants => :smart}.freeze
6
-
7
- Tilt::RedcarpetTemplate = Tilt::StaticTemplate.subclass do
8
- aliases.each do |opt, aka|
9
- if options.key?(aka) || !@options.key?(opt)
10
- @options[opt] = @options.delete(aka)
11
- end
12
- end
13
-
14
- # only raise an exception if someone is trying to enable :escape_html
15
- @options.delete(:escape_html) unless @options[:escape_html]
16
-
17
- renderer = @options.delete(:renderer) || ::Redcarpet::Render::HTML.new(@options)
18
- if options.delete(:smartypants) && !(renderer.is_a?(Class) && renderer <= ::Redcarpet::Render::SmartyPants)
19
- renderer = if renderer == ::Redcarpet::Render::XHTML
20
- ::Redcarpet::Render::SmartyHTML.new(:xhtml => true)
21
- elsif renderer == ::Redcarpet::Render::HTML
22
- ::Redcarpet::Render::SmartyHTML
23
- elsif renderer.is_a? Class
24
- Class.new(renderer) { include ::Redcarpet::Render::SmartyPants }
25
- else
26
- renderer.extend ::Redcarpet::Render::SmartyPants
27
- end
28
- end
29
-
30
- Redcarpet::Markdown.new(renderer, @options).render(@data)
31
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'redcloth'
4
-
5
- # RedCloth implementation. See: https://github.com/jgarber/redcloth
6
- Tilt::RedClothTemplate = Tilt::StaticTemplate.subclass do
7
- engine = RedCloth.new(@data)
8
- @options.each do |k, v|
9
- m = :"#{k}="
10
- engine.send(m, v) if engine.respond_to? m
11
- end
12
- engine.to_html
13
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require_relative 'pandoc'
4
-
5
- rst = {:f => "rst"}.freeze
6
-
7
- # Pandoc reStructuredText implementation. See: # http://pandoc.org/
8
- Tilt::RstPandocTemplate = Tilt::StaticTemplate.subclass do
9
- PandocRuby.new(@data, rst).to_html.strip
10
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'slim'
4
-
5
- Tilt::SlimTemplate = Slim::Template
@@ -1,81 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative 'template'
3
- require 'yajl'
4
-
5
- module Tilt
6
- # Yajl Template implementation
7
- #
8
- # Yajl is a fast JSON parsing and encoding library for Ruby
9
- # See https://github.com/brianmario/yajl-ruby
10
- #
11
- # The template source is evaluated as a Ruby string,
12
- # and the result is converted #to_json.
13
- #
14
- # == Example
15
- #
16
- # # This is a template example.
17
- # # The template can contain any Ruby statement.
18
- # tpl <<-EOS
19
- # @counter = 0
20
- #
21
- # # The json variable represents the buffer
22
- # # and holds the data to be serialized into json.
23
- # # It defaults to an empty hash, but you can override it at any time.
24
- # json = {
25
- # :"user#{@counter += 1}" => { :name => "Joshua Peek", :id => @counter },
26
- # :"user#{@counter += 1}" => { :name => "Ryan Tomayko", :id => @counter },
27
- # :"user#{@counter += 1}" => { :name => "Simone Carletti", :id => @counter },
28
- # }
29
- #
30
- # # Since the json variable is a Hash,
31
- # # you can use conditional statements or any other Ruby statement
32
- # # to populate it.
33
- # json[:"user#{@counter += 1}"] = { :name => "Unknown" } if 1 == 2
34
- #
35
- # # The last line doesn't affect the returned value.
36
- # nil
37
- # EOS
38
- #
39
- # template = Tilt::YajlTemplate.new { tpl }
40
- # template.render(self)
41
- #
42
- class YajlTemplate < Template
43
- self.default_mime_type = 'application/json'
44
-
45
- def evaluate(scope, locals, &block)
46
- decorate(super)
47
- end
48
-
49
- def precompiled_preamble(locals)
50
- return super if locals.include? :json
51
- "json = {}\n#{super}"
52
- end
53
-
54
- def precompiled_postamble(locals)
55
- "Yajl::Encoder.new.encode(json)"
56
- end
57
-
58
- def precompiled_template(locals)
59
- @data.to_str
60
- end
61
-
62
- # Decorates the +json+ input according to given +options+.
63
- #
64
- # json - The json String to decorate.
65
- # options - The option Hash to customize the behavior.
66
- #
67
- # Returns the decorated String.
68
- def decorate(json)
69
- callback, variable = @options[:callback], @options[:variable]
70
- if callback && variable
71
- "var #{variable} = #{json}; #{callback}(#{variable});"
72
- elsif variable
73
- "var #{variable} = #{json};"
74
- elsif callback
75
- "#{callback}(#{json});"
76
- else
77
- json
78
- end
79
- end
80
- end
81
- end
@@ -1,11 +0,0 @@
1
- module Brakeman::ErubisPatch
2
- # Simple patch to make `erubis` compatible with frozen string literals
3
- def convert(input)
4
- codebuf = +"" # Modified line, the rest is identitical
5
- @preamble.nil? ? add_preamble(codebuf) : (@preamble && (codebuf << @preamble))
6
- convert_input(codebuf, input)
7
- @postamble.nil? ? add_postamble(codebuf) : (@postamble && (codebuf << @postamble))
8
- @_proc = nil # clear cached proc object
9
- return codebuf # or codebuf.join()
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- Brakeman.load_brakeman_dependency 'erubis'
2
-
3
- require 'brakeman/parsers/erubis_patch'
4
-
5
- #Erubis processor which ignores any output which is plain text.
6
- class Brakeman::ScannerErubis < Erubis::Eruby
7
- include Erubis::NoTextEnhancer
8
- include Brakeman::ErubisPatch
9
- end
@@ -1,52 +0,0 @@
1
- Brakeman.load_brakeman_dependency 'erubis'
2
-
3
- require 'brakeman/parsers/erubis_patch'
4
-
5
- #This is from the rails_xss plugin for Rails 2
6
- class Brakeman::Rails2XSSPluginErubis < ::Erubis::Eruby
7
- include Brakeman::ErubisPatch
8
-
9
- def add_preamble(src)
10
- #src << "@output_buffer = ActiveSupport::SafeBuffer.new;"
11
- end
12
-
13
- #This is different from rails_xss - fixes some line number issues
14
- def add_text(src, text)
15
- if text == "\n"
16
- src << "\n"
17
- elsif text.include? "\n"
18
- lines = text.split("\n")
19
- if text.match(/\n\z/)
20
- lines.each do |line|
21
- src << "@output_buffer.safe_concat('" << escape_text(line) << "');\n"
22
- end
23
- else
24
- lines[0..-2].each do |line|
25
- src << "@output_buffer.safe_concat('" << escape_text(line) << "');\n"
26
- end
27
-
28
- src << "@output_buffer.safe_concat('" << escape_text(lines.last) << "');"
29
- end
30
- else
31
- src << "@output_buffer.safe_concat('" << escape_text(text) << "');"
32
- end
33
- end
34
-
35
- BLOCK_EXPR = /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/
36
-
37
- def add_expr_literal(src, code)
38
- if code =~ BLOCK_EXPR
39
- src << "@output_buffer.safe_concat((" << $1 << ").to_s);"
40
- else
41
- src << '@output_buffer << ((' << code << ').to_s);'
42
- end
43
- end
44
-
45
- def add_expr_escaped(src, code)
46
- src << '@output_buffer << ' << escaped_expr(code) << ';'
47
- end
48
-
49
- def add_postamble(src)
50
- #src << '@output_buffer.to_s'
51
- end
52
- end