postmark 1.22.2 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +6 -0
- data/VERSION +1 -1
- data/lib/postmark/error.rb +5 -4
- data/lib/postmark/http_client.rb +2 -2
- data/lib/postmark/version.rb +1 -1
- data/postmark.gemspec +1 -1
- data/spec/unit/postmark/error_spec.rb +12 -6
- data/spec/unit/postmark/http_client_spec.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfce0fc58365a91800f896d2d16c8d62d1a601f7a1a8d5350c6270cae3f12be3
|
4
|
+
data.tar.gz: 3d8b2761c884f6ca1f3c81efe7c30dda1432b6d7da740d18d6cc55f5cc062d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4082d74e41c4d74378f4e46bb43d0b8dd967489125865cd9379fbc3928dfd0be7369408cfcdcc6a979822739b8734045fba8a66021591848dff801286ef183d9
|
7
|
+
data.tar.gz: 5c93b937e1749584f52c1a1f5e0a4a9eabc6ea579e02c26f20d709ea5b89873d666acd6b8c2e7733a5e18885df370c1f2ca26e9c96c23cc44448d95c4f0da309
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
== 1.23.0
|
4
|
+
* Deprecated `InvalidEmailAddressError`. New name is `InvalidEmailRequestError`.
|
5
|
+
|
6
|
+
== 1.22.3
|
7
|
+
* Increased default timeout values
|
8
|
+
|
3
9
|
== 1.22.2
|
4
10
|
* Updated Postmark::InactiveRecipientError.parse_recipients method to handle current error message
|
5
11
|
* Update post install message to use https URL
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.23.0
|
data/lib/postmark/error.rb
CHANGED
@@ -43,7 +43,7 @@ module Postmark
|
|
43
43
|
|
44
44
|
class ApiInputError < HttpServerError
|
45
45
|
INACTIVE_RECIPIENT = 406
|
46
|
-
|
46
|
+
INVALID_EMAIL_REQUEST = 300
|
47
47
|
|
48
48
|
attr_accessor :error_code
|
49
49
|
|
@@ -53,8 +53,8 @@ module Postmark
|
|
53
53
|
case error_code
|
54
54
|
when INACTIVE_RECIPIENT
|
55
55
|
InactiveRecipientError.new(error_code, body, parsed_body)
|
56
|
-
when
|
57
|
-
|
56
|
+
when INVALID_EMAIL_REQUEST
|
57
|
+
InvalidEmailRequestError.new(error_code, body, parsed_body)
|
58
58
|
else
|
59
59
|
new(error_code, body, parsed_body)
|
60
60
|
end
|
@@ -70,7 +70,7 @@ module Postmark
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
class
|
73
|
+
class InvalidEmailRequestError < ApiInputError; end
|
74
74
|
|
75
75
|
class InactiveRecipientError < ApiInputError
|
76
76
|
attr_reader :recipients
|
@@ -129,4 +129,5 @@ module Postmark
|
|
129
129
|
DeliveryError = Error
|
130
130
|
InvalidMessageError = ApiInputError
|
131
131
|
UnknownError = UnexpectedHttpResponseError
|
132
|
+
InvalidEmailAddressError = InvalidEmailRequestError
|
132
133
|
end
|
data/lib/postmark/http_client.rb
CHANGED
@@ -17,8 +17,8 @@ module Postmark
|
|
17
17
|
:host => 'api.postmarkapp.com',
|
18
18
|
:secure => true,
|
19
19
|
:path_prefix => '/',
|
20
|
-
:http_read_timeout =>
|
21
|
-
:http_open_timeout =>
|
20
|
+
:http_read_timeout => 60,
|
21
|
+
:http_open_timeout => 60
|
22
22
|
}
|
23
23
|
|
24
24
|
def initialize(api_token, options = {})
|
data/lib/postmark/version.rb
CHANGED
data/postmark.gemspec
CHANGED
@@ -98,9 +98,9 @@ describe(Postmark::ApiInputError) do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
context '300' do
|
101
|
-
let(:code) {Postmark::ApiInputError::
|
101
|
+
let(:code) {Postmark::ApiInputError::INVALID_EMAIL_REQUEST}
|
102
102
|
|
103
|
-
it {is_expected.to be_a(Postmark::
|
103
|
+
it {is_expected.to be_a(Postmark::InvalidEmailRequestError)}
|
104
104
|
it_behaves_like 'api input error'
|
105
105
|
end
|
106
106
|
|
@@ -149,13 +149,13 @@ describe(Postmark::MailAdapterError) do
|
|
149
149
|
it {is_expected.to be_a(Postmark::Error)}
|
150
150
|
end
|
151
151
|
|
152
|
-
describe(Postmark::
|
152
|
+
describe(Postmark::InvalidEmailRequestError) do
|
153
153
|
describe '.new' do
|
154
154
|
let(:response) {{'Message' => message}}
|
155
155
|
|
156
156
|
subject do
|
157
|
-
Postmark::
|
158
|
-
Postmark::ApiInputError::
|
157
|
+
Postmark::InvalidEmailRequestError.new(
|
158
|
+
Postmark::ApiInputError::INVALID_EMAIL_REQUEST, Postmark::Json.encode(response), response)
|
159
159
|
end
|
160
160
|
|
161
161
|
let(:message) do
|
@@ -171,7 +171,7 @@ describe(Postmark::InvalidEmailAddressError) do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it 'error code is set' do
|
174
|
-
expect(subject.error_code).to eq(Postmark::ApiInputError::
|
174
|
+
expect(subject.error_code).to eq(Postmark::ApiInputError::INVALID_EMAIL_REQUEST)
|
175
175
|
end
|
176
176
|
end
|
177
177
|
end
|
@@ -274,3 +274,9 @@ describe(Postmark::UnknownError) do
|
|
274
274
|
expect(subject.class).to eq(Postmark::UnexpectedHttpResponseError)
|
275
275
|
end
|
276
276
|
end
|
277
|
+
|
278
|
+
describe(Postmark::InvalidEmailAddressError) do
|
279
|
+
it 'is an alias for backwards compatibility' do
|
280
|
+
expect(subject.class).to eq(Postmark::InvalidEmailRequestError)
|
281
|
+
end
|
282
|
+
end
|
@@ -39,8 +39,8 @@ describe Postmark::HttpClient do
|
|
39
39
|
its(:port) { is_expected.to eq 443 }
|
40
40
|
its(:secure) { is_expected.to be true }
|
41
41
|
its(:path_prefix) { is_expected.to eq '/' }
|
42
|
-
its(:http_read_timeout) { is_expected.to eq
|
43
|
-
its(:http_open_timeout) { is_expected.to eq
|
42
|
+
its(:http_read_timeout) { is_expected.to eq 60 }
|
43
|
+
its(:http_open_timeout) { is_expected.to eq 60 }
|
44
44
|
|
45
45
|
it 'does not provide a default which utilizes the Net::HTTP default', :skip_ruby_version => ['1.8.7'] do
|
46
46
|
http_client = subject.http
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Maszkowski
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2023-01-23 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|
@@ -33,16 +33,16 @@ dependencies:
|
|
33
33
|
name: mail
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- - "
|
36
|
+
- - "~>"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
38
|
+
version: 2.7.0
|
39
39
|
type: :development
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- - "
|
43
|
+
- - "~>"
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 2.7.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rake
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|