tdiary 5.6.0 → 5.7.0

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 (285) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +61 -59
  4. data/doc/HOWTO-authenticate-in-rack.md +3 -3
  5. data/doc/HOWTO-make-theme.md +3 -3
  6. data/js/00default.js +22 -12
  7. data/js/caretposition.js +1 -0
  8. data/js/draft.js +228 -51
  9. data/js/image.js +126 -29
  10. data/js/preview.js +12 -50
  11. data/js/update.js +54 -0
  12. data/js/update_preview.js +79 -0
  13. data/lib/aws/pa_api.rb +7 -7
  14. data/lib/tdiary/admin.rb +66 -3
  15. data/lib/tdiary/cli.rb +14 -10
  16. data/lib/tdiary/core_ext.rb +46 -8
  17. data/lib/tdiary/dispatcher/update_main.rb +6 -0
  18. data/lib/tdiary/io/plugin_pstore.rb +2 -1
  19. data/lib/tdiary/plugin/00default.rb +3 -0
  20. data/lib/tdiary/rack/auth/basic.rb +72 -9
  21. data/lib/tdiary/tasks/auth.rake +2 -4
  22. data/lib/tdiary/tasks/release.rake +5 -4
  23. data/lib/tdiary/version.rb +1 -1
  24. data/lib/tdiary.rb +3 -0
  25. data/misc/plugin/amazon.rb +48 -11
  26. data/misc/plugin/amazon_rakuten.rb +79 -0
  27. data/misc/plugin/draft.rb +83 -0
  28. data/misc/plugin/en/image.rb +5 -0
  29. data/misc/plugin/en/makerss.rb +4 -0
  30. data/misc/plugin/en/preview.rb +0 -2
  31. data/misc/plugin/image.rb +19 -13
  32. data/misc/plugin/ja/makerss.rb +3 -0
  33. data/misc/plugin/ja/preview.rb +0 -2
  34. data/misc/plugin/makerss.rb +5 -4
  35. data/misc/plugin/my-sequel.rb +1 -0
  36. data/misc/plugin/preview.rb +0 -8
  37. data/theme/base.css +32 -2
  38. data/theme/conf.css +60 -0
  39. data/theme/default/default.css +33 -8
  40. data/vendor/bundle/ruby/3.4.0/cache/bcrypt-3.1.22.gem +0 -0
  41. data/vendor/bundle/ruby/3.4.0/cache/date-3.6.0.gem +0 -0
  42. data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.3.gem +0 -0
  43. data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.8.gem +0 -0
  44. data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.4.0.gem +0 -0
  45. data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.2.gem +0 -0
  46. data/vendor/bundle/ruby/3.4.0/cache/pstore-0.3.0.gem +0 -0
  47. data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.8.gem +0 -0
  48. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/bcrypt_ext.so +0 -0
  49. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/gem_make.out +28 -0
  50. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/cgi/escape.so +0 -0
  51. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/gem_make.out +6 -6
  52. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/date_core.so +0 -0
  53. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem.build_complete +0 -0
  54. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem_make.out +26 -0
  55. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/mkmf.log +140 -0
  56. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/CHANGELOG +127 -0
  57. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/COPYING +28 -0
  58. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/README.md +192 -0
  59. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/jruby/bcrypt_jruby/BCrypt.java +926 -0
  60. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/Makefile +273 -0
  61. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/bcrypt_ext.c +125 -0
  62. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.c +57 -0
  63. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.h +24 -0
  64. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.c +903 -0
  65. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.h +27 -0
  66. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.c +124 -0
  67. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.h +30 -0
  68. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/extconf.rb +22 -0
  69. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/ow-crypt.h +43 -0
  70. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/wrapper.c +554 -0
  71. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/x86.S +203 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/engine.rb +134 -0
  73. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/error.rb +22 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/password.rb +106 -0
  75. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt.rb +16 -0
  76. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt_ext.so +0 -0
  77. data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/ext/cgi/escape/Makefile +3 -3
  78. data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/lib/cgi/escape.so +0 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +4 -4
  80. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
  81. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
  82. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
  83. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
  84. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
  85. data/vendor/bundle/ruby/3.4.0/gems/date-3.6.0/lib/date_core.so +0 -0
  86. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/avif.rb +1 -0
  87. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/fiber_stream.rb +6 -1
  88. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/heic.rb +1 -0
  89. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/iso_bmff.rb +15 -5
  90. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxl.rb +1 -0
  91. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/version.rb +1 -1
  92. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/Gemfile +3 -3
  93. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/README.md +103 -0
  94. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/Rakefile +74 -0
  95. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/command_data.rb +13 -10
  96. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_accessors.rb +2 -2
  97. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_type_coercion.rb +14 -26
  98. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config.rb +63 -3
  99. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/esearch_result.rb +2 -2
  100. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/fetch_data.rb +5 -5
  101. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_data.rb +79 -79
  102. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser/parser_utils.rb +1 -1
  103. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser.rb +2 -1
  104. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/client_adapter.rb +6 -6
  105. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/search_result.rb +4 -6
  106. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sequence_set.rb +413 -52
  107. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/lib/net/imap/utils.rb +49 -0
  108. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap.rb +195 -46
  109. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rdoc.rake +24 -0
  110. data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/lib/net/protocol.rb +38 -23
  111. data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp.rb +5 -8
  112. data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/lib/pstore.rb +52 -31
  113. data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/pstore.gemspec +1 -0
  114. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CHANGELOG.md +34 -0
  115. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/parser.rb +7 -2
  116. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/uploaded_file.rb +1 -0
  117. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/request.rb +5 -2
  118. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/static.rb +1 -1
  119. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/version.rb +1 -1
  120. data/vendor/bundle/ruby/3.4.0/specifications/bcrypt-3.1.22.gemspec +33 -0
  121. data/vendor/bundle/ruby/3.4.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
  122. data/vendor/bundle/ruby/3.4.0/specifications/{fastimage-2.4.1.gemspec → fastimage-2.4.3.gemspec} +3 -3
  123. data/vendor/bundle/ruby/3.4.0/specifications/{net-imap-0.6.6.gemspec → net-imap-0.6.8.gemspec} +3 -3
  124. data/vendor/bundle/ruby/3.4.0/specifications/{net-protocol-0.3.0.gemspec → net-protocol-0.4.0.gemspec} +2 -2
  125. data/vendor/bundle/ruby/3.4.0/specifications/{net-smtp-0.5.1.gemspec → net-smtp-0.5.2.gemspec} +4 -4
  126. data/vendor/bundle/ruby/3.4.0/specifications/{pstore-0.2.1.gemspec → pstore-0.3.0.gemspec} +3 -2
  127. data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.2.7.gemspec → rack-3.2.8.gemspec} +2 -2
  128. data/views/preview.rhtml +2 -1
  129. data/views/preview.rhtml.en +2 -1
  130. data/views/update.rhtml +10 -1
  131. data/views/update.rhtml.en +10 -1
  132. metadata +242 -200
  133. data/misc/plugin/amp.rb +0 -118
  134. data/vendor/bundle/ruby/3.4.0/cache/date-3.5.1.gem +0 -0
  135. data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.1.gem +0 -0
  136. data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.6.gem +0 -0
  137. data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.3.0.gem +0 -0
  138. data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.1.gem +0 -0
  139. data/vendor/bundle/ruby/3.4.0/cache/pstore-0.2.1.gem +0 -0
  140. data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.7.gem +0 -0
  141. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/date_core.so +0 -0
  142. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/gem_make.out +0 -24
  143. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/mkmf.log +0 -93
  144. data/vendor/bundle/ruby/3.4.0/gems/date-3.5.1/lib/date_core.so +0 -0
  145. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/README.md +0 -77
  146. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/Rakefile +0 -24
  147. data/views/amp.rhtml +0 -34
  148. /data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/{date-3.5.1 → bcrypt-3.1.22}/gem.build_complete +0 -0
  149. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
  150. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
  151. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
  152. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
  153. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
  154. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
  155. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
  156. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
  157. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/MIT-LICENSE +0 -0
  158. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/README.md +0 -0
  159. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage.rb +0 -0
  160. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/bmp.rb +0 -0
  161. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/exif.rb +0 -0
  162. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/gif.rb +0 -0
  163. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/ico.rb +0 -0
  164. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/image_base.rb +0 -0
  165. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jpeg.rb +0 -0
  166. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxlc.rb +0 -0
  167. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/png.rb +0 -0
  168. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/psd.rb +0 -0
  169. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/stream_util.rb +0 -0
  170. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/svg.rb +0 -0
  171. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/tiff.rb +0 -0
  172. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/type_parser.rb +0 -0
  173. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/webp.rb +0 -0
  174. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage.rb +0 -0
  175. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/BSDL +0 -0
  176. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/COPYING +0 -0
  177. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/LICENSE.txt +0 -0
  178. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/docs/styles.css +0 -0
  179. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/authenticators.rb +0 -0
  180. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_inheritance.rb +0 -0
  181. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_version_defaults.rb +0 -0
  182. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/connection_state.rb +0 -0
  183. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/data_encoding.rb +0 -0
  184. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/deprecated_client_options.rb +0 -0
  185. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/errors.rb +0 -0
  186. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/flags.rb +0 -0
  187. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_reader.rb +0 -0
  188. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/anonymous_authenticator.rb +0 -0
  189. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authentication_exchange.rb +0 -0
  190. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authenticators.rb +0 -0
  191. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/cram_md5_authenticator.rb +0 -0
  192. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/digest_md5_authenticator.rb +0 -0
  193. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/external_authenticator.rb +0 -0
  194. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/gs2_header.rb +0 -0
  195. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/login_authenticator.rb +0 -0
  196. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/oauthbearer_authenticator.rb +0 -0
  197. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/plain_authenticator.rb +0 -0
  198. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/protocol_adapters.rb +0 -0
  199. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_algorithm.rb +0 -0
  200. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_authenticator.rb +0 -0
  201. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/stringprep.rb +0 -0
  202. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/xoauth2_authenticator.rb +0 -0
  203. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl.rb +0 -0
  204. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl_adapter.rb +0 -0
  205. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/nameprep.rb +0 -0
  206. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep.rb +0 -0
  207. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep_tables.rb +0 -0
  208. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/tables.rb +0 -0
  209. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/trace.rb +0 -0
  210. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep.rb +0 -0
  211. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/uidplus_data.rb +0 -0
  212. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/vanished_data.rb +0 -0
  213. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/net-imap.gemspec +0 -0
  214. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/benchmarks.rake +0 -0
  215. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rfcs.rake +0 -0
  216. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/saslprep.rake +0 -0
  217. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/string_prep_tables_generator.rb +0 -0
  218. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/sample/net-imap.rb +0 -0
  219. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/BSDL +0 -0
  220. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/COPYING +0 -0
  221. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/README.md +0 -0
  222. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/LICENSE.txt +0 -0
  223. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/NEWS.md +0 -0
  224. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/README.md +0 -0
  225. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_cram_md5.rb +0 -0
  226. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_login.rb +0 -0
  227. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_plain.rb +0 -0
  228. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_xoauth2.rb +0 -0
  229. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/authenticator.rb +0 -0
  230. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/net-smtp.gemspec +0 -0
  231. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/BSDL +0 -0
  232. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/COPYING +0 -0
  233. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Gemfile +0 -0
  234. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/README.md +0 -0
  235. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Rakefile +0 -0
  236. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/console +0 -0
  237. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/setup +0 -0
  238. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CONTRIBUTING.md +0 -0
  239. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/MIT-LICENSE +0 -0
  240. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/README.md +0 -0
  241. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/SPEC.rdoc +0 -0
  242. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/handler.rb +0 -0
  243. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/request.rb +0 -0
  244. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/basic.rb +0 -0
  245. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/bad_request.rb +0 -0
  246. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/body_proxy.rb +0 -0
  247. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/builder.rb +0 -0
  248. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/cascade.rb +0 -0
  249. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/common_logger.rb +0 -0
  250. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/conditional_get.rb +0 -0
  251. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/config.rb +0 -0
  252. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/constants.rb +0 -0
  253. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_length.rb +0 -0
  254. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_type.rb +0 -0
  255. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/deflater.rb +0 -0
  256. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/directory.rb +0 -0
  257. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/etag.rb +0 -0
  258. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/events.rb +0 -0
  259. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/files.rb +0 -0
  260. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/head.rb +0 -0
  261. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/headers.rb +0 -0
  262. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lint.rb +0 -0
  263. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lock.rb +0 -0
  264. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/media_type.rb +0 -0
  265. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/method_override.rb +0 -0
  266. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mime.rb +0 -0
  267. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock.rb +0 -0
  268. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_request.rb +0 -0
  269. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_response.rb +0 -0
  270. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/generator.rb +0 -0
  271. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart.rb +0 -0
  272. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/null_logger.rb +0 -0
  273. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/query_parser.rb +0 -0
  274. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/recursive.rb +0 -0
  275. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/reloader.rb +0 -0
  276. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/response.rb +0 -0
  277. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/rewindable_input.rb +0 -0
  278. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/runtime.rb +0 -0
  279. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/sendfile.rb +0 -0
  280. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_exceptions.rb +0 -0
  281. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_status.rb +0 -0
  282. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/tempfile_reaper.rb +0 -0
  283. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/urlmap.rb +0 -0
  284. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/utils.rb +0 -0
  285. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack.rb +0 -0
@@ -2,6 +2,7 @@ module FastImageParsing
2
2
  class Avif < ImageBase # :nodoc:
3
3
  def dimensions
4
4
  bmff = IsoBmff.new(@stream)
5
+ return nil unless bmff.width && bmff.height
5
6
  [bmff.width, bmff.height]
6
7
  end
7
8
 
@@ -13,8 +13,11 @@ module FastImageParsing
13
13
  @str = ''
14
14
  end
15
15
 
16
- # Peeking beyond the end of the input will raise
16
+ # Peeking beyond the end of the input will raise. A negative length would
17
+ # move the cursor backwards, so treat it as unparseable data.
17
18
  def peek(n)
19
+ raise FastImage::CannotParseImage if n < 0
20
+
18
21
  while @strpos + n > @str.size
19
22
  unused_str = @str[@strpos..-1]
20
23
 
@@ -38,6 +41,8 @@ module FastImageParsing
38
41
  end
39
42
 
40
43
  def skip(n)
44
+ raise FastImage::CannotParseImage if n < 0
45
+
41
46
  discarded = 0
42
47
  fetched = @str[@strpos..-1].size
43
48
  while n > fetched
@@ -2,6 +2,7 @@ module FastImageParsing
2
2
  class Heic < ImageBase # :nodoc:
3
3
  def dimensions
4
4
  bmff = IsoBmff.new(@stream)
5
+ return nil unless bmff.width && bmff.height
5
6
  [bmff.width, bmff.height]
6
7
  end
7
8
  end
@@ -27,11 +27,11 @@ module FastImageParsing
27
27
  read_boxes!
28
28
  end
29
29
 
30
- if [90, 270].include?(@rotation)
30
+ if @final_size && [90, 270].include?(@rotation)
31
31
  @final_size.reverse!
32
32
  end
33
-
34
- @width, @height = @final_size
33
+
34
+ @width, @height = @final_size if @final_size
35
35
  end
36
36
 
37
37
  private
@@ -153,8 +153,18 @@ module FastImageParsing
153
153
  def read_box_header!
154
154
  size = read_uint32!
155
155
  type = @stream.read(4)
156
- size = read_uint64! - 8 if size == 1
157
- [type, size - 8]
156
+ if size == 1
157
+ size = read_uint64!
158
+ throw :finish if size < 16
159
+ [type, size - 16]
160
+ else
161
+ # size == 0 means the box extends to end of file (ISO/IEC 14496-12 §4.2).
162
+ # size < 8 is malformed (smaller than the header itself). Either way, no
163
+ # further boxes can be parsed at this level, so stop rather than looping
164
+ # on a non-advancing skip.
165
+ throw :finish if size < 8
166
+ [type, size - 8]
167
+ end
158
168
  end
159
169
 
160
170
  def read_uint8!
@@ -6,6 +6,7 @@ module FastImageParsing
6
6
  [jxlc.width, jxlc.height]
7
7
  else
8
8
  bmff = IsoBmff.new(@stream)
9
+ return nil unless bmff.width && bmff.height
9
10
  [bmff.width, bmff.height]
10
11
  end
11
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class FastImage
4
- VERSION = '2.4.1'
4
+ VERSION = '2.4.3'
5
5
  end
@@ -13,12 +13,12 @@ gem "irb"
13
13
  gem "rake"
14
14
  gem "rdoc", ">= 7.2.0"
15
15
  gem "test-unit"
16
- gem "test-unit-ruby-core", git: "https://github.com/ruby/test-unit-ruby-core"
16
+ gem "test-unit-ruby-core"
17
17
 
18
18
  gem "benchmark", require: false
19
- gem "benchmark-driver", require: false
19
+ gem "benchmark_driver", require: false
20
20
  gem "vernier", require: false, platform: :mri
21
21
 
22
22
  group :test do
23
- gem "simplecov", ">= 1.0.0", require: false, platforms: %i[mri windows]
23
+ gem "simplecov", ">= 1.2.0", require: false, platforms: %i[mri windows]
24
24
  end
@@ -0,0 +1,103 @@
1
+ # Net::IMAP
2
+
3
+ Net::IMAP implements Internet Message Access Protocol (IMAP) client
4
+ functionality. The protocol is described in
5
+ [RFC3501](https://www.rfc-editor.org/rfc/rfc3501),
6
+ [RFC9051](https://www.rfc-editor.org/rfc/rfc9051) and various extensions.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'net-imap'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle install
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install net-imap
23
+
24
+ ## Usage
25
+
26
+ ### Connect with TLS to port 993
27
+
28
+ ```ruby
29
+ hostname = "mail.example.com"
30
+ username = "user@example.com"
31
+ password = "correct-horse-battery-staple"
32
+
33
+ imap = Net::IMAP.new(hostname, ssl: true)
34
+ imap.authenticate(:plain, username, password)
35
+ ```
36
+
37
+ To authenticate with an OAuth2 access token:
38
+ ```ruby
39
+ if imap.auth_capable?(:OAUTHBEARER)
40
+ imap.authenticate(:OAUTHBEARER, username, oauth2_token)
41
+ elsif imap.auth_capable?(:XOAUTH2)
42
+ imap.authenticate(:XOAUTH2, username, oauth2_token)
43
+ else
44
+ raise "OAuth2 not supported?"
45
+ end
46
+ ```
47
+
48
+ ### List sender and subject of recent messages
49
+
50
+ ```ruby
51
+ imap.examine('INBOX')
52
+ search_result = imap.uid_search(["SINCE", Date.today - 7])
53
+ imap.uid_fetch(search_result, "ENVELOPE").each do |fetch_data|
54
+ envelope = fetch_data.envelope
55
+ puts "#{envelope.from.first.name}: \t#{envelope.subject}"
56
+ end
57
+ ```
58
+
59
+ ### Move messages between two dates to another mailbox
60
+
61
+ ```ruby
62
+ source = "Mail/sent-mail"
63
+ destination = "Mail/sent-apr03"
64
+
65
+ # The "BEFORE" and "AFTER" search criteria are not inclusive.
66
+ since = Date.parse("2003-04-01").prev_day
67
+ before = Date.parse("2003-05-01")
68
+
69
+ if imap.list("", destination).empty?
70
+ imap.create(destination)
71
+ end
72
+ imap.select(source)
73
+ search_result = imap.uid_search(["SINCE", since, "BEFORE", before])
74
+ if imap.capable?(:MOVE) || imap.capable?(:IMAP4rev2)
75
+ imap.uid_move(search_result, destination)
76
+ else
77
+ # Atomic MOVE is not supported. Copy, delete, and expunge.
78
+ imap.uid_copy(search_result, destination)
79
+ imap.uid_store(search_result, "+FLAGS", [:Deleted])
80
+ if imap.capable?(:UIDPLUS) || imap.capable?(:IMAP4rev2)
81
+ imap.uid_expunge(search_result)
82
+ else
83
+ # NOTE: This may expunge _other_ deleted messages, too.
84
+ imap.expunge
85
+ end
86
+ end
87
+ ```
88
+
89
+ ## Development
90
+
91
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
92
+ `bin/test` to run the tests. You can also run `bin/console` for an interactive
93
+ prompt that will allow you to experiment.
94
+
95
+ To install this gem onto your local machine, run `bundle exec rake install`. To
96
+ release a new version, update the version number in `version.rb`, and then run
97
+ `bundle exec rake release`, which will create a git tag for the version, push
98
+ git commits and tags, and push the `.gem` file to
99
+ [rubygems.org](https://rubygems.org).
100
+
101
+ ## Contributing
102
+
103
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/net-imap.
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+ require "rake/clean"
6
+
7
+ Rake::TestTask.new(:test) do |t|
8
+ t.libs << "test/lib"
9
+ t.ruby_opts << "-rhelper"
10
+ t.test_files = FileList["test/**/test_*.rb"]
11
+ end
12
+
13
+ task :default => :test
14
+
15
+ desc "Output HTML coverage data report, and error when threshholds aren't met"
16
+ task "test:coverage:report" do
17
+ require "simplecov"
18
+
19
+ SimpleCov.collate "coverage/.resultset.json" do
20
+ formatter SimpleCov::Formatter::HTMLFormatter
21
+
22
+ coverage(:line) do
23
+ minimum 95
24
+
25
+ minimum 98, per: group("Config")
26
+ minimum 97, per: group("StringPrep")
27
+ minimum 97, per: group("SASL")
28
+ minimum 95, per: group("Data Types")
29
+ minimum 94, per: group("Parser")
30
+ minimum 92, per: group("Client")
31
+
32
+ minimum 80, per: :file
33
+ minimum 55, per: "lib/net/imap/search_result.rb"
34
+ end
35
+
36
+ # NOTE: branch coverage varies more widely between ruby versions
37
+ coverage(:branch) do
38
+ # eval branch coverage varies too much between runtime environments
39
+ ignore :eval_generated
40
+
41
+ minimum 80
42
+
43
+ minimum 90, per: group("Data Types")
44
+ minimum 85, per: group("Config")
45
+ minimum 80, per: group("Client")
46
+ minimum 80, per: group("Parser")
47
+ minimum 70, per: group("SASL")
48
+ minimum 70, per: group("StringPrep")
49
+
50
+ minimum 60, per: :file
51
+ minimum 50, per: "lib/net/imap/sasl/authenticators.rb"
52
+ minimum 50, per: "lib/net/imap/config/attr_accessors.rb"
53
+ end
54
+
55
+ coverage(:method) do
56
+ minimum 88
57
+
58
+ minimum 100, per: group("Config")
59
+ minimum 90, per: group("Data Types")
60
+ minimum 90, per: group("StringPrep")
61
+ minimum 85, per: group("Client")
62
+ minimum 80, per: group("Parser")
63
+ minimum 80, per: group("SASL")
64
+
65
+ minimum 65, per: :file
66
+ minimum 60, per: "lib/net/imap/response_parser/parser_utils.rb"
67
+ minimum 55, per: "lib/net/imap/sasl/authenticators.rb"
68
+ minimum 50, per: "lib/net/imap/authenticators.rb"
69
+ minimum 50, per: "lib/net/imap/sasl/anonymous_authenticator.rb"
70
+ minimum 35, per: "lib/net/imap/sasl/protocol_adapters.rb"
71
+ minimum 20, per: "lib/net/imap/response_data.rb"
72
+ end
73
+ end
74
+ end
@@ -265,23 +265,26 @@ module Net
265
265
  def self.split(data)
266
266
  data = data.b # dups and ensures BINARY encoding
267
267
  parts = []
268
- while data.match(/(~)?\{(0|[1-9]\d*)(\+)?\}\r\n/n)
269
- text, binary, bytesize, non_sync, data = $`, !!$1, $2, !!$3, $'
268
+ text_start = 0
269
+ while data.match(/(~)?\{(0|[1-9]\d*)(\+)?\}\r\n/n, text_start)
270
+ text, binary, bytesize, non_sync, literal_start =
271
+ data.byteslice(text_start...$~.begin(0)), !!$1, $2, !!$3, $~.end(0)
270
272
  bytesize = NumValidator.coerce_number64 bytesize
273
+ text_start = literal_start + bytesize
271
274
  parts << RawText[text] unless text.empty?
272
- parts << extract_literal(data, binary:, bytesize:, non_sync:)
273
- data.bytesplice(0, bytesize, "")
275
+ parts << extract_literal(data, literal_start, bytesize, binary:, non_sync:)
274
276
  end
275
- parts << RawText[data] unless data.empty?
277
+ parts << RawText[data.byteslice(text_start..)] if text_start < data.bytesize
276
278
  parts
277
279
  end
278
280
 
279
- def self.extract_literal(data, binary:, bytesize:, non_sync:)
280
- if data.bytesize < bytesize
281
+ def self.extract_literal(data, offset, bytesize, binary:, non_sync:)
282
+ remaining = data.bytesize - offset
283
+ if remaining < bytesize
281
284
  raise DataFormatError, "Too few bytes in string for literal, " \
282
- "expected: %s, remaining: %s" % [bytesize, data.bytesize]
285
+ "expected: %s, remaining: %s" % [bytesize, remaining]
283
286
  end
284
- literal = data.byteslice(0, bytesize)
287
+ literal = data.byteslice(offset, bytesize)
285
288
  (binary ? Literal8 : Literal).new(data: literal, non_sync:)
286
289
  end
287
290
  private_class_method :extract_literal
@@ -459,7 +462,7 @@ module Net
459
462
  # coerces using +to_s+
460
463
  def string(str)
461
464
  str = str.to_s
462
- if str =~ LITERAL_REGEX
465
+ if str.b.match?(LITERAL_REGEX)
463
466
  Literal.new(str)
464
467
  else
465
468
  QuotedString.new(str)
@@ -58,9 +58,9 @@ module Net
58
58
 
59
59
  private
60
60
 
61
- def initialize_clone(other)
61
+ def initialize_clone(other, **kwargs)
62
62
  super
63
- @data = other.data.clone
63
+ @data = other.data.clone(**kwargs)
64
64
  end
65
65
 
66
66
  def initialize_dup(other)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../utils"
4
+
3
5
  module Net
4
6
  class IMAP
5
7
  class Config
@@ -28,28 +30,14 @@ module Net
28
30
  end
29
31
  private_class_method :included
30
32
 
31
- if defined?(Ractor.shareable_proc)
32
- def self.safe(&b)
33
- case obj = b.call
34
- when Proc
35
- Ractor.shareable_proc(&obj)
36
- else
37
- Ractor.make_shareable obj
38
- end
39
- end
40
- elsif defined?(Ractor.make_shareable)
41
- def self.safe(&b)
42
- obj = nil.instance_eval(&b).freeze
43
- Ractor.make_shareable obj
44
- end
45
- else
46
- def self.safe(&b) nil.instance_eval(&b).freeze end
47
- end
48
- private_class_method :safe
33
+ extend Utils
49
34
 
50
- Types = Hash.new do |h, type| type => Proc | nil; safe{type} end
51
- Types[:boolean] = Boolean = safe{-> {!!_1}}
52
- Types[Integer] = safe{->{Integer(_1)}}
35
+ Types = Hash.new do |h, type|
36
+ type => Proc | nil
37
+ Utils.shareable{type}
38
+ end
39
+ Types[:boolean] = Boolean = shareable{-> {!!_1}}
40
+ Types[Integer] = shareable{->{Integer(_1)}}
53
41
 
54
42
  def self.attr_accessor(attr, type: nil)
55
43
  type = Types[type] or return
@@ -57,16 +45,16 @@ module Net
57
45
  define_method :"#{attr}?" do send attr end if type == Boolean
58
46
  end
59
47
 
60
- NilOrInteger = safe{->val { Integer val unless val.nil? }}
48
+ NilOrInteger = shareable{->val { Integer val unless val.nil? }}
61
49
 
62
- Enum = ->(*enum) {
63
- safe_enum = safe{enum}
50
+ Enum = shareable{->(*enum) {
51
+ safe_enum = Utils.shareable{enum}
64
52
  expected = -"one of #{safe_enum.map(&:inspect).join(", ")}"
65
- safe{->val {
53
+ Utils.shareable{->val {
66
54
  return val if safe_enum.include?(val)
67
55
  raise ArgumentError, "expected %s, got %p" % [expected, val]
68
56
  }}
69
- }
57
+ }}
70
58
 
71
59
  end
72
60
  end
@@ -120,6 +120,66 @@ module Net
120
120
  #
121
121
  # *NOTE:* Updates to config objects are not synchronized for thread-safety.
122
122
  #
123
+ # == What's here?
124
+ #
125
+ # === \Config attributes
126
+ #
127
+ # ==== Timeouts and other limits
128
+ #
129
+ # * #open_timeout: seconds to wait for connection to open or start TLS
130
+ # * #idle_response_timeout: seconds to wait for +IDLE+ command to complete
131
+ # * max_response_size: Maximum allowed server response size.
132
+ #
133
+ # ==== Server capabilities
134
+ #
135
+ # * #sasl_ir: Controls +SASL-IR+ behavior for Net::IMAP#authenticate.
136
+ # * #enforce_logindisabled: Controls +LOGINDISABLED+ behavior in
137
+ # Net::IMAP#login.
138
+ # * max_non_synchronizing_literal: maximum bytesize for <tt>LITERAL+</tt> /
139
+ # <tt>LITERAL-</tt> non-synchronizing literals.
140
+ #
141
+ # ==== Inherited defaults
142
+ # {Versioned defaults}[rdoc-ref:Net::IMAP@Versioned+defaults] inherit these
143
+ # from ::global and #load_defaults doesn't update them.
144
+ #
145
+ # * #debug (aliased as #debug?): whether debug mode is enabled
146
+ #
147
+ # ==== Backward compatibility
148
+ # These attributes will be removed by some future release.
149
+ #
150
+ # * #responses_without_block: Controls the behavior of Net::IMAP#responses
151
+ # when called without any arguments (+type+ or +block+).
152
+ # * #parser_use_deprecated_uidplus_data: <em>Ignored since +v0.6.0+.</em>
153
+ # * #parser_max_deprecated_uidplus_data_size: <em>Ignored since +v0.6.0+.</em>
154
+ #
155
+ # === Getting a new or existing config
156
+ # * ::global: The global config, used as the default #parent.
157
+ # * ::default: The hardcoded frozen default config, and parent of ::global.
158
+ # * ::version_defaults: Hard-coded frozen default configurations, indexed
159
+ # by version.
160
+ # * ::[]: Returns a config from ::version_defaults or created by ::new.
161
+ # * ::new: Return a new Config which inherits from a given +parent+.
162
+ # * #new: Return a new Config which inherits from +self+.
163
+ #
164
+ # === Updating multiple attributes
165
+ # * #load_defaults: Sets attributes to a given +version+'s default values.
166
+ # * #update: Assigns multiple attribute values to +self+.
167
+ # * #reset: Resets attributes to inherit from #parent.
168
+ #
169
+ # === Exporting multiple attributes
170
+ # * #to_h: Return a hash with all attributes.
171
+ # * #inspect (aliased as #to_s): Returns a string representation of
172
+ # overriden config attributes and the config inheritance chain.
173
+ # * #pretty_print: Used by PP[https://docs.ruby-lang.org/en/master/PP.html]
174
+ # to create a string representation of all config attributes and the
175
+ # inheritance chain.
176
+ #
177
+ # === Inheritance inspection
178
+ # * #parent: Returns the parent config object.
179
+ # * #inherited?: Returns whether all attributes inherit from #parent.
180
+ # * #inherits_defaults?: Returns whether all attributes inherit from a default config.
181
+ # * #overrides?: Returns whether any attributes override the #parent value.
182
+ #
123
183
  class Config
124
184
  # Array of attribute names that are _not_ loaded by #load_defaults.
125
185
  DEFAULT_TO_INHERIT = %i[debug].freeze
@@ -196,7 +256,7 @@ module Net
196
256
  # #load_defaults will not override #debug.
197
257
  attr_accessor :debug, type: :boolean, default: false
198
258
 
199
- # method: debug?
259
+ # :method: debug?
200
260
  # :call-seq: debug? -> boolean
201
261
  #
202
262
  # Alias for #debug
@@ -312,7 +372,7 @@ module Net
312
372
  # * +0.6+: 16 KiB
313
373
  attr_accessor :max_non_synchronizing_literal, type: Integer, defaults: {
314
374
  0.0r => -1,
315
- 0.6r => 16 << 16, # 16 KiB
375
+ 0.6r => 16 << 10, # 16 KiB
316
376
  }
317
377
 
318
378
  # The maximum allowed server response size. When +nil+, there is no limit
@@ -365,7 +425,7 @@ module Net
365
425
  # Prints a warning and returns the mutable responses hash.
366
426
  # <em>This is not thread-safe.</em>
367
427
  #
368
- # [+:frozen_dup+ <em>(planned default for +v0.6+)</em>]
428
+ # [+:frozen_dup+ <em>(default since +v0.6+)</em>]
369
429
  # Returns a frozen copy of the unhandled responses hash, with frozen
370
430
  # array values.
371
431
  #
@@ -193,11 +193,11 @@ module Net
193
193
  end
194
194
 
195
195
  ##
196
- # method: range
196
+ # :method: range
197
197
  # :call-seq: range -> range
198
198
 
199
199
  ##
200
- # method: results
200
+ # :method: results
201
201
  # :call-seq: results -> sequence set or nil
202
202
 
203
203
  # Converts #results to an array of integers.
@@ -104,7 +104,7 @@ module Net
104
104
  #
105
105
  class FetchStruct < Struct
106
106
  ##
107
- # method: attr
107
+ # :method: attr
108
108
  # :call-seq: attr -> hash
109
109
  #
110
110
  # Each key specifies a message attribute, and the value is the
@@ -518,7 +518,7 @@ module Net
518
518
  # See FetchStruct documentation for a list of standard message attributes.
519
519
  class FetchData < FetchStruct.new(:seqno, :attr)
520
520
  ##
521
- # method: seqno
521
+ # :method: seqno
522
522
  # :call-seq: seqno -> Integer
523
523
  #
524
524
  # The message sequence number.
@@ -532,7 +532,7 @@ module Net
532
532
  # UIDFetchData will raise a NoMethodError.
533
533
 
534
534
  ##
535
- # method: attr
535
+ # :method: attr
536
536
  # :call-seq: attr -> hash
537
537
  #
538
538
  # Each key specifies a message attribute, and the value is the
@@ -558,7 +558,7 @@ module Net
558
558
  # See FetchStruct documentation for a list of standard message attributes.
559
559
  class UIDFetchData < FetchStruct.new(:uid, :attr)
560
560
  ##
561
- # method: uid
561
+ # :method: uid
562
562
  # call-seq: uid -> Integer
563
563
  #
564
564
  # A number expressing the unique identifier of the message.
@@ -568,7 +568,7 @@ module Net
568
568
  # returns the uniqueid at the beginning of the +UIDFETCH+ response.
569
569
 
570
570
  ##
571
- # method: attr
571
+ # :method: attr
572
572
  # call-seq: attr -> hash
573
573
  #
574
574
  # Each key specifies a message attribute, and the value is the