brakeman 6.2.2 → 7.0.1

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 (300) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +26 -0
  3. data/README.md +1 -1
  4. data/bundle/load.rb +10 -8
  5. data/bundle/ruby/3.1.0/gems/csv-3.3.3/LICENSE.txt +33 -0
  6. data/bundle/ruby/3.1.0/gems/csv-3.3.3/NEWS.md +990 -0
  7. data/bundle/ruby/3.1.0/gems/csv-3.3.3/README.md +55 -0
  8. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/core_ext/array.rb +9 -0
  9. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/core_ext/string.rb +9 -0
  10. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/fields_converter.rb +96 -0
  11. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/input_record_separator.rb +18 -0
  12. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/parser.rb +1302 -0
  13. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/row.rb +757 -0
  14. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/table.rb +1055 -0
  15. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/version.rb +6 -0
  16. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv/writer.rb +209 -0
  17. data/bundle/ruby/3.1.0/gems/csv-3.3.3/lib/csv.rb +3017 -0
  18. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/Changelog.md +4 -0
  19. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/Gemfile +1 -0
  20. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/list_renderer.rb +2 -2
  21. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/menu.rb +7 -5
  22. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/version.rb +1 -1
  23. data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline.rb +17 -12
  24. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/config.rb +22 -26
  25. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/history.rb +3 -3
  26. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/ansi.rb +64 -111
  27. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/dumb.rb +16 -2
  28. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/windows.rb +77 -60
  29. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io.rb +14 -0
  30. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/base.rb +10 -4
  31. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/emacs.rb +96 -96
  32. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_command.rb +182 -182
  33. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_insert.rb +137 -137
  34. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_stroke.rb +26 -16
  35. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/line_editor.rb +238 -404
  36. data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
  37. data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
  38. data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline.rb +18 -18
  39. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/NEWS.md +74 -0
  40. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/baseparser.rb +78 -48
  41. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/pullparser.rb +4 -0
  42. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/rexml.rb +1 -1
  43. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/source.rb +61 -6
  44. data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/text.rb +15 -40
  45. data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/History.rdoc +6 -0
  46. data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/lib/ruby2ruby.rb +7 -4
  47. data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/History.rdoc +6 -0
  48. data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp.rb +1 -1
  49. data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_processor.rb +1 -1
  50. data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/History.rdoc +149 -0
  51. data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/README.md +417 -0
  52. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/cell.rb +9 -9
  53. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/row.rb +18 -4
  54. data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/separator.rb +66 -0
  55. data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/style.rb +284 -0
  56. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/table.rb +49 -18
  57. data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/util.rb +13 -0
  58. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/version.rb +1 -1
  59. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table.rb +2 -2
  60. data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/terminal-table.gemspec +3 -4
  61. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/creole.rb +2 -0
  62. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/liquid.rb +0 -3
  63. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/mapping.rb +3 -3
  64. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rdoc.rb +0 -8
  65. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/template.rb +178 -27
  66. data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt.rb +9 -4
  67. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/CHANGELOG.md +291 -0
  68. data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0 → unicode-display_width-3.1.4}/MIT-LICENSE.txt +1 -1
  69. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/README.md +194 -0
  70. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/data/display_width.marshal.gz +0 -0
  71. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/constants.rb +10 -0
  72. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/emoji_support.rb +52 -0
  73. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/index.rb +34 -0
  74. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/no_string_ext.rb +8 -0
  75. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/reline_ext.rb +14 -0
  76. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width/string_ext.rb +9 -0
  77. data/bundle/ruby/3.1.0/gems/unicode-display_width-3.1.4/lib/unicode/display_width.rb +247 -0
  78. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/CHANGELOG.md +191 -0
  79. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/CODE_OF_CONDUCT.md +74 -0
  80. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/Gemfile +7 -0
  81. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/Gemfile.lock +33 -0
  82. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/MIT-LICENSE.txt +20 -0
  83. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/README.md +205 -0
  84. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/data/emoji.marshal.gz +0 -0
  85. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/data/generate_constants.rb +344 -0
  86. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/constants.rb +49 -0
  87. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex.rb +8 -0
  88. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_basic.rb +8 -0
  89. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_emoji_keycap.rb +8 -0
  90. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_mqe.rb +8 -0
  91. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_mqe_uqe.rb +8 -0
  92. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_include_text.rb +8 -0
  93. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_picto.rb +8 -0
  94. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_picto_no_emoji.rb +8 -0
  95. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_possible.rb +8 -0
  96. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_component.rb +8 -0
  97. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_emoji.rb +8 -0
  98. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_modifier.rb +8 -0
  99. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_modifier_base.rb +8 -0
  100. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_prop_presentation.rb +8 -0
  101. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_text.rb +8 -0
  102. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_text_presentation.rb +8 -0
  103. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_valid.rb +8 -0
  104. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_valid_include_text.rb +8 -0
  105. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_well_formed.rb +8 -0
  106. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated/regex_well_formed_include_text.rb +8 -0
  107. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex.rb +8 -0
  108. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_basic.rb +8 -0
  109. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_emoji_keycap.rb +8 -0
  110. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_mqe.rb +8 -0
  111. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_mqe_uqe.rb +8 -0
  112. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_include_text.rb +8 -0
  113. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_picto.rb +8 -0
  114. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_picto_no_emoji.rb +8 -0
  115. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_possible.rb +8 -0
  116. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_component.rb +8 -0
  117. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_emoji.rb +8 -0
  118. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_modifier.rb +8 -0
  119. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_modifier_base.rb +8 -0
  120. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_prop_presentation.rb +8 -0
  121. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_text.rb +8 -0
  122. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_text_presentation.rb +8 -0
  123. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_valid.rb +8 -0
  124. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_valid_include_text.rb +8 -0
  125. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_well_formed.rb +8 -0
  126. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/generated_native/regex_well_formed_include_text.rb +8 -0
  127. data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0/lib/unicode/display_width → unicode-emoji-4.0.4/lib/unicode/emoji}/index.rb +5 -3
  128. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/lazy_constants.rb +56 -0
  129. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji/list.rb +13 -0
  130. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/lib/unicode/emoji.rb +111 -0
  131. data/bundle/ruby/3.1.0/gems/unicode-emoji-4.0.4/unicode-emoji.gemspec +22 -0
  132. data/lib/brakeman/app_tree.rb +29 -19
  133. data/lib/brakeman/checks/check_deserialize.rb +4 -1
  134. data/lib/brakeman/checks/check_evaluation.rb +45 -8
  135. data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -0
  136. data/lib/brakeman/checks/check_weak_rsa_key.rb +1 -1
  137. data/lib/brakeman/file_parser.rb +2 -1
  138. data/lib/brakeman/options.rb +12 -5
  139. data/lib/brakeman/processors/alias_processor.rb +9 -4
  140. data/lib/brakeman/processors/lib/file_type_detector.rb +9 -7
  141. data/lib/brakeman/report/ignore/config.rb +0 -1
  142. data/lib/brakeman/report/report_sarif.rb +122 -2
  143. data/lib/brakeman/rescanner.rb +40 -390
  144. data/lib/brakeman/scanner.rb +84 -51
  145. data/lib/brakeman/tracker/file_cache.rb +83 -0
  146. data/lib/brakeman/tracker.rb +19 -2
  147. data/lib/brakeman/version.rb +1 -1
  148. data/lib/brakeman.rb +19 -2
  149. metadata +265 -199
  150. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/terminfo.rb +0 -158
  151. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/unicode.rb +0 -671
  152. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/version.rb +0 -3
  153. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/History.rdoc +0 -85
  154. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/README.rdoc +0 -247
  155. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -14
  156. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -79
  157. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erubis.rb +0 -51
  158. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/maruku.rb +0 -10
  159. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/wikicloth.rb +0 -12
  160. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -137
  161. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/README.md +0 -124
  162. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  163. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -8
  164. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -7
  165. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -17
  166. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -51
  167. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/AUTHORS +0 -0
  168. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/COPYING +0 -0
  169. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/LICENSE +0 -0
  170. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/README.md +0 -0
  171. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/TODO +0 -0
  172. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/highline.gemspec +0 -0
  173. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/builtin_styles.rb +0 -0
  174. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/color_scheme.rb +0 -0
  175. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/compatibility.rb +0 -0
  176. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/custom_errors.rb +0 -0
  177. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/import.rb +0 -0
  178. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/io_console_compatible.rb +0 -0
  179. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/list.rb +0 -0
  180. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/menu/item.rb +0 -0
  181. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/paginator.rb +0 -0
  182. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question/answer_converter.rb +0 -0
  183. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question.rb +0 -0
  184. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/question_asker.rb +0 -0
  185. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/simulate.rb +0 -0
  186. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/statement.rb +0 -0
  187. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/string.rb +0 -0
  188. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/string_extensions.rb +0 -0
  189. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/style.rb +0 -0
  190. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/template_renderer.rb +0 -0
  191. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/io_console.rb +0 -0
  192. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/ncurses.rb +0 -0
  193. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal/unix_stty.rb +0 -0
  194. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/terminal.rb +0 -0
  195. /data/bundle/ruby/3.1.0/gems/{highline-3.1.1 → highline-3.1.2}/lib/highline/wrapper.rb +0 -0
  196. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/BSDL +0 -0
  197. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/COPYING +0 -0
  198. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/README.md +0 -0
  199. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/face.rb +0 -0
  200. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/composite.rb +0 -0
  201. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor.rb +0 -0
  202. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/kill_ring.rb +0 -0
  203. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/unicode/east_asian_width.rb +0 -0
  204. /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/license_of_rb-readline +0 -0
  205. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/LICENSE.txt +0 -0
  206. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/README.md +0 -0
  207. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/attlistdecl.rb +0 -0
  208. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/attribute.rb +0 -0
  209. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/cdata.rb +0 -0
  210. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/child.rb +0 -0
  211. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/comment.rb +0 -0
  212. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/doctype.rb +0 -0
  213. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/document.rb +0 -0
  214. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/attlistdecl.rb +0 -0
  215. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/dtd.rb +0 -0
  216. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/elementdecl.rb +0 -0
  217. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/entitydecl.rb +0 -0
  218. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/dtd/notationdecl.rb +0 -0
  219. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/element.rb +0 -0
  220. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/encoding.rb +0 -0
  221. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/entity.rb +0 -0
  222. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/default.rb +0 -0
  223. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/pretty.rb +0 -0
  224. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/formatters/transitive.rb +0 -0
  225. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/functions.rb +0 -0
  226. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/instruction.rb +0 -0
  227. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/light/node.rb +0 -0
  228. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/namespace.rb +0 -0
  229. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/node.rb +0 -0
  230. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/output.rb +0 -0
  231. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parent.rb +0 -0
  232. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parseexception.rb +0 -0
  233. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/lightparser.rb +0 -0
  234. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/sax2parser.rb +0 -0
  235. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/streamparser.rb +0 -0
  236. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/treeparser.rb +0 -0
  237. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/ultralightparser.rb +0 -0
  238. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/parsers/xpathparser.rb +0 -0
  239. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/quickpath.rb +0 -0
  240. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/sax2listener.rb +0 -0
  241. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/security.rb +0 -0
  242. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/streamlistener.rb +0 -0
  243. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/undefinednamespaceexception.rb +0 -0
  244. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/relaxng.rb +0 -0
  245. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/validation.rb +0 -0
  246. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/validation/validationexception.rb +0 -0
  247. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xmldecl.rb +0 -0
  248. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xmltokens.rb +0 -0
  249. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xpath.rb +0 -0
  250. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml/xpath_parser.rb +0 -0
  251. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.1}/lib/rexml.rb +0 -0
  252. /data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/Manifest.txt +0 -0
  253. /data/bundle/ruby/3.1.0/gems/{ruby2ruby-2.5.1 → ruby2ruby-2.5.2}/README.rdoc +0 -0
  254. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/Manifest.txt +0 -0
  255. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/README.rdoc +0 -0
  256. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/composite_sexp_processor.rb +0 -0
  257. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/pt_testcase.rb +0 -0
  258. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_matcher.rb +0 -0
  259. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/strict_sexp.rb +0 -0
  260. /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/unique.rb +0 -0
  261. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Gemfile +0 -0
  262. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/LICENSE.txt +0 -0
  263. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Manifest +0 -0
  264. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/Todo.rdoc +0 -0
  265. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/import.rb +0 -0
  266. /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-4.0.0}/lib/terminal-table/table_helper.rb +0 -0
  267. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/COPYING +0 -0
  268. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_emacs_org.rb +0 -0
  269. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_handlebars.rb +0 -0
  270. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_jbuilder.rb +0 -0
  271. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/_org.rb +0 -0
  272. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/asciidoc.rb +0 -0
  273. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/babel.rb +0 -0
  274. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/builder.rb +0 -0
  275. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/cli.rb +0 -0
  276. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/coffee.rb +0 -0
  277. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/commonmarker.rb +0 -0
  278. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/csv.rb +0 -0
  279. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/erb.rb +0 -0
  280. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/erubi.rb +0 -0
  281. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/etanni.rb +0 -0
  282. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/haml.rb +0 -0
  283. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/kramdown.rb +0 -0
  284. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/livescript.rb +0 -0
  285. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/markaby.rb +0 -0
  286. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/nokogiri.rb +0 -0
  287. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/pandoc.rb +0 -0
  288. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/pipeline.rb +0 -0
  289. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/plain.rb +0 -0
  290. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/prawn.rb +0 -0
  291. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/radius.rb +0 -0
  292. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rdiscount.rb +0 -0
  293. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/redcarpet.rb +0 -0
  294. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/redcloth.rb +0 -0
  295. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/rst-pandoc.rb +0 -0
  296. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/sass.rb +0 -0
  297. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/slim.rb +0 -0
  298. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/string.rb +0 -0
  299. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/typescript.rb +0 -0
  300. /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.6.0}/lib/tilt/yajl.rb +0 -0
@@ -0,0 +1,149 @@
1
+ 4.0.0 / 2025-01-28
2
+ ==================
3
+
4
+ - Non-unicode characters are no longer supported. They will be replaced.
5
+ - Headings may be set to nil.
6
+ - unicode-display-width version 3 supported.
7
+
8
+ 3.0.2 / 2021-09-19
9
+ ==================
10
+
11
+ - fix align_column for nil values and colspan
12
+
13
+ 3.0.1 / 2021-05-10
14
+ ==================
15
+
16
+ - Support for unicode-display_width 2.0
17
+ - Fix issue where last row of an empty table changed format
18
+
19
+ 3.0.0 / 2020-01-27
20
+ ==================
21
+
22
+ - Support for (optional) Unicode border styles on tables. In order to support decent looking Unicode borders, different types of intersections get different types of intersection characters. This has the side effect of subtle formatting differences even for the ASCII table border case due to removal of certain intersections near colspans.
23
+
24
+ For example, previously the output of a table may be:
25
+ +------+-----+
26
+ | Title |
27
+ +------+-----+
28
+ | Char | Num |
29
+ +------+-----+
30
+ | a | 1 |
31
+ | b | 2 |
32
+ | c | 3 |
33
+ +------+-----+
34
+
35
+ And now the `+` character above the word Title is removed, as it is no longer considered an intersection:
36
+
37
+ +------------+
38
+ | Title |
39
+ +------+-----+
40
+ | Char | Num |
41
+ +------+-----+
42
+ | a | 1 |
43
+ | b | 2 |
44
+ +------+-----+
45
+
46
+ - The default border remains an ASCII border for backwards compatibility, however multiple border classes are included / documented, and user defined border types can be applied as needed.
47
+
48
+ In support of this update, the following issues were addressed:
49
+ - colspan creates conflict with colorize (#95)
50
+ - Use nice UTF box-drawing characters by default (#99)
51
+ - Note that `AsciiBorder` is stll the default
52
+ - Border-left and border-right style (#100)
53
+ - Helper function to style as Markdown (#111)
54
+ - Achieved using `MarkdownBorder`
55
+
56
+ 2.0.0 / 2020-10-28
57
+ ==================
58
+
59
+ - Drops official support for Ruby 1.9.x with and of life on 2015-02-23
60
+ - Drops official support for Ruby 2.0.x with and of life on 2016-02-24
61
+ - Drops official support for Ruby 2.1.x with and of life on 2017-03-31
62
+ - Drops official support for Ruby 2.2.x with and of life on 2018-03-31
63
+ - Drops official support for Ruby 2.3.x with and of life on 2019-03-31
64
+
65
+ 1.8.0 / 2017-05-16
66
+ ==================
67
+
68
+ * Top and bottom borders can be disabled (@kubakrzempek, #83)
69
+ * `unicode-display-width` dependency relaxes (@mvz, #88)
70
+
71
+ * Readme and docs fixes (@loualrid, #82 and @leoarnold, #86)
72
+ * Fixed some test-related warnings (@juanitofatas, #81 and @mvz, #89)
73
+
74
+ 1.7.3 / 2016-09-21
75
+ ==================
76
+
77
+ * Fixed compatibility issues for Ruby 1.9, 2.0, 2.1. (@vivekbisen, #80)
78
+
79
+ 1.7.2 / 2016-09-09
80
+ ==================
81
+
82
+ * Fix packing table to a minimal width (@vizv, #76)
83
+
84
+ 1.7.1 / 2016-08-29
85
+ ==================
86
+
87
+ * Update `unicode-display_width` to fix behavior with signal traps [#78, @jrmhaig]
88
+
89
+ 1.7.0 / 2016-08-29
90
+ ==================
91
+
92
+ All props to @vizv for this release!
93
+
94
+ * Fixed some spec failures
95
+ * Added support for full-width characters (East Asian alphabets, etc)
96
+
97
+ 1.6.0 / 2016-06-06
98
+ ==================
99
+
100
+ * Added table styles - margin_left, all_separators.
101
+
102
+ 1.4.3 / 2011-10-13
103
+ ==================
104
+
105
+ * Optimize for faster table output.
106
+
107
+ 1.4.2 / 2010-01-14
108
+ ==================
109
+
110
+ * Fixed some bugs with colspan
111
+
112
+ === 1.4.1 / 2009-12-18
113
+
114
+ * Fix column alignment with separators.
115
+
116
+ === 1.4.0 / 2009-12-18
117
+
118
+ * Can now add :seperator arbitrarily in a table [thanks splattael]
119
+ * Fix common typo: seperator -> separator [thanks splattael]
120
+
121
+ === 1.3.0 / 2009-10-16
122
+
123
+ * Major refactoring (functionality remains the same)
124
+
125
+ === 1.2.0 / 2009-08-06
126
+
127
+ * Added colspan support to table
128
+
129
+ === 1.1.0 / 2009-08-06
130
+
131
+ * Added colspan support to table
132
+
133
+ === 1.1.0 / 2009-07-13
134
+
135
+ * Added Table#==
136
+
137
+ === 1.0.5 / 2009-03-14
138
+
139
+ * Allowing nil to be passed to table for headings
140
+ * Revised doc to show that rows can be splatted now
141
+ * Misc refactoring
142
+
143
+ === 1.0.3 / 2009-01-15
144
+
145
+ * Moved yield or eval to Terminal::Table initialize where it belongs
146
+
147
+ === 1.0.0 / 2009-01-13
148
+
149
+ * Initial release
@@ -0,0 +1,417 @@
1
+ [![CI status](https://github.com/tj/terminal-table/workflows/CI/badge.svg)](https://github.com/tj/terminal-table/actions)
2
+ [![Gem Version](https://badge.fury.io/rb/terminal-table.svg)](https://badge.fury.io/rb/terminal-table)
3
+
4
+ # Terminal Table
5
+
6
+ ## Description
7
+
8
+ Terminal Table is a fast and simple, yet feature rich table generator
9
+ written in Ruby. It supports ASCII and Unicode formatted tables.
10
+
11
+ ## Installation
12
+
13
+ ```
14
+ $ gem install terminal-table
15
+ ```
16
+ ## Usage
17
+
18
+ ### Basics
19
+
20
+ To use Terminal Table:
21
+
22
+ ```ruby
23
+ require 'terminal-table'
24
+ ```
25
+ To generate a table, provide an array of arrays (which are interpreted as
26
+ rows):
27
+
28
+ ```ruby
29
+ rows = []
30
+ rows << ['One', 1]
31
+ rows << ['Two', 2]
32
+ rows << ['Three', 3]
33
+ table = Terminal::Table.new :rows => rows
34
+
35
+ # > puts table
36
+ #
37
+ # +-------+---+
38
+ # | One | 1 |
39
+ # | Two | 2 |
40
+ # | Three | 3 |
41
+ # +-------+---+
42
+ ```
43
+ The constructor can also be given a block which is either yielded the Table
44
+ object or instance evaluated:
45
+
46
+ ```ruby
47
+ table = Terminal::Table.new do |t|
48
+ t.rows = rows
49
+ end
50
+
51
+ table = Terminal::Table.new do
52
+ self.rows = rows
53
+ end
54
+ ```
55
+ Adding rows one by one:
56
+
57
+ ```ruby
58
+ table = Terminal::Table.new do |t|
59
+ t << ['One', 1]
60
+ t.add_row ['Two', 2]
61
+ end
62
+ ```
63
+ To add separators between rows:
64
+
65
+ ```ruby
66
+ table = Terminal::Table.new do |t|
67
+ t << ['One', 1] # Using << (push) as an alias for add_row
68
+ t << :separator # Using << with :separator as an alias for add_separator
69
+ t.add_row ['Two', 2]
70
+ t.add_separator # Note - this version allows setting the separator's border_type
71
+ t.add_row ['Three', 3]
72
+ end
73
+
74
+ # > puts table
75
+ #
76
+ # +-------+---+
77
+ # | One | 1 |
78
+ # +-------+---+
79
+ # | Two | 2 |
80
+ # +-------+---+
81
+ # | Three | 3 |
82
+ # +-------+---+
83
+ ```
84
+ Cells can handle multiline content:
85
+
86
+ ```ruby
87
+ table = Terminal::Table.new do |t|
88
+ t << ['One', 1]
89
+ t << :separator
90
+ t.add_row ["Two\nDouble", 2]
91
+ t.add_separator
92
+ t.add_row ['Three', 3]
93
+ end
94
+
95
+ # > puts table
96
+ #
97
+ # +--------+---+
98
+ # | One | 1 |
99
+ # +--------+---+
100
+ # | Two | 2 |
101
+ # | Double | |
102
+ # +--------+---+
103
+ # | Three | 3 |
104
+ # +--------+---+
105
+ ```
106
+ ### Head
107
+
108
+ To add a head to the table:
109
+
110
+ ```ruby
111
+ table = Terminal::Table.new :headings => ['Word', 'Number'], :rows => rows
112
+
113
+ # > puts table
114
+ #
115
+ # +-------+--------+
116
+ # | Word | Number |
117
+ # +-------+--------+
118
+ # | One | 1 |
119
+ # | Two | 2 |
120
+ # | Three | 3 |
121
+ # +-------+--------+
122
+ ```
123
+ ### Title
124
+
125
+ To add a title to the table:
126
+
127
+ ```ruby
128
+ table = Terminal::Table.new :title => "Cheatsheet", :headings => ['Word', 'Number'], :rows => rows
129
+
130
+ # > puts table
131
+ #
132
+ # +---------------------+
133
+ # | Cheatsheet |
134
+ # +------------+--------+
135
+ # | Word | Number |
136
+ # +------------+--------+
137
+ # | One | 1 |
138
+ # | Two | 2 |
139
+ # | Three | 3 |
140
+ # +------------+--------+
141
+ ```
142
+ ### Alignment
143
+
144
+ To align the second column to the right:
145
+
146
+ ```ruby
147
+ table.align_column(1, :right)
148
+
149
+ # > puts table
150
+ #
151
+ # +-------+--------+
152
+ # | Word | Number |
153
+ # +-------+--------+
154
+ # | One | 1 |
155
+ # | Two | 2 |
156
+ # | Three | 3 |
157
+ # +-------+--------+
158
+ ```
159
+ To align an individual cell, you specify the cell value in a hash along the
160
+ alignment:
161
+
162
+ ```ruby
163
+ table << ["Four", {:value => 4.0, :alignment => :center}]
164
+
165
+ # > puts table
166
+ #
167
+ # +-------+--------+
168
+ # | Word | Number |
169
+ # +-------+--------+
170
+ # | One | 1 |
171
+ # | Two | 2 |
172
+ # | Three | 3 |
173
+ # | Four | 4.0 |
174
+ # +-------+--------+
175
+ ```
176
+ ### Style
177
+
178
+ To specify style options:
179
+
180
+ ```ruby
181
+ table = Terminal::Table.new :headings => ['Word', 'Number'], :rows => rows, :style => {:width => 80}
182
+
183
+ # > puts table
184
+ #
185
+ # +--------------------------------------+---------------------------------------+
186
+ # | Word | Number |
187
+ # +--------------------------------------+---------------------------------------+
188
+ # | One | 1 |
189
+ # | Two | 2 |
190
+ # | Three | 3 |
191
+ # +--------------------------------------+---------------------------------------+
192
+ ```
193
+ And change styles on the fly:
194
+
195
+ ```ruby
196
+ table.style = {:width => 40, :padding_left => 3, :border_x => "=", :border_i => "x"}
197
+
198
+ # > puts table
199
+ #
200
+ # x======================================x
201
+ # | Cheatsheet |
202
+ # x====================x=================x
203
+ # | Word | Number |
204
+ # x====================x=================x
205
+ # | One | 1 |
206
+ # | Two | 2 |
207
+ # | Three | 3 |
208
+ # x====================x=================x
209
+ ```
210
+ You can also use styles to add a separator after every row:
211
+
212
+ ```ruby
213
+ table = Terminal::Table.new do |t|
214
+ t.add_row [1, 'One']
215
+ t.add_row [2, 'Two']
216
+ t.add_row [3, 'Three']
217
+ t.style = {:all_separators => true}
218
+ end
219
+
220
+ # > puts table
221
+ #
222
+ # +---+-------+
223
+ # | 1 | One |
224
+ # +---+-------+
225
+ # | 2 | Two |
226
+ # +---+-------+
227
+ # | 3 | Three |
228
+ # +---+-------+
229
+ ```
230
+ You can also use styles to disable top and bottom borders of the table.
231
+
232
+ ```ruby
233
+ table = Terminal::Table.new do |t|
234
+ t.headings = ['id', 'name']
235
+ t.rows = [[1, 'One'], [2, 'Two'], [3, 'Three']]
236
+ t.style = { :border_top => false, :border_bottom => false }
237
+ end
238
+
239
+ # > puts table
240
+ # | id | name |
241
+ # +----+-------+
242
+ # | 1 | One |
243
+ # | 2 | Two |
244
+ # | 3 | Three |
245
+ ```
246
+
247
+ And also to disable left and right borders of the table.
248
+
249
+ ```ruby
250
+ table = Terminal::Table.new do |t|
251
+ t.headings = ['id', 'name']
252
+ t.rows = [[1, 'One'], [2, 'Two'], [3, 'Three']]
253
+ t.style = { :border_left => false, :border_right => false }
254
+ end
255
+
256
+ # > puts table
257
+ # ----+-------
258
+ # id | name
259
+ # ----+-------
260
+ # 1 | One
261
+ # 2 | Two
262
+ # 3 | Three
263
+ # ----+-------
264
+ ```
265
+
266
+ To change the default style options:
267
+
268
+ ```ruby
269
+ Terminal::Table::Style.defaults = {:width => 80}
270
+ ```
271
+ All Table objects created afterwards will inherit these defaults.
272
+
273
+ ### Constructor options and setter methods
274
+
275
+ Valid options for the constructor are `:rows`, `:headings`, `:style` and `:title` -
276
+ and all options can also be set on the created table object by their setter
277
+ method:
278
+
279
+ ```ruby
280
+ table = Terminal::Table.new
281
+ table.title = "Cheatsheet"
282
+ table.headings = ['Word', 'Number']
283
+ table.rows = rows
284
+ table.style = {:width => 40}
285
+ ```
286
+
287
+ ## New Formatting
288
+
289
+ ### Unicode Table Borders
290
+ Support for Unicode 'box art' borders presented a challenge, as the original terminal-table only handled three border types: horizontal (x), vertical (y), and intersection (i). For proper box-art, it became necessary to enable different types of corners/edges for multiple intersection types.
291
+
292
+ For the sake of backward compatiblity, the previous interface is still supported, as this gem has been around a long time and making breaking changes would have been inconvenient. The new interface is required for any complex and/or Unicode style bordering. A few variations on border style are supported via some new classes and creation of additional classes (or modification of characters used in existing ones) will allow for customized border types.
293
+
294
+ The simplest way to use an alternate border is one of the following:
295
+ ```
296
+ table.style = { :border => :unicode }
297
+ table.style = { :border => :unicode_round }
298
+ table.style = { :border => :unicode_thick_edge }
299
+ ```
300
+
301
+ These are a convenience wrapper around setting border using an instance of a class that inherits from Table::Terminal::Border
302
+ ```
303
+ table.style = { :border => Terminal::Table::UnicodeBorder.new() }
304
+ table.style = { :border => Terminal::Table::UnicodeRoundBorder.new() }
305
+ table.style = { :border => Terminal::Table::UnicodeThickEdgeBorder.new() }
306
+ ```
307
+
308
+ If you define a custom class and wish to use the symbol shortcut, you must namespace within `Terminal::Table` and end your class name with `Border`.
309
+
310
+ ### Markdown Compatiblity
311
+ Per popular request, Markdown formatted tables can be generated by using the following border style:
312
+
313
+ ```
314
+ table.style = { :border => :markdown }
315
+ ```
316
+
317
+ ### Ascii Borders
318
+ Ascii borders are default, but can be explicitly set with:
319
+ ```
320
+ table.style = { :border => :ascii }
321
+ ```
322
+
323
+ ### Customizing Borders
324
+ Inside the `UnicodeBorder` class, there are definitions for a variety of corner/intersection and divider types.
325
+
326
+ ```ruby
327
+ @data = {
328
+ nil => nil,
329
+ nw: "┌", nx: "─", n: "┬", ne: "┐",
330
+ yw: "│", y: "│", ye: "│",
331
+ aw: "╞", ax: "═", ai: "╪", ae: "╡", ad: '╤', au: "╧", # double
332
+ bw: "┝", bx: "━", bi: "┿", be: "┥", bd: '┯', bu: "┷", # heavy/bold/thick
333
+ w: "├", x: "─", i: "┼", e: "┤", dn: "┬", up: "┴", # normal div
334
+ sw: "└", sx: "─", s: "┴", se: "┘",
335
+ # alternative dots/dashes
336
+ x_dot4: '┈', x_dot3: '┄', x_dash: '╌',
337
+ bx_dot4: '┉', bx_dot3: '┅', bx_dash: '╍',
338
+ }
339
+ ```
340
+
341
+ Note that many are defined as directional (:nw == north-west), others defined in terms of 'x' or 'y'.
342
+ The border that separates headings (below each heading) is of type `:double` and is defined with `a*` entries.
343
+ Alternate `:heavy` types that can be applied to separators can be defined with `b*` entries.
344
+
345
+ When defining a new set of borders, it's probably easiest to define a new class that inherits from UnicodeBorder and replaces the `@data` Hash.
346
+ However, these elements can be these can be overridden by poking setting the Hash, should the need arise:
347
+
348
+ ```
349
+ table.style = {border: :unicode}
350
+ table.style.border[:nw] = '*' # Override the north-west corner of the table
351
+ ```
352
+
353
+ ### Customizing row separators
354
+
355
+ Row-separators can now be customized in a variety of ways. The default separator's border_type is referred to as `:div`. Additional separator border types (e.g. `:double`, `:heavy`, `:dash` - see full list below) can be applied to separate the sections (e.g. header/footer/title).
356
+
357
+ The separator's `border_type` may be specified when a user-defined separator is added. Alternatively, borders may be adjusted after the table's rows are elaborated, but before the table is rendered.
358
+
359
+ Separator `border_type`s can be adjusted to be heavy, use double-lines, and different dash/dot styles. The border type should be one of:
360
+
361
+ div dash dot3 dot4
362
+ thick thick_dash thick_dot3 thick_dot4
363
+ heavy heavy_dash heavy_dot3 heavy_dot4
364
+ bold bold_dash bold_dot3 bold_dot4
365
+ double
366
+
367
+ To manually set the separator border_type, the `add_separator` method may be called.
368
+ ```ruby
369
+ add_separator(border_type: :heavy_dash)
370
+ ```
371
+
372
+ Alternatively, if `style: :all_separators` is used at the table level, it may be necessary to elaborate the implicit Separator rows prior to rendering.
373
+ ```ruby
374
+ table = Terminal::Table.new do |t|
375
+ t.add_row [1, 'One']
376
+ t.add_row [2, 'Two']
377
+ t.add_row [3, 'Three']
378
+ t.style = {:all_separators => true}
379
+ end
380
+ rows = table.elaborate_rows
381
+ rows[2].border_type = :heavy # modify separator row: emphasize below title
382
+ puts table.render
383
+ ```
384
+
385
+ ## Example: Displaying a small CSV spreadsheet
386
+
387
+ This example code demonstrates using Terminal-table and CSV to display a small spreadsheet.
388
+
389
+ ```ruby
390
+ #!/usr/bin/env ruby
391
+ require "csv"
392
+ require "terminal-table"
393
+ use_stdin = ARGV[0].nil? || (ARGV[0] == '-')
394
+ io_object = use_stdin ? $stdin : File.open(ARGV[0], 'r')
395
+ csv = CSV.new(io_object)
396
+ csv_array = csv.to_a
397
+ user_table = Terminal::Table.new do |v|
398
+ v.style = { :border => :unicode_round } # >= v3.0.0
399
+ v.title = "Some Title"
400
+ v.headings = csv_array[0]
401
+ v.rows = csv_array[1..-1]
402
+ end
403
+ puts user_table
404
+ ```
405
+
406
+ See also `examples/show_csv_table.rb` in the source distribution.
407
+
408
+ ## More examples
409
+
410
+ For more examples, please see the `examples` directory included in the
411
+ source distribution.
412
+
413
+ ## Author
414
+
415
+ TJ Holowaychuk <tj@vision-media.ca>
416
+
417
+ Unicode table support by Ben Bowers https://github.com/nanobowers
@@ -48,7 +48,7 @@ module Terminal
48
48
  val.public_send(positions[position], length)
49
49
  end
50
50
  def lines
51
- @value.to_s.split(/\n/)
51
+ @value.to_s.encode("utf-8", invalid: :replace).split(/\n/)
52
52
  end
53
53
 
54
54
  ##
@@ -57,7 +57,7 @@ module Terminal
57
57
  def render(line = 0)
58
58
  left = " " * @table.style.padding_left
59
59
  right = " " * @table.style.padding_right
60
- display_width = Unicode::DisplayWidth.of(escape(lines[line]))
60
+ display_width = Unicode::DisplayWidth.of(Util::ansi_escape(lines[line]))
61
61
  render_width = lines[line].to_s.size - display_width + width
62
62
  align("#{left}#{lines[line]}#{right}", alignment, render_width + @table.cell_padding)
63
63
  end
@@ -68,7 +68,7 @@ module Terminal
68
68
  # removes all ANSI escape sequences (e.g. color)
69
69
 
70
70
  def value_for_column_width_recalc
71
- lines.map{ |s| escape(s) }.max_by{ |s| Unicode::DisplayWidth.of(s) }
71
+ lines.map{ |s| Util::ansi_escape(s) }.max_by{ |s| Unicode::DisplayWidth.of(s) }
72
72
  end
73
73
 
74
74
  ##
@@ -82,12 +82,12 @@ module Terminal
82
82
  inner_width + padding
83
83
  end
84
84
 
85
- ##
86
- # removes all ANSI escape sequences (e.g. color)
87
- def escape(line)
88
- line.to_s.gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
89
- gsub(/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/, '').
90
- gsub(/(\x03|\x1a)/, '')
85
+ def inspect
86
+ fields = %i[alignment colspan index value width].map do |name|
87
+ val = self.instance_variable_get('@'+name.to_s)
88
+ "@#{name}=#{val.inspect}"
89
+ end.join(', ')
90
+ return "#<#{self.class} #{fields}>"
91
91
  end
92
92
  end
93
93
  end
@@ -12,7 +12,7 @@ module Terminal
12
12
  ##
13
13
  # Initialize with _width_ and _options_.
14
14
 
15
- def initialize table, array = []
15
+ def initialize table, array = [], **_kwargs
16
16
  @cell_index = 0
17
17
  @table = table
18
18
  @cells = []
@@ -36,17 +36,31 @@ module Terminal
36
36
  end
37
37
 
38
38
  def render
39
- y = @table.style.border_y
39
+ vleft, vcenter, vright = @table.style.vertical
40
40
  (0...height).to_a.map do |line|
41
- y + cells.map do |cell|
41
+ vleft + cells.map do |cell|
42
42
  cell.render(line)
43
- end.join(y) + y
43
+ end.join(vcenter) + vright
44
44
  end.join("\n")
45
45
  end
46
46
 
47
47
  def number_of_columns
48
48
  @cells.collect(&:colspan).inject(0, &:+)
49
49
  end
50
+
51
+ # used to find indices where we have table '+' crossings.
52
+ # in cases where the colspan > 1, then we will skip over some numbers
53
+ # if colspan is always 1, then the list should be incrementing by 1.
54
+ #
55
+ # skip 0 entry, because it's the left side.
56
+ # skip last entry, because it's the right side.
57
+ # we only care about "+/T" style crossings.
58
+ def crossings
59
+ idx = 0
60
+ @cells[0...-1].map { |c| idx += c.colspan }
61
+ end
62
+
50
63
  end
64
+
51
65
  end
52
66
  end