net-imap 0.5.10 → 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 +4 -4
- data/Gemfile +5 -4
- data/lib/net/imap/command_data.rb +0 -68
- data/lib/net/imap/config/attr_inheritance.rb +14 -1
- data/lib/net/imap/config/attr_type_coercion.rb +18 -6
- data/lib/net/imap/config/attr_version_defaults.rb +93 -0
- data/lib/net/imap/config.rb +210 -122
- data/lib/net/imap/connection_state.rb +1 -1
- data/lib/net/imap/data_encoding.rb +77 -28
- data/lib/net/imap/esearch_result.rb +48 -3
- data/lib/net/imap/response_data.rb +2 -3
- data/lib/net/imap/response_parser.rb +8 -13
- data/lib/net/imap/search_result.rb +8 -3
- data/lib/net/imap/sequence_set.rb +638 -315
- data/lib/net/imap/uidplus_data.rb +2 -63
- data/lib/net/imap/vanished_data.rb +10 -1
- data/lib/net/imap.rb +35 -26
- data/net-imap.gemspec +1 -1
- metadata +4 -4
- data/lib/net/imap/data_lite.rb +0 -226
|
@@ -6,7 +6,6 @@ module Net
|
|
|
6
6
|
autoload :FetchData, "#{__dir__}/fetch_data"
|
|
7
7
|
autoload :UIDFetchData, "#{__dir__}/fetch_data"
|
|
8
8
|
autoload :SearchResult, "#{__dir__}/search_result"
|
|
9
|
-
autoload :UIDPlusData, "#{__dir__}/uidplus_data"
|
|
10
9
|
autoload :AppendUIDData, "#{__dir__}/uidplus_data"
|
|
11
10
|
autoload :CopyUIDData, "#{__dir__}/uidplus_data"
|
|
12
11
|
autoload :VanishedData, "#{__dir__}/vanished_data"
|
|
@@ -260,8 +259,8 @@ module Net
|
|
|
260
259
|
#
|
|
261
260
|
# === +UIDPLUS+ extension
|
|
262
261
|
# See {[RFC4315 §3]}[https://www.rfc-editor.org/rfc/rfc4315#section-3].
|
|
263
|
-
# * +APPENDUID+, #data is
|
|
264
|
-
# * +COPYUID+, #data is
|
|
262
|
+
# * +APPENDUID+, #data is AppendUIDData. See IMAP#append.
|
|
263
|
+
# * +COPYUID+, #data is CopyUIDData. See IMAP#copy.
|
|
265
264
|
# * +UIDNOTSTICKY+, #data is +nil+. See IMAP#select.
|
|
266
265
|
#
|
|
267
266
|
# === +SEARCHRES+ extension
|
|
@@ -2017,24 +2017,19 @@ module Net
|
|
|
2017
2017
|
CopyUID(validity, src_uids, dst_uids)
|
|
2018
2018
|
end
|
|
2019
2019
|
|
|
2020
|
-
def AppendUID(...) DeprecatedUIDPlus(...) || AppendUIDData.new(...) end
|
|
2021
|
-
def CopyUID(...) DeprecatedUIDPlus(...) || CopyUIDData.new(...) end
|
|
2022
|
-
|
|
2023
2020
|
# TODO: remove this code in the v0.6.0 release
|
|
2024
2021
|
def DeprecatedUIDPlus(validity, src_uids = nil, dst_uids)
|
|
2025
2022
|
return unless config.parser_use_deprecated_uidplus_data
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
dst_uids = dst_uids.each_ordered_number.to_a
|
|
2032
|
-
UIDPlusData.new(validity, src_uids, dst_uids)
|
|
2033
|
-
elsif config.parser_use_deprecated_uidplus_data != :up_to_max_size
|
|
2034
|
-
parse_error("uid-set is too large: %d > %d", count, max)
|
|
2035
|
-
end
|
|
2023
|
+
warn("#{Config}#parser_use_deprecated_uidplus_data is ignored " \
|
|
2024
|
+
"since v0.6.0. Disable this warning by setting " \
|
|
2025
|
+
"config.parser_use_deprecated_uidplus_data = false.",
|
|
2026
|
+
category: :deprecated, uplevel: 9)
|
|
2027
|
+
nil
|
|
2036
2028
|
end
|
|
2037
2029
|
|
|
2030
|
+
def AppendUID(...) DeprecatedUIDPlus(...) || AppendUIDData.new(...) end
|
|
2031
|
+
def CopyUID(...) DeprecatedUIDPlus(...) || CopyUIDData.new(...) end
|
|
2032
|
+
|
|
2038
2033
|
ADDRESS_REGEXP = /\G
|
|
2039
2034
|
\( (?: NIL | #{Patterns::QUOTED_rev2} ) # 1: NAME
|
|
2040
2035
|
\s (?: NIL | #{Patterns::QUOTED_rev2} ) # 2: ROUTE
|
|
@@ -7,6 +7,12 @@ module Net
|
|
|
7
7
|
# identifiers returned by Net::IMAP#uid_search.
|
|
8
8
|
#
|
|
9
9
|
# For backward compatibility, SearchResult inherits from Array.
|
|
10
|
+
#
|
|
11
|
+
# ==== Compatibility with ESearchResult
|
|
12
|
+
#
|
|
13
|
+
# Note that both SearchResult and ESearchResult implement +each+, +to_a+,
|
|
14
|
+
# and +to_sequence_set+. These methods can be used regardless of whether
|
|
15
|
+
# the server returns +SEARCH+ or +ESEARCH+ data (or no data).
|
|
10
16
|
class SearchResult < Array
|
|
11
17
|
|
|
12
18
|
# Returns a SearchResult populated with the given +seq_nums+.
|
|
@@ -60,9 +66,8 @@ module Net
|
|
|
60
66
|
# [3, 5, 7] == Net::IMAP::SearchResult[3, 5, 7, modseq: 99] # => true
|
|
61
67
|
#
|
|
62
68
|
def ==(other)
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
other.is_a?(Array)) &&
|
|
69
|
+
other.is_a?(Array) &&
|
|
70
|
+
modseq == (other.modseq if other.respond_to?(:modseq)) &&
|
|
66
71
|
size == other.size &&
|
|
67
72
|
sort == other.sort
|
|
68
73
|
end
|