brakeman 6.2.1 → 6.2.2

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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +10 -0
  3. data/README.md +0 -1
  4. data/bundle/load.rb +3 -4
  5. data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/Changelog.md +6 -0
  6. data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/Gemfile +1 -0
  7. data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/README.md +3 -0
  8. data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/version.rb +1 -1
  9. data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline.rb +9 -1
  10. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/config.rb +19 -24
  11. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/face.rb +1 -1
  12. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/io/ansi.rb +8 -0
  13. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/io/windows.rb +24 -14
  14. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/line_editor.rb +39 -48
  15. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/terminfo.rb +1 -1
  16. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/unicode/east_asian_width.rb +1267 -0
  17. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/unicode.rb +14 -39
  18. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/version.rb +3 -0
  19. data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline.rb +7 -4
  20. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/NEWS.md +43 -0
  21. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/attribute.rb +3 -2
  22. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/document.rb +5 -1
  23. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/entity.rb +5 -2
  24. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/baseparser.rb +9 -4
  25. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/pullparser.rb +8 -0
  26. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/sax2parser.rb +10 -0
  27. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/streamparser.rb +8 -0
  28. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/rexml.rb +1 -1
  29. data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/text.rb +5 -3
  30. data/lib/brakeman/checks/check_eol_rails.rb +6 -0
  31. data/lib/brakeman/checks/check_execute.rb +28 -0
  32. data/lib/brakeman/version.rb +1 -1
  33. metadata +115 -133
  34. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/README.md +0 -46
  35. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/Makefile +0 -270
  36. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.c +0 -1838
  37. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.o +0 -0
  38. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/console.so +0 -0
  39. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/extconf.rb +0 -43
  40. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/ext/io/console/win32_vk.inc +0 -1391
  41. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/lib/io/console/size.rb +0 -23
  42. data/bundle/ruby/3.1.0/gems/io-console-0.7.2/lib/io/console.so +0 -0
  43. data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/unicode/east_asian_width.rb +0 -1196
  44. data/bundle/ruby/3.1.0/gems/reline-0.5.9/lib/reline/version.rb +0 -3
  45. data/bundle/ruby/3.1.0/gems/rexml-3.3.6/LICENSE.txt +0 -22
  46. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/COPYING +0 -56
  47. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/LICENSE.txt +0 -22
  48. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/Makefile +0 -268
  49. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/extconf.rb +0 -10
  50. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.c +0 -1741
  51. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.o +0 -0
  52. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/ext/strscan/strscan.so +0 -0
  53. data/bundle/ruby/3.1.0/gems/strscan-3.1.0/lib/strscan.so +0 -0
  54. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/AUTHORS +0 -0
  55. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/COPYING +0 -0
  56. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/LICENSE +0 -0
  57. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/TODO +0 -0
  58. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/highline.gemspec +0 -0
  59. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/builtin_styles.rb +0 -0
  60. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/color_scheme.rb +0 -0
  61. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/compatibility.rb +0 -0
  62. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/custom_errors.rb +0 -0
  63. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/import.rb +0 -0
  64. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/io_console_compatible.rb +0 -0
  65. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/list.rb +0 -0
  66. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/list_renderer.rb +0 -0
  67. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/menu/item.rb +0 -0
  68. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/menu.rb +0 -0
  69. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/paginator.rb +0 -0
  70. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/question/answer_converter.rb +0 -0
  71. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/question.rb +0 -0
  72. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/question_asker.rb +0 -0
  73. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/simulate.rb +0 -0
  74. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/statement.rb +0 -0
  75. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/string.rb +0 -0
  76. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/string_extensions.rb +0 -0
  77. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/style.rb +0 -0
  78. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/template_renderer.rb +0 -0
  79. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/terminal/io_console.rb +0 -0
  80. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/terminal/ncurses.rb +0 -0
  81. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/terminal/unix_stty.rb +0 -0
  82. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/terminal.rb +0 -0
  83. /data/bundle/ruby/3.1.0/gems/{highline-3.1.0 → highline-3.1.1}/lib/highline/wrapper.rb +0 -0
  84. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/BSDL +0 -0
  85. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/COPYING +0 -0
  86. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/README.md +0 -0
  87. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/history.rb +0 -0
  88. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/io/dumb.rb +0 -0
  89. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/io.rb +0 -0
  90. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor/base.rb +0 -0
  91. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor/composite.rb +0 -0
  92. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor/emacs.rb +0 -0
  93. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor/vi_command.rb +0 -0
  94. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor/vi_insert.rb +0 -0
  95. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_actor.rb +0 -0
  96. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/key_stroke.rb +0 -0
  97. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/lib/reline/kill_ring.rb +0 -0
  98. /data/bundle/ruby/3.1.0/gems/{reline-0.5.9 → reline-0.5.10}/license_of_rb-readline +0 -0
  99. /data/bundle/ruby/3.1.0/gems/{io-console-0.7.2 → rexml-3.3.8}/LICENSE.txt +0 -0
  100. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/README.md +0 -0
  101. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/attlistdecl.rb +0 -0
  102. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/cdata.rb +0 -0
  103. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/child.rb +0 -0
  104. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/comment.rb +0 -0
  105. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/doctype.rb +0 -0
  106. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/dtd/attlistdecl.rb +0 -0
  107. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/dtd/dtd.rb +0 -0
  108. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/dtd/elementdecl.rb +0 -0
  109. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/dtd/entitydecl.rb +0 -0
  110. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/dtd/notationdecl.rb +0 -0
  111. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/element.rb +0 -0
  112. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/encoding.rb +0 -0
  113. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/formatters/default.rb +0 -0
  114. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/formatters/pretty.rb +0 -0
  115. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/formatters/transitive.rb +0 -0
  116. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/functions.rb +0 -0
  117. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/instruction.rb +0 -0
  118. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/light/node.rb +0 -0
  119. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/namespace.rb +0 -0
  120. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/node.rb +0 -0
  121. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/output.rb +0 -0
  122. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parent.rb +0 -0
  123. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parseexception.rb +0 -0
  124. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/lightparser.rb +0 -0
  125. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/treeparser.rb +0 -0
  126. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/ultralightparser.rb +0 -0
  127. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/parsers/xpathparser.rb +0 -0
  128. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/quickpath.rb +0 -0
  129. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/sax2listener.rb +0 -0
  130. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/security.rb +0 -0
  131. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/source.rb +0 -0
  132. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/streamlistener.rb +0 -0
  133. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/undefinednamespaceexception.rb +0 -0
  134. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/validation/relaxng.rb +0 -0
  135. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/validation/validation.rb +0 -0
  136. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/validation/validationexception.rb +0 -0
  137. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/xmldecl.rb +0 -0
  138. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/xmltokens.rb +0 -0
  139. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/xpath.rb +0 -0
  140. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml/xpath_parser.rb +0 -0
  141. /data/bundle/ruby/3.1.0/gems/{rexml-3.3.6 → rexml-3.3.8}/lib/rexml.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5800b4b2bc77ea0333be0de0542b0a2e6a45462bb3648f99102fbd917f7b096
4
- data.tar.gz: 2183afeb2101d19479abe05a6a614aa8a972947eddba18f708d4de2813f5a93f
3
+ metadata.gz: cf4fe6bd864ca4c38eeafab29e0e92c025dca7054dbe9caf887029fad46b8a37
4
+ data.tar.gz: ef08764d443287b902752facc0658f79c6d977cd2351820f5ef1953e578992ff
5
5
  SHA512:
6
- metadata.gz: fb1592692129b9008173f5ab95c974165c8ac3727e2f59a5aca74297df592d5b9a19e4967a3f1406dfadd5d3f53fe138e823ae56cb7eec5b02eef0bd5f61ddae
7
- data.tar.gz: a45cc311f4e71832730147c78e97b4298dc18ac70a756329416a7612c355067aaffce5c215303254043d29b0da2b021eac3c8d48067bb930f8a085d2ae6a3239
6
+ metadata.gz: 3dfce43134e8995513b9e5bc97459d8a2cc26ee50ceddcb500fbdffb9597eedbed6fd2e01bccbdeb14df81f6973604d01ef84e3ab02e556394498e01a09e0b8e
7
+ data.tar.gz: 4cccdf4a2d959dfefb7bfb7bf39a53599fb3cc425672e52a83417170cb618dbfae17c89e09676680c907cc8e1fd912cafa82025184af506a1c51fe183c3c9f72
data/CHANGES.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 6.2.2 - 2024-10-15
2
+
3
+ * Ignore more native gems when building gem
4
+ * Revamp command injection in `pipeline*` calls
5
+ * New end-of-support dates for Rails
6
+
7
+ # 6.2.1 - 2024-08-22
8
+
9
+ Just a packaging fix for brakeman.gem
10
+
1
11
  # 6.2.0 - 2024-08-22
2
12
 
3
13
  * Add `--show-ignored` option (Gabriel Zayas)
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Build Status](https://circleci.com/gh/presidentbeef/brakeman.svg?style=svg)](https://circleci.com/gh/presidentbeef/brakeman)
4
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/1b08a5c74695cb0d11ec/test_coverage)](https://codeclimate.com/github/presidentbeef/brakeman/test_coverage)
5
- [![Gitter](https://badges.gitter.im/presidentbeef/brakeman.svg)](https://gitter.im/presidentbeef/brakeman)
6
5
 
7
6
  # Brakeman
8
7
 
data/bundle/load.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  path = File.expand_path('../..', __FILE__)
2
2
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib"
3
3
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/haml-5.2.2/lib"
4
- $:.unshift "#{path}/bundle/ruby/3.1.0/gems/highline-3.1.0/lib"
5
- $:.unshift "#{path}/bundle/ruby/3.1.0/gems/io-console-0.7.2/lib"
4
+ $:.unshift "#{path}/bundle/ruby/3.1.0/gems/highline-3.1.1/lib"
6
5
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/parallel-1.26.3/lib"
7
- $:.unshift "#{path}/bundle/ruby/3.1.0/gems/reline-0.5.9/lib"
8
- $:.unshift "#{path}/bundle/ruby/3.1.0/gems/rexml-3.3.6/lib"
6
+ $:.unshift "#{path}/bundle/ruby/3.1.0/gems/reline-0.5.10/lib"
7
+ $:.unshift "#{path}/bundle/ruby/3.1.0/gems/rexml-3.3.8/lib"
9
8
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/ruby2ruby-2.5.1/lib"
10
9
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib"
11
10
  $:.unshift "#{path}/bundle/ruby/3.1.0/gems/sexp_processor-4.17.2/lib"
@@ -2,6 +2,12 @@
2
2
 
3
3
  Below is a complete listing of changes for each revision of HighLine.
4
4
 
5
+ ### 3.1.1 / 2024-08-18
6
+ * PR #276 - Update #say to always flush the output after a #puts (@blipper)
7
+ * PR #274 / I #273 (@costa)
8
+ * Add Highline#add_to_color_scheme
9
+ * Dockerize the test environment. Just run `bin/test` and voilá!
10
+
5
11
  ### 3.1.0 / 2024-07-15
6
12
  * PR #272 / I #271 - Readline is now completed deprecated over Reline (@abinoam, issue by @64kramsystem)
7
13
  * PR #269 - Provide a 'Changelog' link on rubygems.org/gems/highline (@mark-young-atg)
@@ -13,6 +13,7 @@ group :code_quality do
13
13
  gem "flog", require: false
14
14
  gem "pronto", require: false, platform: :ruby
15
15
  gem "pronto-flay", require: false, platform: :ruby
16
+ gem "path_expander", "1.1.1", require: false # Remove this lock when path_expander > 1.1.2 and flay > 2.13.3 is released.
16
17
  # gem "pronto-poper", require: false, platform: :ruby
17
18
  gem "pronto-reek", require: false, platform: :ruby
18
19
  gem "pronto-rubocop", require: false, platform: :ruby
@@ -206,6 +206,9 @@ Contributing
206
206
  - ```rake acceptance```
207
207
  - ```pronto run```
208
208
 
209
+ Alternatively, if you're in a [Docker](https://www.docker.com)ised environment,
210
+ don't care about installing anything locally -- just run `bin/test` instead.
211
+
209
212
  8. Commit your changes
210
213
  - ```git commit -am "Your commit message"```
211
214
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  class HighLine
4
4
  # The version of the installed library.
5
- VERSION = "3.1.0".freeze
5
+ VERSION = "3.1.1".freeze
6
6
  end
@@ -61,6 +61,14 @@ class HighLine
61
61
  true if @color_scheme
62
62
  end
63
63
 
64
+ # Pass a +Hash+ to add +new+ colors to the current scheme.
65
+ def add_to_color_scheme(hash)
66
+ old_hash = (color_scheme || {}).to_hash
67
+ fail "Overlapping color schemes: #{old_hash.keys & hash.keys}" unless
68
+ (old_hash.keys & hash.keys).empty?
69
+ self.color_scheme = ColorScheme.new(old_hash.merge hash)
70
+ end
71
+
64
72
  # Reset color scheme to default (+nil+)
65
73
  def reset_color_scheme
66
74
  self.color_scheme = nil
@@ -377,10 +385,10 @@ class HighLine
377
385
  # if statement ends with whitespace before a color escape code.
378
386
  if /[ \t](\e\[\d+(;\d+)*m)?\Z/ =~ statement
379
387
  output.print(statement)
380
- output.flush
381
388
  else
382
389
  output.puts(statement)
383
390
  end
391
+ output.flush # See: https://github.com/JEG2/highline/pull/276
384
392
  end
385
393
 
386
394
  # Renders and indents a statement.
@@ -29,6 +29,17 @@ class Reline::Config
29
29
  attr_accessor :autocompletion
30
30
 
31
31
  def initialize
32
+ reset_variables
33
+ end
34
+
35
+ def reset
36
+ if editing_mode_is?(:vi_command)
37
+ @editing_mode_label = :vi_insert
38
+ end
39
+ @oneshot_key_bindings.clear
40
+ end
41
+
42
+ def reset_variables
32
43
  @additional_key_bindings = { # from inputrc
33
44
  emacs: Reline::KeyActor::Base.new,
34
45
  vi_insert: Reline::KeyActor::Base.new,
@@ -51,16 +62,11 @@ class Reline::Config
51
62
  @keyseq_timeout = 500
52
63
  @test_mode = false
53
64
  @autocompletion = false
54
- @convert_meta = true if seven_bit_encoding?(Reline::IOGate.encoding)
65
+ @convert_meta = seven_bit_encoding?(Reline::IOGate.encoding)
55
66
  @loaded = false
56
67
  @enable_bracketed_paste = true
57
- end
58
-
59
- def reset
60
- if editing_mode_is?(:vi_command)
61
- @editing_mode_label = :vi_insert
62
- end
63
- @oneshot_key_bindings.clear
68
+ @show_mode_in_prompt = false
69
+ @default_inputrc_path = nil
64
70
  end
65
71
 
66
72
  def editing_mode
@@ -245,22 +251,6 @@ class Reline::Config
245
251
  rescue ArgumentError
246
252
  @history_size = 500
247
253
  end
248
- when 'bell-style'
249
- @bell_style =
250
- case value
251
- when 'none', 'off'
252
- :none
253
- when 'audible', 'on'
254
- :audible
255
- when 'visible'
256
- :visible
257
- else
258
- :audible
259
- end
260
- when 'comment-begin'
261
- @comment_begin = value.dup
262
- when 'completion-query-items'
263
- @completion_query_items = value.to_i
264
254
  when 'isearch-terminators'
265
255
  @isearch_terminators = retrieve_string(raw_value)
266
256
  when 'editing-mode'
@@ -376,6 +366,11 @@ class Reline::Config
376
366
  ret
377
367
  end
378
368
 
369
+ def reload
370
+ reset_variables
371
+ read
372
+ end
373
+
379
374
  private def seven_bit_encoding?(encoding)
380
375
  encoding == Encoding::US_ASCII
381
376
  end
@@ -107,7 +107,7 @@ class Reline::Face
107
107
 
108
108
  def sgr_rgb_256color(key, value)
109
109
  # 256 colors are
110
- # 0..15: standard colors, hight intensity colors
110
+ # 0..15: standard colors, high intensity colors
111
111
  # 16..232: 216 colors (R, G, B each 6 steps)
112
112
  # 233..255: grayscale colors (24 steps)
113
113
  # This methods converts rgb_expression to 216 colors
@@ -347,6 +347,13 @@ class Reline::ANSI < Reline::IO
347
347
 
348
348
  def set_winch_handler(&handler)
349
349
  @old_winch_handler = Signal.trap('WINCH', &handler)
350
+ @old_cont_handler = Signal.trap('CONT') do
351
+ @input.raw!(intr: true) if @input.tty?
352
+ # Rerender the screen. Note that screen size might be changed while suspended.
353
+ handler.call
354
+ end
355
+ rescue ArgumentError
356
+ # Signal.trap may raise an ArgumentError if the platform doesn't support the signal.
350
357
  end
351
358
 
352
359
  def prep
@@ -360,5 +367,6 @@ class Reline::ANSI < Reline::IO
360
367
  # Disable bracketed paste
361
368
  @output.write "\e[?2004l" if Reline.core.config.enable_bracketed_paste && both_tty?
362
369
  Signal.trap('WINCH', @old_winch_handler) if @old_winch_handler
370
+ Signal.trap('CONT', @old_cont_handler) if @old_cont_handler
363
371
  end
364
372
  end
@@ -159,14 +159,24 @@ class Reline::Windows < Reline::IO
159
159
  FILE_NAME_INFO = 2
160
160
  ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
161
161
 
162
+ # Calling Win32API with console handle is reported to fail after executing some external command.
163
+ # We need to refresh console handle and retry the call again.
164
+ private def call_with_console_handle(win32func, *args)
165
+ val = win32func.call(@hConsoleHandle, *args)
166
+ return val if val != 0
167
+
168
+ @hConsoleHandle = @GetStdHandle.call(STD_OUTPUT_HANDLE)
169
+ win32func.call(@hConsoleHandle, *args)
170
+ end
171
+
162
172
  private def getconsolemode
163
173
  mode = "\000\000\000\000"
164
- @GetConsoleMode.call(@hConsoleHandle, mode)
174
+ call_with_console_handle(@GetConsoleMode, mode)
165
175
  mode.unpack1('L')
166
176
  end
167
177
 
168
178
  private def setconsolemode(mode)
169
- @SetConsoleMode.call(@hConsoleHandle, mode)
179
+ call_with_console_handle(@SetConsoleMode, mode)
170
180
  end
171
181
 
172
182
  #if @legacy_console
@@ -334,7 +344,7 @@ class Reline::Windows < Reline::IO
334
344
  # [18,2] dwMaximumWindowSize.X
335
345
  # [20,2] dwMaximumWindowSize.Y
336
346
  csbi = 0.chr * 22
337
- return if @GetConsoleScreenBufferInfo.call(@hConsoleHandle, csbi) == 0
347
+ return if call_with_console_handle(@GetConsoleScreenBufferInfo, csbi) == 0
338
348
  csbi
339
349
  end
340
350
 
@@ -355,14 +365,14 @@ class Reline::Windows < Reline::IO
355
365
  end
356
366
 
357
367
  def move_cursor_column(val)
358
- @SetConsoleCursorPosition.call(@hConsoleHandle, cursor_pos.y * 65536 + val)
368
+ call_with_console_handle(@SetConsoleCursorPosition, cursor_pos.y * 65536 + val)
359
369
  end
360
370
 
361
371
  def move_cursor_up(val)
362
372
  if val > 0
363
373
  y = cursor_pos.y - val
364
374
  y = 0 if y < 0
365
- @SetConsoleCursorPosition.call(@hConsoleHandle, y * 65536 + cursor_pos.x)
375
+ call_with_console_handle(@SetConsoleCursorPosition, y * 65536 + cursor_pos.x)
366
376
  elsif val < 0
367
377
  move_cursor_down(-val)
368
378
  end
@@ -374,7 +384,7 @@ class Reline::Windows < Reline::IO
374
384
  screen_height = get_screen_size.first
375
385
  y = cursor_pos.y + val
376
386
  y = screen_height - 1 if y > (screen_height - 1)
377
- @SetConsoleCursorPosition.call(@hConsoleHandle, (cursor_pos.y + val) * 65536 + cursor_pos.x)
387
+ call_with_console_handle(@SetConsoleCursorPosition, (cursor_pos.y + val) * 65536 + cursor_pos.x)
378
388
  elsif val < 0
379
389
  move_cursor_up(-val)
380
390
  end
@@ -385,8 +395,8 @@ class Reline::Windows < Reline::IO
385
395
  attributes = csbi[8, 2].unpack1('S')
386
396
  cursor = csbi[4, 4].unpack1('L')
387
397
  written = 0.chr * 4
388
- @FillConsoleOutputCharacter.call(@hConsoleHandle, 0x20, get_screen_size.last - cursor_pos.x, cursor, written)
389
- @FillConsoleOutputAttribute.call(@hConsoleHandle, attributes, get_screen_size.last - cursor_pos.x, cursor, written)
398
+ call_with_console_handle(@FillConsoleOutputCharacter, 0x20, get_screen_size.last - cursor_pos.x, cursor, written)
399
+ call_with_console_handle(@FillConsoleOutputAttribute, attributes, get_screen_size.last - cursor_pos.x, cursor, written)
390
400
  end
391
401
 
392
402
  def scroll_down(val)
@@ -404,7 +414,7 @@ class Reline::Windows < Reline::IO
404
414
  scroll_rectangle = [0, val, buffer_width, buffer_lines - val].pack('s4')
405
415
  destination_origin = 0 # y * 65536 + x
406
416
  fill = [' '.ord, attributes].pack('SS')
407
- @ScrollConsoleScreenBuffer.call(@hConsoleHandle, scroll_rectangle, nil, destination_origin, fill)
417
+ call_with_console_handle(@ScrollConsoleScreenBuffer, scroll_rectangle, nil, destination_origin, fill)
408
418
  else
409
419
  origin_x = x + 1
410
420
  origin_y = y - window_top + 1
@@ -423,9 +433,9 @@ class Reline::Windows < Reline::IO
423
433
  fill_length = buffer_width * (window_bottom - window_top + 1)
424
434
  screen_topleft = window_top * 65536
425
435
  written = 0.chr * 4
426
- @FillConsoleOutputCharacter.call(@hConsoleHandle, 0x20, fill_length, screen_topleft, written)
427
- @FillConsoleOutputAttribute.call(@hConsoleHandle, attributes, fill_length, screen_topleft, written)
428
- @SetConsoleCursorPosition.call(@hConsoleHandle, screen_topleft)
436
+ call_with_console_handle(@FillConsoleOutputCharacter, 0x20, fill_length, screen_topleft, written)
437
+ call_with_console_handle(@FillConsoleOutputAttribute, attributes, fill_length, screen_topleft, written)
438
+ call_with_console_handle(@SetConsoleCursorPosition, screen_topleft)
429
439
  else
430
440
  @output.write "\e[2J" "\e[H"
431
441
  end
@@ -439,14 +449,14 @@ class Reline::Windows < Reline::IO
439
449
  size = 100
440
450
  visible = 0 # 0 means false
441
451
  cursor_info = [size, visible].pack('Li')
442
- @SetConsoleCursorInfo.call(@hConsoleHandle, cursor_info)
452
+ call_with_console_handle(@SetConsoleCursorInfo, cursor_info)
443
453
  end
444
454
 
445
455
  def show_cursor
446
456
  size = 100
447
457
  visible = 1 # 1 means true
448
458
  cursor_info = [size, visible].pack('Li')
449
- @SetConsoleCursorInfo.call(@hConsoleHandle, cursor_info)
459
+ call_with_console_handle(@SetConsoleCursorInfo, cursor_info)
450
460
  end
451
461
 
452
462
  def set_winch_handler(&handler)
@@ -176,9 +176,8 @@ class Reline::LineEditor
176
176
  scroll_into_view
177
177
  Reline::IOGate.move_cursor_up @rendered_screen.cursor_y
178
178
  @rendered_screen.base_y = Reline::IOGate.cursor_pos.y
179
- @rendered_screen.lines = []
180
- @rendered_screen.cursor_y = 0
181
- render_differential
179
+ clear_rendered_screen_cache
180
+ render
182
181
  end
183
182
 
184
183
  private def handle_interrupted
@@ -186,11 +185,11 @@ class Reline::LineEditor
186
185
 
187
186
  @interrupted = false
188
187
  clear_dialogs
189
- scrolldown = render_differential
190
- Reline::IOGate.scroll_down scrolldown
188
+ render
189
+ cursor_to_bottom_offset = @rendered_screen.lines.size - @rendered_screen.cursor_y
190
+ Reline::IOGate.scroll_down cursor_to_bottom_offset
191
191
  Reline::IOGate.move_cursor_column 0
192
- @rendered_screen.lines = []
193
- @rendered_screen.cursor_y = 0
192
+ clear_rendered_screen_cache
194
193
  case @old_trap
195
194
  when 'DEFAULT', 'SYSTEM_DEFAULT'
196
195
  raise Interrupt
@@ -460,28 +459,7 @@ class Reline::LineEditor
460
459
  end
461
460
 
462
461
  def render_finished
463
- clear_rendered_lines
464
- render_full_content
465
- end
466
-
467
- def clear_rendered_lines
468
- Reline::IOGate.move_cursor_up @rendered_screen.cursor_y
469
- Reline::IOGate.move_cursor_column 0
470
-
471
- num_lines = @rendered_screen.lines.size
472
- return unless num_lines && num_lines >= 1
473
-
474
- Reline::IOGate.move_cursor_down num_lines - 1
475
- (num_lines - 1).times do
476
- Reline::IOGate.erase_after_cursor
477
- Reline::IOGate.move_cursor_up 1
478
- end
479
- Reline::IOGate.erase_after_cursor
480
- @rendered_screen.lines = []
481
- @rendered_screen.cursor_y = 0
482
- end
483
-
484
- def render_full_content
462
+ render_differential([], 0, 0)
485
463
  lines = @buffer_of_lines.size.times.map do |i|
486
464
  line = prompt_list[i] + modified_lines[i]
487
465
  wrapped_lines, = split_by_width(line, screen_width)
@@ -490,19 +468,13 @@ class Reline::LineEditor
490
468
  @output.puts lines.map { |l| "#{l}\r\n" }.join
491
469
  end
492
470
 
493
- def print_nomultiline_prompt(prompt)
494
- return unless prompt && !@is_multiline
495
-
471
+ def print_nomultiline_prompt
496
472
  # Readline's test `TestRelineAsReadline#test_readline` requires first output to be prompt, not cursor reset escape sequence.
497
- @rendered_screen.lines = [[[0, Reline::Unicode.calculate_width(prompt, true), prompt]]]
498
- @rendered_screen.cursor_y = 0
499
- @output.write prompt
473
+ @output.write @prompt if @prompt && !@is_multiline
500
474
  end
501
475
 
502
- def render_differential
476
+ def render
503
477
  wrapped_cursor_x, wrapped_cursor_y = wrapped_cursor_position
504
-
505
- rendered_lines = @rendered_screen.lines
506
478
  new_lines = wrapped_prompt_and_input_lines.flatten(1)[screen_scroll_top, screen_height].map do |prompt, line|
507
479
  prompt_width = Reline::Unicode.calculate_width(prompt, true)
508
480
  [[0, prompt_width, prompt], [prompt_width, Reline::Unicode.calculate_width(line, true), line]]
@@ -520,12 +492,21 @@ class Reline::LineEditor
520
492
  x_range, y_range = dialog_range dialog, wrapped_cursor_y - screen_scroll_top
521
493
  y_range.each do |row|
522
494
  next if row < 0 || row >= screen_height
495
+
523
496
  dialog_rows = new_lines[row] ||= []
524
497
  # index 0 is for prompt, index 1 is for line, index 2.. is for dialog
525
498
  dialog_rows[index + 2] = [x_range.begin, dialog.width, dialog.contents[row - y_range.begin]]
526
499
  end
527
500
  end
528
501
 
502
+ render_differential new_lines, wrapped_cursor_x, wrapped_cursor_y - screen_scroll_top
503
+ end
504
+
505
+ # Reflects lines to be rendered and new cursor position to the screen
506
+ # by calculating the difference from the previous render.
507
+
508
+ private def render_differential(new_lines, new_cursor_x, new_cursor_y)
509
+ rendered_lines = @rendered_screen.lines
529
510
  cursor_y = @rendered_screen.cursor_y
530
511
  if new_lines != rendered_lines
531
512
  # Hide cursor while rendering to avoid cursor flickering.
@@ -552,11 +533,14 @@ class Reline::LineEditor
552
533
  @rendered_screen.lines = new_lines
553
534
  Reline::IOGate.show_cursor
554
535
  end
555
- y = wrapped_cursor_y - screen_scroll_top
556
- Reline::IOGate.move_cursor_column wrapped_cursor_x
557
- Reline::IOGate.move_cursor_down y - cursor_y
558
- @rendered_screen.cursor_y = y
559
- new_lines.size - y
536
+ Reline::IOGate.move_cursor_column new_cursor_x
537
+ Reline::IOGate.move_cursor_down new_cursor_y - cursor_y
538
+ @rendered_screen.cursor_y = new_cursor_y
539
+ end
540
+
541
+ private def clear_rendered_screen_cache
542
+ @rendered_screen.lines = []
543
+ @rendered_screen.cursor_y = 0
560
544
  end
561
545
 
562
546
  def upper_space_height(wrapped_cursor_y)
@@ -568,7 +552,7 @@ class Reline::LineEditor
568
552
  end
569
553
 
570
554
  def rerender
571
- render_differential unless @in_pasting
555
+ render unless @in_pasting
572
556
  end
573
557
 
574
558
  class DialogProcScope
@@ -1337,7 +1321,7 @@ class Reline::LineEditor
1337
1321
  @confirm_multiline_termination_proc.(temp_buffer.join("\n") + "\n")
1338
1322
  end
1339
1323
 
1340
- def insert_pasted_text(text)
1324
+ def insert_multiline_text(text)
1341
1325
  save_old_buffer
1342
1326
  pre = @buffer_of_lines[@line_index].byteslice(0, @byte_pointer)
1343
1327
  post = @buffer_of_lines[@line_index].byteslice(@byte_pointer..)
@@ -1982,9 +1966,8 @@ class Reline::LineEditor
1982
1966
  private def ed_clear_screen(key)
1983
1967
  Reline::IOGate.clear_screen
1984
1968
  @screen_size = Reline::IOGate.get_screen_size
1985
- @rendered_screen.lines = []
1986
1969
  @rendered_screen.base_y = 0
1987
- @rendered_screen.cursor_y = 0
1970
+ clear_rendered_screen_cache
1988
1971
  end
1989
1972
  alias_method :clear_screen, :ed_clear_screen
1990
1973
 
@@ -2259,9 +2242,11 @@ class Reline::LineEditor
2259
2242
  line, cut = byteslice!(current_line, @byte_pointer, byte_pointer_diff)
2260
2243
  elsif byte_pointer_diff < 0
2261
2244
  line, cut = byteslice!(current_line, @byte_pointer + byte_pointer_diff, -byte_pointer_diff)
2245
+ else
2246
+ return
2262
2247
  end
2263
2248
  copy_for_vi(cut)
2264
- set_current_line(line || '', @byte_pointer + (byte_pointer_diff < 0 ? byte_pointer_diff : 0))
2249
+ set_current_line(line, @byte_pointer + (byte_pointer_diff < 0 ? byte_pointer_diff : 0))
2265
2250
  end
2266
2251
 
2267
2252
  private def vi_yank(key, arg: nil)
@@ -2280,6 +2265,8 @@ class Reline::LineEditor
2280
2265
  cut = current_line.byteslice(@byte_pointer, byte_pointer_diff)
2281
2266
  elsif byte_pointer_diff < 0
2282
2267
  cut = current_line.byteslice(@byte_pointer + byte_pointer_diff, -byte_pointer_diff)
2268
+ else
2269
+ return
2283
2270
  end
2284
2271
  copy_for_vi(cut)
2285
2272
  end
@@ -2554,4 +2541,8 @@ class Reline::LineEditor
2554
2541
  private def set_next_action_state(type, value)
2555
2542
  @next_action_state = [type, value]
2556
2543
  end
2544
+
2545
+ private def re_read_init_file(_key)
2546
+ @config.reload
2547
+ end
2557
2548
  end
@@ -83,7 +83,7 @@ module Reline::Terminfo
83
83
  end
84
84
 
85
85
  def self.setupterm(term, fildes)
86
- errret_int = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)
86
+ errret_int = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT, Fiddle::RUBY_FREE)
87
87
  ret = @setupterm.(term, fildes, errret_int)
88
88
  case ret
89
89
  when 0 # OK