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,26 +1,37 @@
1
1
  # frozen_string_literal: true
2
+
3
+ # = Prawn
4
+ #
5
+ # Prawn template implementation.
6
+ #
7
+ # === See also
8
+ #
9
+ # * http://prawnpdf.org
10
+ #
11
+ # === Related module
12
+ #
13
+ # * Tilt::PrawnTemplate
14
+
2
15
  require_relative 'template'
3
16
  require 'prawn'
4
17
 
5
18
  module Tilt
6
- # Prawn template implementation. See: http://prawnpdf.org
7
19
  class PrawnTemplate < Template
8
20
  self.default_mime_type = 'application/pdf'
9
-
21
+
10
22
  def prepare
11
23
  @options[:page_size] = 'A4' unless @options.has_key?(:page_size)
12
24
  @options[:page_layout] = :portrait unless @options.has_key?(:page_layout)
13
- @engine = ::Prawn::Document.new(@options)
14
25
  end
15
-
26
+
16
27
  def evaluate(scope, locals, &block)
17
- pdf = @engine
28
+ pdf = ::Prawn::Document.new(@options)
18
29
  locals = locals.dup
19
30
  locals[:pdf] = pdf
20
31
  super
21
32
  pdf.render
22
33
  end
23
-
34
+
24
35
  def precompiled_template(locals)
25
36
  @data.to_str
26
37
  end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = Radius (<tt>radius</tt>)
4
+ #
5
+ # {Radius}[http://radius.rubyforge.org] is the template language used by {Radiant CMS}[http://radiantcms.org]. It is
6
+ # a tag language designed to be valid XML/HTML.
7
+ #
8
+ # === Example
9
+ #
10
+ # <html>
11
+ # <body>
12
+ # <h1><r:title /></h1>
13
+ # <ul class="<r:type />">
14
+ # <r:repeat times="3">
15
+ # <li><r:hello />!</li>
16
+ # </r:repeat>
17
+ # </ul>
18
+ # <r:yield />
19
+ # </body>
20
+ # </html>
21
+ #
22
+ # === Usage
23
+ #
24
+ # To render a template such as the one above.
25
+ #
26
+ # scope = OpenStruct.new
27
+ # scope.title = "Radius Example"
28
+ # scope.hello = "Hello, World!"
29
+ #
30
+ # require 'radius'
31
+ # template = Tilt::RadiusTemplate.new('example.radius', :tag_prefix=>'r')
32
+ # template.render(scope, :type=>'hlist'){ "Jackpot!" }
33
+ #
34
+ # The result will be:
35
+ #
36
+ # <html>
37
+ # <body>
38
+ # <h1>Radius Example</h1>
39
+ # <ul class="hlist">
40
+ # <li>Hello, World!</li>
41
+ # <li>Hello, World!</li>
42
+ # <li>Hello, World!</li>
43
+ # </ul>
44
+ # Jackpot!
45
+ # </body>
46
+ # </html>
47
+ #
48
+ # === See also
49
+ #
50
+ # * {Radius}[http://radius.rubyforge.org]
51
+ # * {Radiant CMS}[http://radiantcms.org]
52
+ #
53
+ # === Related module
54
+ #
55
+ # * Tilt::RadiusTemplate
56
+
57
+ require_relative 'template'
58
+ require 'radius'
59
+
60
+ module Tilt
61
+ # Radius Template
62
+ # http://github.com/jlong/radius/
63
+ class RadiusTemplate < Template
64
+ class ContextClass < Radius::Context
65
+ attr_accessor :tilt_scope
66
+
67
+ def tag_missing(name, attributes)
68
+ tilt_scope.__send__(name)
69
+ end
70
+
71
+ def dup
72
+ i = super
73
+ i.tilt_scope = tilt_scope
74
+ i
75
+ end
76
+ end
77
+
78
+ def evaluate(scope, locals, &block)
79
+ context = ContextClass.new
80
+ context.tilt_scope = scope
81
+ context.define_tag("yield", &block) if block
82
+ locals.each do |tag, value|
83
+ context.define_tag(tag) do
84
+ value
85
+ end
86
+ end
87
+
88
+ @options[:tag_prefix] = 'r' unless @options.has_key?(:tag_prefix)
89
+ Radius::Parser.new(context, @options).parse(@data)
90
+ end
91
+
92
+ def allows_script?
93
+ false
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = RDiscount (<tt>markdown</tt>, <tt>md</tt>, <tt>mkd</tt>)
4
+ #
5
+ # Markdown is a lightweight markup language, created by John Gruber
6
+ # and Aaron Swartz. For any markup that is not covered by Markdown’s syntax, HTML
7
+ # is used. Marking up plain text with Markdown markup is easy and Markdown
8
+ # formatted texts are readable.
9
+ #
10
+ # RDiscount is a simple text filter. It does not support +scope+ or
11
+ # +locals+. The +:smart+ and +:filter_html+ options may be set true
12
+ # to enable those flags on the underlying RDiscount object.
13
+ #
14
+ # === Example
15
+ #
16
+ # Hello Markdown Templates
17
+ # ========================
18
+ #
19
+ # Hello World. This is a paragraph.
20
+ #
21
+ # === Usage
22
+ #
23
+ # To wrap a Markdown formatted document with a layout:
24
+ #
25
+ # layout = Tilt['erb'].new do
26
+ # "<!doctype html><title></title><%= yield %>"
27
+ # end
28
+ # data = Tilt['md'].new { "# hello tilt" }
29
+ # layout.render { data.render }
30
+ # # => "<!doctype html><title></title><h1>hello tilt</h1>\n"
31
+ #
32
+ # === Options
33
+ #
34
+ # ==== <tt>:smartypants => true|false</tt>
35
+ #
36
+ # Set <tt>true</tt> to enable [Smarty Pants][smartypants] style punctuation replacement.
37
+ #
38
+ # ==== <tt>:escape_html => true|false</tt>
39
+ #
40
+ # Set <tt>true</tt> disallow raw HTML in Markdown contents. HTML is converted to
41
+ # literal text by escaping <tt><</tt> characters.
42
+ #
43
+ # === See also
44
+ #
45
+ # * {Markdown Syntax Documentation}[http://daringfireball.net/projects/markdown/syntax]
46
+ # * [Discount][discount]
47
+ # * {RDiscount}[http://github.com/rtomayko/rdiscount]
48
+ #
49
+ # -----------------------------------
50
+ #
51
+ # [Discount][discount] is an implementation of the Markdown markup language in C.
52
+ # [RDiscount][rdiscount] is a Ruby wrapper around Discount.
53
+ #
54
+ # All the documentation of {Markdown}[#markdown] applies in addition to the following:
55
+ #
56
+ # === Usage
57
+ #
58
+ # The <tt>Tilt::RDiscountTemplate</tt> class is registered for all files ending in
59
+ # <tt>.markdown</tt>, <tt>.md</tt> or <tt>.mkd</tt> by default with the highest priority. If you
60
+ # specifically want to use RDiscount, it's recommended to use <tt>#prefer</tt>:
61
+ #
62
+ # Tilt.prefer Tilt::RDiscountTemplate
63
+ #
64
+ # __NOTE:__ It's suggested that your program <tt>require 'rdiscount'</tt> at load time when
65
+ # using this template engine within a threaded environment.
66
+
67
+ require_relative 'template'
68
+ require 'rdiscount'
69
+
70
+ aliases = {
71
+ :escape_html => :filter_html,
72
+ :smartypants => :smart
73
+ }.freeze
74
+
75
+ _flags = [:smart, :filter_html, :smartypants, :escape_html].freeze
76
+
77
+ Tilt::RDiscountTemplate = Tilt::StaticTemplate.subclass do
78
+ flags = _flags.select { |flag| @options[flag] }.
79
+ map! { |flag| aliases[flag] || flag }
80
+
81
+ RDiscount.new(@data, *flags).to_html
82
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = RDoc (<tt>rdoc</tt>)
4
+ #
5
+ # {RDoc}[http://rdoc.rubyforge.org] is the simple text markup system that comes with Ruby's standard
6
+ # library.
7
+ #
8
+ # === Example
9
+ #
10
+ # = Hello RDoc Templates
11
+ #
12
+ # Hello World. This is a paragraph.
13
+ #
14
+ # === Usage
15
+ #
16
+ # __NOTE:__ It's suggested that your program <tt>require 'rdoc'</tt>,
17
+ # <tt>require 'rdoc/markup'</tt>, and <tt>require 'rdoc/markup/to_html'</tt> at load time
18
+ # when using this template engine in a threaded environment.
19
+ #
20
+ # === See also
21
+ #
22
+ # * {RDoc}[http://rdoc.rubyforge.org]
23
+ # * {RDoc Github}[https://github.com/ruby/rdoc]
24
+
25
+ require_relative 'template'
26
+ require 'rdoc'
27
+ require 'rdoc/markup'
28
+ require 'rdoc/markup/to_html'
29
+ require 'rdoc/options'
30
+
31
+ Tilt::RDocTemplate = if defined?(RDoc::VERSION) && RDoc::VERSION >= "8"
32
+ Tilt::StaticTemplate.subclass do
33
+ RDoc::Markup::ToHtml.new.convert(@data).to_s
34
+ end
35
+ # :nocov:
36
+ else
37
+ Tilt::StaticTemplate.subclass do
38
+ RDoc::Markup::ToHtml.new(RDoc::Options.new, nil).convert(@data).to_s
39
+ end
40
+ end
41
+ # :nocov:
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = Markdown (<tt>markdown</tt>, <tt>md</tt>, <tt>mkd</tt>)
4
+ #
5
+ # {Markdown}[http://daringfireball.net/projects/markdown/syntax] is a
6
+ # lightweight markup language, created by John Gruber and Aaron Swartz.
7
+ # For any markup that is not covered by Markdown’s syntax, HTML is used.
8
+ # Marking up plain text with Markdown markup is easy and Markdown
9
+ # formatted texts are readable.
10
+ #
11
+ # === Example
12
+ #
13
+ # Hello Markdown Templates
14
+ # ========================
15
+ #
16
+ # Hello World. This is a paragraph.
17
+ #
18
+ # === Usage
19
+ #
20
+ # To wrap a Markdown formatted document with a layout:
21
+ #
22
+ # layout = Tilt['erb'].new do
23
+ # "<!doctype html><title></title><%= yield %>"
24
+ # end
25
+ # data = Tilt['md'].new { "# hello tilt" }
26
+ # layout.render { data.render }
27
+ # # => "<!doctype html><title></title><h1>hello tilt</h1>\n"
28
+ #
29
+ # === Options
30
+ #
31
+ # ==== <tt>:smartypants => true|false</tt>
32
+ #
33
+ # Set <tt>true</tt> to enable [Smarty Pants][smartypants] style punctuation replacement.
34
+ #
35
+ # ==== <tt>:escape_html => true|false</tt>
36
+ #
37
+ # Set <tt>true</tt> disallow raw HTML in Markdown contents. HTML is converted to
38
+ # literal text by escaping <tt><</tt> characters.
39
+ #
40
+ # === See also
41
+ #
42
+ # * {Markdown Syntax Documentation}[http://daringfireball.net/projects/markdown/syntax]
43
+
44
+ require_relative 'template'
45
+ require 'redcarpet'
46
+
47
+ aliases = {:escape_html => :filter_html, :smartypants => :smart}.freeze
48
+
49
+ Tilt::RedcarpetTemplate = Tilt::StaticTemplate.subclass do
50
+ aliases.each do |opt, aka|
51
+ if options.key?(aka) || !@options.key?(opt)
52
+ @options[opt] = @options.delete(aka)
53
+ end
54
+ end
55
+
56
+ # only raise an exception if someone is trying to enable :escape_html
57
+ @options.delete(:escape_html) unless @options[:escape_html]
58
+
59
+ renderer = @options.delete(:renderer) || ::Redcarpet::Render::HTML.new(@options)
60
+ if options.delete(:smartypants) && !(renderer.is_a?(Class) && renderer <= ::Redcarpet::Render::SmartyPants)
61
+ renderer = if renderer == ::Redcarpet::Render::XHTML
62
+ ::Redcarpet::Render::SmartyHTML.new(:xhtml => true)
63
+ elsif renderer == ::Redcarpet::Render::HTML
64
+ ::Redcarpet::Render::SmartyHTML
65
+ elsif renderer.is_a? Class
66
+ Class.new(renderer) { include ::Redcarpet::Render::SmartyPants }
67
+ else
68
+ renderer.extend ::Redcarpet::Render::SmartyPants
69
+ end
70
+ end
71
+
72
+ Redcarpet::Markdown.new(renderer, @options).render(@data)
73
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = Textile (<tt>textile</tt>)
4
+ #
5
+ # Textile is a lightweight markup language originally developed by Dean Allen and
6
+ # billed as a "humane Web text generator". Textile converts its marked-up text
7
+ # input to valid, well-formed XHTML and also inserts character entity references
8
+ # for apostrophes, opening and closing single and double quotation marks,
9
+ # ellipses and em dashes.
10
+ #
11
+ # Textile formatted texts are converted to HTML with the {RedCloth}[http://redcloth.org]
12
+ # engine, which is a Ruby extension written in C.
13
+ #
14
+ # === Example
15
+ #
16
+ # h1. Hello Textile Templates
17
+ #
18
+ # Hello World. This is a paragraph.
19
+ #
20
+ # === Usage
21
+ #
22
+ # __NOTE:__ It's suggested that your program <tt>require 'redcloth'</tt> at load time
23
+ # when using this template engine in a threaded environment.
24
+ #
25
+ # === See Also
26
+ #
27
+ # * {RedCloth}[http://redcloth.org]
28
+ # * https://github.com/jgarber/redcloth
29
+
30
+ require_relative 'template'
31
+ require 'redcloth'
32
+
33
+ Tilt::RedClothTemplate = Tilt::StaticTemplate.subclass do
34
+ engine = RedCloth.new(@data)
35
+ @options.each do |k, v|
36
+ m = :"#{k}="
37
+ engine.send(m, v) if engine.respond_to? m
38
+ end
39
+ engine.to_html
40
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = reStructuredText (<tt>rst</tt>)
4
+ #
5
+ # reStructuredText is a lightweight markup language originally developed by David Goodger,
6
+ # based on StructuredText and Setext. reStructuredText is primarily used for technical
7
+ # documentation in the Python programming language community, e.g. by the
8
+ # {Sphinx}[http://www.sphinx-doc.org/en/stable/rest.html] Python documentation generator.
9
+ #
10
+ # reStructuredText formatted texts are converted to HTML with {Pandoc}[http://pandoc.org/], which
11
+ # is an application written in Haskell, with a Ruby wrapper provided by the
12
+ # {pandoc-ruby}[https://github.com/alphabetum/pandoc-ruby] gem.
13
+ #
14
+ # === Example
15
+ #
16
+ # Hello Rst Templates
17
+ # ===================
18
+ #
19
+ # Hello World. This is a paragraph.
20
+ #
21
+ # === See Also
22
+ #
23
+ # * {Pandoc}[http://pandoc.org/]
24
+ # * {pandoc-ruby}[https://github.com/alphabetum/pandoc-ruby]
25
+
26
+ require_relative 'template'
27
+ require_relative 'pandoc'
28
+
29
+ rst = {:f => "rst"}.freeze
30
+
31
+ Tilt::RstPandocTemplate = Tilt::StaticTemplate.subclass do
32
+ PandocRuby.new(@data, rst).to_html.strip
33
+ end
@@ -1,10 +1,23 @@
1
1
  # frozen_string_literal: true
2
+
3
+ # = Sass / Scss
4
+ #
5
+ # Sass/Scss template implementation for generating CSS.
6
+ #
7
+ # Sass templates do not support object scopes, locals, or yield.
8
+ #
9
+ # === See also
10
+ #
11
+ # * https://sass-lang.com/
12
+ #
13
+ # === Related modules
14
+ #
15
+ # * Tilt::SassTemplate
16
+ # * Tilt::ScssTemplate
17
+
2
18
  require_relative 'template'
3
19
 
4
20
  module Tilt
5
- # Sass template implementation for generating CSS. See: https://sass-lang.com/
6
- #
7
- # Sass templates do not support object scopes, locals, or yield.
8
21
  class SassTemplate < StaticTemplate
9
22
  self.default_mime_type = 'text/css'
10
23
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = Slim (<tt>slim</tt>)
4
+ #
5
+ # === Embedded locals
6
+ #
7
+ # In slim templates, the comment format looks like this:
8
+ #
9
+ # //# locals: ()
10
+ #
11
+ # === See also
12
+ #
13
+ # * https://slim-template.github.io
14
+
15
+ require_relative 'template'
16
+ require 'slim'
17
+
18
+ Tilt::SlimTemplate = Slim::Template
@@ -1,9 +1,17 @@
1
1
  # frozen_string_literal: true
2
+
3
+ # = String
4
+ #
5
+ # The template source is evaluated as a Ruby string. The #{} interpolation
6
+ # syntax can be used to generated dynamic output.
7
+ #
8
+ # === Related module
9
+ #
10
+ # * Tilt::StringTemplate
11
+
2
12
  require_relative 'template'
3
13
 
4
14
  module Tilt
5
- # The template source is evaluated as a Ruby string. The #{} interpolation
6
- # syntax can be used to generated dynamic output.
7
15
  class StringTemplate < Template
8
16
  def prepare
9
17
  hash = "TILT#{@data.hash.abs}"
@@ -41,12 +41,12 @@ module Tilt
41
41
  @metadata ||= {}
42
42
  end
43
43
 
44
- # Use `.metadata[:mime_type]` instead.
44
+ # Use <tt>.metadata[:mime_type]</tt> instead.
45
45
  def default_mime_type
46
46
  metadata[:mime_type]
47
47
  end
48
48
 
49
- # Use `.metadata[:mime_type] = val` instead.
49
+ # Use <tt>.metadata[:mime_type] = val</tt> instead.
50
50
  def default_mime_type=(value)
51
51
  metadata[:mime_type] = value
52
52
  end
@@ -376,10 +376,10 @@ module Tilt
376
376
 
377
377
  s = "locals = locals[:locals]"
378
378
  if assignments.delete(s)
379
- # If there is a locals key itself named `locals`, delete it from the ordered keys so we can
379
+ # If there is a locals key itself named <tt>locals</tt>, delete it from the ordered keys so we can
380
380
  # assign it last. This is important because the assignment of all other locals depends on the
381
- # `locals` local variable still matching the `locals` method argument given to the method
382
- # created in `#compile_template_method`.
381
+ # <tt>locals</tt> local variable still matching the <tt>locals</tt> method argument given to the method
382
+ # created in <tt>#compile_template_method</tt>.
383
383
  assignments << s
384
384
  end
385
385
 
@@ -1,4 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
3
+ # = Typescript
4
+ #
5
+ # TypeScript implementation.
6
+
2
7
  require_relative 'template'
3
8
  require 'typescript-node'
4
9
 
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ # = Yajl
4
+ #
5
+ # Yajl Template implementation
6
+ #
7
+ # Yajl is a fast JSON parsing and encoding library for Ruby
8
+ #
9
+ # The template source is evaluated as a Ruby string,
10
+ # and the result is converted #to_json.
11
+ #
12
+ # === Example
13
+ #
14
+ # # This is a template example.
15
+ # # The template can contain any Ruby statement.
16
+ # tpl <<-EOS
17
+ # @counter = 0
18
+ #
19
+ # # The json variable represents the buffer
20
+ # # and holds the data to be serialized into json.
21
+ # # It defaults to an empty hash, but you can override it at any time.
22
+ # json = {
23
+ # :"user#{@counter += 1}" => { :name => "Joshua Peek", :id => @counter },
24
+ # :"user#{@counter += 1}" => { :name => "Ryan Tomayko", :id => @counter },
25
+ # :"user#{@counter += 1}" => { :name => "Simone Carletti", :id => @counter },
26
+ # }
27
+ #
28
+ # # Since the json variable is a Hash,
29
+ # # you can use conditional statements or any other Ruby statement
30
+ # # to populate it.
31
+ # json[:"user#{@counter += 1}"] = { :name => "Unknown" } if 1 == 2
32
+ #
33
+ # # The last line doesn't affect the returned value.
34
+ # nil
35
+ # EOS
36
+ #
37
+ # template = Tilt::YajlTemplate.new { tpl }
38
+ # template.render(self)
39
+ #
40
+ # === See also
41
+ #
42
+ # * https://github.com/brianmario/yajl-ruby
43
+ #
44
+ # === Related module
45
+ #
46
+ # * Tilt::YajlTemplate
47
+
48
+ require_relative 'template'
49
+ require 'yajl'
50
+
51
+ module Tilt
52
+ class YajlTemplate < Template
53
+ self.default_mime_type = 'application/json'
54
+
55
+ def evaluate(scope, locals, &block)
56
+ decorate(super)
57
+ end
58
+
59
+ def precompiled_preamble(locals)
60
+ return super if locals.include? :json
61
+ "json = {}\n#{super}"
62
+ end
63
+
64
+ def precompiled_postamble(locals)
65
+ "Yajl::Encoder.new.encode(json)"
66
+ end
67
+
68
+ def precompiled_template(locals)
69
+ @data.to_str
70
+ end
71
+
72
+ # Decorates the +json+ input according to given +options+.
73
+ #
74
+ # json - The json String to decorate.
75
+ # options - The option Hash to customize the behavior.
76
+ #
77
+ # Returns the decorated String.
78
+ def decorate(json)
79
+ callback, variable = @options[:callback], @options[:variable]
80
+ if callback && variable
81
+ "var #{variable} = #{json}; #{callback}(#{variable});"
82
+ elsif variable
83
+ "var #{variable} = #{json};"
84
+ elsif callback
85
+ "#{callback}(#{json});"
86
+ else
87
+ json
88
+ end
89
+ end
90
+ end
91
+ end
@@ -5,7 +5,7 @@ require_relative 'tilt/template'
5
5
  # Namespace for Tilt. This module is not intended to be included anywhere.
6
6
  module Tilt
7
7
  # Current version.
8
- VERSION = '2.6.1'
8
+ VERSION = '2.8.0'
9
9
 
10
10
  EMPTY_ARRAY = [].freeze
11
11
  private_constant :EMPTY_ARRAY
@@ -163,7 +163,6 @@ module Tilt
163
163
  register_lazy :CSVTemplate, 'tilt/csv', 'rcsv'
164
164
  register_lazy :CoffeeScriptTemplate, 'tilt/coffee', 'coffee'
165
165
  register_lazy :CoffeeScriptLiterateTemplate, 'tilt/coffee', 'litcoffee'
166
- register_lazy :CreoleTemplate, 'tilt/creole', 'wiki', 'creole'
167
166
  register_lazy :EtanniTemplate, 'tilt/etanni', 'etn', 'etanni'
168
167
  register_lazy :HamlTemplate, 'tilt/haml', 'haml'
169
168
  register_lazy :LiquidTemplate, 'tilt/liquid', 'liquid'
@@ -120,7 +120,7 @@ module Brakeman
120
120
 
121
121
  def template_paths
122
122
  @template_paths ||= find_paths(".", "*.{#{VIEW_EXTENSIONS}}") +
123
- find_paths("**", "*.{erb,haml,slim}").reject { |path| File.basename(path).count(".") > 1 }
123
+ find_paths(".", "*.{erb,haml,slim}").reject { |path| File.basename(path).count(".") > 1 }
124
124
  end
125
125
 
126
126
  def layout_exists?(name)
@@ -213,13 +213,17 @@ module Brakeman
213
213
  end
214
214
 
215
215
  def reject_directories(paths)
216
- paths.reject { |path| File.directory?(path) }
216
+ paths.reject do |path|
217
+ Brakeman.logger.spin
218
+ File.directory?(path)
219
+ end
217
220
  end
218
221
 
219
222
  def select_only_files(paths)
220
223
  return paths unless @only_files
221
224
 
222
225
  paths.select do |path|
226
+ Brakeman.logger.spin
223
227
  match_path @only_files, path
224
228
  end
225
229
  end
@@ -228,6 +232,7 @@ module Brakeman
228
232
  return paths unless @skip_files
229
233
 
230
234
  paths.reject do |path|
235
+ Brakeman.logger.spin
231
236
  match_path @skip_files, path
232
237
  end
233
238
  end
@@ -25,6 +25,7 @@ class Brakeman::CheckEOLRails < Brakeman::EOLCheck
25
25
  ['7.0.0', '7.0.99'] => Date.new(2025, 4, 1),
26
26
  ['7.1.0', '7.1.99'] => Date.new(2025, 10, 1),
27
27
  ['7.2.0', '7.2.99'] => Date.new(2026, 8, 9),
28
- ['8.0.0', '8.0.99'] => Date.new(2026, 10, 7),
28
+ ['8.0.0', '8.0.99'] => Date.new(2026, 11, 7),
29
+ ['8.1.0', '8.1.99'] => Date.new(2027, 10, 10),
29
30
  }
30
31
  end
@@ -26,5 +26,6 @@ class Brakeman::CheckEOLRuby < Brakeman::EOLCheck
26
26
  ['3.2.0', '3.2.99'] => Date.new(2026, 3, 31),
27
27
  ['3.3.0', '3.3.99'] => Date.new(2027, 3, 31),
28
28
  ['3.4.0', '3.4.99'] => Date.new(2028, 3, 31),
29
+ ['4.0.0', '4.0.99'] => Date.new(2029, 3, 31),
29
30
  }
30
31
  end