net-imap 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +6 -3
- data/lib/net/imap.rb +18 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eefc3b1cd7e0363c5ce0a07a3849b903248a1ab716a6c025dd15dcfd2af30c3
|
4
|
+
data.tar.gz: 0ff1ba4529e6d462e9bccd4417997582e8d3fac60ed4e60bbc270c135db115a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 847ccde0966c5dd4e633c0cfd5ce894ad08a7c97dc6598377d169e609770c36093f9ba612a87749755ee56df24d6cde5caae54c4ea93dd4caf37b0a467cc01be
|
7
|
+
data.tar.gz: 314766dc692163b3b9b9770d884154357bf956df8f3047bb6ce85c6c07b587cfca616c4a4677855013a33b31b5e43a8267dee7077689266b539afe459c8b467a
|
data/.github/workflows/test.yml
CHANGED
@@ -7,13 +7,16 @@ jobs:
|
|
7
7
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [
|
10
|
+
ruby: [ 3.0, 2.7, 2.5, head ]
|
11
11
|
os: [ ubuntu-latest, macos-latest ]
|
12
12
|
experimental: [false]
|
13
13
|
include:
|
14
|
+
# - ruby: 2.6
|
15
|
+
# os: ubuntu-latest
|
16
|
+
# experimental: true
|
14
17
|
- ruby: 2.6
|
15
|
-
os:
|
16
|
-
experimental:
|
18
|
+
os: macos-latest
|
19
|
+
experimental: false
|
17
20
|
runs-on: ${{ matrix.os }}
|
18
21
|
continue-on-error: ${{ matrix.experimental }}
|
19
22
|
steps:
|
data/lib/net/imap.rb
CHANGED
@@ -201,7 +201,7 @@ module Net
|
|
201
201
|
# Unicode", RFC 2152, May 1997.
|
202
202
|
#
|
203
203
|
class IMAP < Protocol
|
204
|
-
VERSION = "0.2.
|
204
|
+
VERSION = "0.2.1"
|
205
205
|
|
206
206
|
include MonitorMixin
|
207
207
|
if defined?(OpenSSL::SSL)
|
@@ -229,6 +229,9 @@ module Net
|
|
229
229
|
# it raises a Net::OpenTimeout exception. The default value is 30 seconds.
|
230
230
|
attr_reader :open_timeout
|
231
231
|
|
232
|
+
# Seconds to wait until an IDLE response is received.
|
233
|
+
attr_reader :idle_response_timeout
|
234
|
+
|
232
235
|
# The thread to receive exceptions.
|
233
236
|
attr_accessor :client_thread
|
234
237
|
|
@@ -1056,7 +1059,7 @@ module Net
|
|
1056
1059
|
unless @receiver_thread_terminating
|
1057
1060
|
remove_response_handler(response_handler)
|
1058
1061
|
put_string("DONE#{CRLF}")
|
1059
|
-
response = get_tagged_response(tag, "IDLE")
|
1062
|
+
response = get_tagged_response(tag, "IDLE", @idle_response_timeout)
|
1060
1063
|
end
|
1061
1064
|
end
|
1062
1065
|
end
|
@@ -1142,6 +1145,7 @@ module Net
|
|
1142
1145
|
# If options[:ssl] is a hash, it's passed to
|
1143
1146
|
# OpenSSL::SSL::SSLContext#set_params as parameters.
|
1144
1147
|
# open_timeout:: Seconds to wait until a connection is opened
|
1148
|
+
# idle_response_timeout:: Seconds to wait until an IDLE response is received
|
1145
1149
|
#
|
1146
1150
|
# The most common errors are:
|
1147
1151
|
#
|
@@ -1171,6 +1175,7 @@ module Net
|
|
1171
1175
|
@tag_prefix = "RUBY"
|
1172
1176
|
@tagno = 0
|
1173
1177
|
@open_timeout = options[:open_timeout] || 30
|
1178
|
+
@idle_response_timeout = options[:idle_response_timeout] || 5
|
1174
1179
|
@parser = ResponseParser.new
|
1175
1180
|
@sock = tcp_socket(@host, @port)
|
1176
1181
|
begin
|
@@ -1294,10 +1299,19 @@ module Net
|
|
1294
1299
|
end
|
1295
1300
|
end
|
1296
1301
|
|
1297
|
-
def get_tagged_response(tag, cmd)
|
1302
|
+
def get_tagged_response(tag, cmd, timeout = nil)
|
1303
|
+
if timeout
|
1304
|
+
deadline = Time.now + timeout
|
1305
|
+
end
|
1298
1306
|
until @tagged_responses.key?(tag)
|
1299
1307
|
raise @exception if @exception
|
1300
|
-
|
1308
|
+
if timeout
|
1309
|
+
timeout = deadline - Time.now
|
1310
|
+
if timeout <= 0
|
1311
|
+
return nil
|
1312
|
+
end
|
1313
|
+
end
|
1314
|
+
@tagged_response_arrival.wait(timeout)
|
1301
1315
|
end
|
1302
1316
|
resp = @tagged_responses.delete(tag)
|
1303
1317
|
case resp.name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-imap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-protocol
|