net-imap 0.6.1 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ae6f1b476869edfc86c6dc8fa41879985532983dd975aab9ad001f18ab0c9b9
4
- data.tar.gz: daea9364b0c5925d1df567e63bb02488f0ce09d56a0bc2ab893ba4f3be320baa
3
+ metadata.gz: bc6f6d65e2f5092b38316ed4d381551838dd412a5b376c06359225e8f53a020c
4
+ data.tar.gz: d5daf47c70a868650687f7db3d1a1e074555a634708c16792e19f1cb53f8cc83
5
5
  SHA512:
6
- metadata.gz: e797892aa6f483e8e13b7b40c7f84e45d1919f08715daf8931ad73ee8ff41fac9fdb943cc9bb41d268942e884d3fd51c8ed291aa6c64c237ab7a193f63d337c9
7
- data.tar.gz: 66af8fc6b85409ca6fef21fe54eb9f7a26515f771a39155a9e02682d7dfca6d315f0ad86c54711bdf1423616f41678675594d287188e030ebd57ccc239a5e86d
6
+ metadata.gz: 1aeb682e73a666591079aac75c4325f22079dfbf61dbe71df135059b9087890633c31fd036e61757a217f1b1ff3e1d3771801a7ec6f3817646a0f8d2c0896386
7
+ data.tar.gz: 8cd118d9943b83010dd2f4916ab7641e120743991d3bc06062c4eb286098d1af8af05d86854b3e44235a0b3263b801db1cf9a7d64ac3140d89eda1aca086e6cd
@@ -1098,8 +1098,9 @@ module Net
1098
1098
  # Related: #delete, #delete_at, #subtract, #difference, #disjoint?
1099
1099
  def delete?(element)
1100
1100
  modifying! # short-circuit before import_minmax
1101
+ element = input_try_convert(element)
1101
1102
  minmax = import_minmax element
1102
- if minmax.first == minmax.last
1103
+ if number_input?(element)
1103
1104
  return unless include_minmax? minmax
1104
1105
  subtract_minmax minmax
1105
1106
  normalize!
@@ -1917,6 +1918,14 @@ module Net
1917
1918
  input
1918
1919
  end
1919
1920
 
1921
+ # NOTE: input_try_convert must be called on input first
1922
+ def number_input?(input)
1923
+ case input
1924
+ when *STARS, Integer then true
1925
+ when String then !input.include?(/[:,]/)
1926
+ end
1927
+ end
1928
+
1920
1929
  def import_range_minmax(range)
1921
1930
  first = import_num(range.begin || 1)
1922
1931
  last = import_num(range.end || :*)
data/lib/net/imap.rb CHANGED
@@ -788,7 +788,7 @@ module Net
788
788
  # * {IMAP URLAUTH Authorization Mechanism Registry}[https://www.iana.org/assignments/urlauth-authorization-mechanism-registry/urlauth-authorization-mechanism-registry.xhtml]
789
789
  #
790
790
  class IMAP < Protocol
791
- VERSION = "0.6.1"
791
+ VERSION = "0.6.2"
792
792
 
793
793
  # Aliases for supported capabilities, to be used with the #enable command.
794
794
  ENABLE_ALIASES = {
@@ -3230,7 +3230,7 @@ module Net
3230
3230
  warn(RESPONSES_DEPRECATION_MSG, uplevel: 1, category: :deprecated)
3231
3231
  when :frozen_dup
3232
3232
  synchronize {
3233
- responses = @responses.transform_values(&:freeze)
3233
+ responses = @responses.transform_values { _1.dup.freeze }
3234
3234
  responses.default_proc = nil
3235
3235
  responses.default = [].freeze
3236
3236
  return responses.freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-imap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda