mailosaur 7.0.1 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Mailosaur/messages.rb +5 -1
- data/lib/Mailosaur/version.rb +1 -1
- 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: 798ce47acf047126597a038b0bdb2297f4a4806145674ee116cefcb1e31dd556
|
4
|
+
data.tar.gz: 5595c1400c4e16d1f0f1f75e44f027809b95d89817890d54695240e053f63a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a193b027b089135e3855ae44abe60c777e3addca743ae48620577aa79b08877d31aa01497381055e64178ce0c848f23530041d6ff70d573fd6054556fdec7c0
|
7
|
+
data.tar.gz: 71e18e02a530719f12cc506ed6bafda93c0127e8c37f5ac26345659506427453c11e540dc53feafc99b4dd21cbb607a6c07b08ed8229bfa5ec46de5e91f1f011
|
data/lib/Mailosaur/messages.rb
CHANGED
@@ -132,10 +132,12 @@ module Mailosaur
|
|
132
132
|
# (in milliseconds).
|
133
133
|
# @param received_after [DateTime] Limits results to only messages received
|
134
134
|
# after this date/time.
|
135
|
+
# @param error_on_timeout [Boolean] When set to false, an error will not be
|
136
|
+
# throw if timeout is reached (default: true).
|
135
137
|
#
|
136
138
|
# @return [MessageListResult] operation results.
|
137
139
|
#
|
138
|
-
def search(server, criteria, page: nil, items_per_page: nil, timeout: nil, received_after: nil) # rubocop:disable all
|
140
|
+
def search(server, criteria, page: nil, items_per_page: nil, timeout: nil, received_after: nil, error_on_timeout: true) # rubocop:disable all
|
139
141
|
url = 'api/messages/search?server=' + server
|
140
142
|
url += page ? '&page=' + page.to_s : ''
|
141
143
|
url += items_per_page ? '&itemsPerPage=' + items_per_page.to_s : ''
|
@@ -160,6 +162,8 @@ module Mailosaur
|
|
160
162
|
|
161
163
|
## Stop if timeout will be exceeded
|
162
164
|
if ((1000 * (Time.now.to_f - start_time).to_i) + delay) > timeout
|
165
|
+
return Mailosaur::Models::MessageListResult.new(model) unless error_on_timeout
|
166
|
+
|
163
167
|
raise Mailosaur::MailosaurError.new('No matching messages found in time. By default, only messages received in the last hour are checked (use receivedAfter to override this).', 'search_timeout')
|
164
168
|
end
|
165
169
|
|
data/lib/Mailosaur/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailosaur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailosaur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|