postmark 1.24.1 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a058959694917a357c1620516b215963717924485075b241ce7ceb23115619bd
4
- data.tar.gz: 672e034cbbaa506c5bca5ae7acc229a190d88abb061461f3ddb4e6613c8b2b0f
3
+ metadata.gz: b36e7eff4dabb977637da4527446a61f1f5b1907b0d327fefee9b9068f9ee874
4
+ data.tar.gz: c65b4c7bb6b1e7529f3b202d93e0898fdb51a067ae8496a8c8ae04b0eca9eb48
5
5
  SHA512:
6
- metadata.gz: 4161edf7a3ef04545b54824271677f618ac691c3dc6c332d7f507585b338fd2878572b8f4e12102367266a5226b64d758f6a1ff26e426040c9c538b710ee622f
7
- data.tar.gz: af9c996569b7e3a3b31bb37f2623803877ec84179fb8f791a53002730b513919077ad26e28e3fa544b0b1cff60b276d9d762966901ffdfbcf015080f59145b3c
6
+ metadata.gz: 122e2d925a0dcff98d93fbd60d11db94c5e8f443b73cf67a20eea839a07fd4955fcf0e782a1e49bc3ee9abf0593f8d513a957e6541bc6774ecfb1b1268d152d9
7
+ data.tar.gz: 7db9801b4d8cbdb47c6d8b277d03871ea40ccacb62df06e10169f61cf3368c416e41699a65cfd0f667e0889df7c88e796b0ae4fbac30832a84644644ff63bfdf
data/.circleci/config.yml CHANGED
@@ -9,11 +9,25 @@ workflows:
9
9
  - unit-tests:
10
10
  matrix:
11
11
  parameters:
12
- version: ["2", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7"]
12
+ version: [
13
+ "circleci/ruby:2",
14
+ "circleci/ruby:2.1",
15
+ "circleci/ruby:2.2",
16
+ "circleci/ruby:2.3",
17
+ "circleci/ruby:2.4",
18
+ "circleci/ruby:2.5",
19
+ "circleci/ruby:2.6",
20
+ "circleci/ruby:2.7",
21
+ "cimg/ruby:3.2"
22
+ ]
13
23
  - unit-tests-legacy:
14
24
  matrix:
15
25
  parameters:
16
- version: ["kneip/ree-1.8.7-2012.02","ruby:1.9.3","circleci/jruby:9"]
26
+ version: [
27
+ "kneip/ree-1.8.7-2012.02",
28
+ "ruby:1.9.3",
29
+ "circleci/jruby:9"
30
+ ]
17
31
 
18
32
  orbs:
19
33
  ruby: circleci/ruby@0.1.2
@@ -25,21 +39,16 @@ jobs:
25
39
  version:
26
40
  type: string
27
41
  docker:
28
- - image: circleci/ruby:<< parameters.version >>
42
+ - image: << parameters.version >>
29
43
  steps:
30
44
  - checkout
31
- - run:
32
- name: Versions
33
- command: |
34
- echo "ruby: $(ruby --version)"
45
+ - check_version
35
46
 
36
47
  - run:
37
48
  name: Install dependencies
38
49
  command: bundle install
39
50
 
40
- - run:
41
- name: Run tests
42
- command: bundle exec rake spec
51
+ - run_tests
43
52
 
44
53
  unit-tests-legacy:
45
54
  parallelism: 1
@@ -52,10 +61,7 @@ jobs:
52
61
  - image: << parameters.version >>
53
62
  steps:
54
63
  - checkout
55
- - run:
56
- name: Versions
57
- command: |
58
- echo "ruby: $(ruby --version)"
64
+ - check_version
59
65
 
60
66
  - run:
61
67
  name: Install dependencies
@@ -63,6 +69,19 @@ jobs:
63
69
  gem install bundler --version 1.17.3
64
70
  bundle install
65
71
 
72
+ - run_tests
73
+
74
+ commands:
75
+ check_version:
76
+ steps:
77
+ - run:
78
+ name: Check Ruby version
79
+ command: |
80
+ echo "ruby: $(ruby --version)"
81
+ run_tests:
82
+ steps:
66
83
  - run:
67
84
  name: Run tests
68
85
  command: bundle exec rake spec
86
+ - store_test_results:
87
+ path: test-results
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.5
1
+ ruby-3.2.2
data/CHANGELOG.rdoc CHANGED
@@ -1,7 +1,11 @@
1
1
  = Changelog
2
2
 
3
+ == 1.25.0
4
+ * Add support for https://postmarkapp.com/developer/api/data-removals-api
5
+
3
6
  == 1.24.1
4
7
  * Fixed support for text/calendar attachments by using content_type instead of mime_type.
8
+ * Added missing fields to Bounce
5
9
 
6
10
  == 1.24.0
7
11
  * Added configurable warnings when referencing deprecated classes.
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem 'rspec', '~> 3.7'
7
+ gem 'rspec', '~> 3.7', "< 3.10" # until https://github.com/rspec/rspec-support/pull/537 gets merged
8
8
  gem 'rspec-its', '~> 1.2'
9
9
  gem 'fakeweb', :git => 'https://github.com/chrisk/fakeweb.git'
10
10
  gem 'fakeweb-matcher'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.24.1
1
+ 1.25.0
@@ -10,7 +10,9 @@ group :test do
10
10
  gem 'rspec-its', '~> 1.2'
11
11
  gem 'fakeweb', :git => 'https://github.com/chrisk/fakeweb.git'
12
12
  gem 'fakeweb-matcher'
13
+ gem 'mail', '~> 2.7.0'
13
14
  gem 'mime-types', '~> 1.25.1'
15
+ gem 'mini_mime', '< 1.1.4'
14
16
  gem 'activesupport', '~> 3.2.0'
15
17
  gem 'i18n', '~> 0.6.0'
16
18
  gem 'yajl-ruby', '~> 1.0', '< 1.4.0', :platforms => [:mingw, :mswin, :ruby]
@@ -145,6 +145,13 @@ module Postmark
145
145
  batch
146
146
  end
147
147
 
148
- end
148
+ def get_data_removal_status(id)
149
+ format_response(http_client.get("data-removals/#{id}"))
150
+ end
149
151
 
152
+ def request_data_removal(attributes = {})
153
+ data = serialize(HashHelper.to_postmark(attributes))
154
+ format_response(http_client.post('data-removals', data))
155
+ end
156
+ end
150
157
  end
@@ -1,3 +1,3 @@
1
1
  module Postmark
2
- VERSION = '1.24.1'
2
+ VERSION = '1.25.0'
3
3
  end
data/postmark.gemspec CHANGED
@@ -34,6 +34,6 @@ Gem::Specification.new do |s|
34
34
 
35
35
  s.add_dependency "json"
36
36
 
37
- s.add_development_dependency "mail", "~> 2.7.0" # https://github.com/mikel/mail/pull/1539
37
+ s.add_development_dependency "mail"
38
38
  s.add_development_dependency "rake"
39
39
  end
@@ -105,4 +105,20 @@ describe 'Account API client usage' do
105
105
  # delete
106
106
  expect { subject.delete_server(new_server[:id]) }.not_to raise_error
107
107
  end
108
+
109
+ it 'manages data removals' do
110
+ # create
111
+ data_removal_status = subject.request_data_removal(
112
+ 'requested_by' => 'sender@postmarkapp.com',
113
+ 'requested_for' => 'test@example.com',
114
+ 'notify_when_completed' => false
115
+ )
116
+
117
+ expect(data_removal_status[:status]).to eq('Pending')
118
+
119
+ # get
120
+ fetched_data_removal_status = subject.get_data_removal_status(data_removal_status[:id])
121
+
122
+ expect(fetched_data_removal_status[:id]).to eq(data_removal_status[:id])
123
+ end
108
124
  end
@@ -728,5 +728,46 @@ describe Postmark::AccountApiClient do
728
728
  end
729
729
  end
730
730
 
731
+ describe '#get_data_removal_status' do
732
+ let(:response) {
733
+ {
734
+ "ID" => 42,
735
+ "Status" => "Done"
736
+ }
737
+ }
738
+
739
+ it 'performs a GET request to /data-removals/:id endpoint' do
740
+ allow(subject.http_client).to receive(:get).
741
+ with('data-removals/42').and_return(response)
742
+ subject.get_data_removal_status(42)
743
+ end
744
+
745
+ it 'formats the keys of returned response' do
746
+ allow(subject.http_client).to receive(:get).and_return(response)
747
+ keys = subject.get_data_removal_status(42).keys
748
+ expect(keys.all? { |k| k.is_a?(Symbol) }).to be true
749
+ end
750
+ end
751
+
752
+ describe '#request_data_removal' do
753
+ let(:response) {
754
+ {
755
+ "ID" => 42,
756
+ "Status" => "Done"
757
+ }
758
+ }
759
+
760
+ it 'performs a POST request to /data-removals endpoint' do
761
+ allow(subject.http_client).to receive(:post).
762
+ with('data-removals', an_instance_of(String)).and_return(response)
763
+ subject.request_data_removal(:foo => 'bar')
764
+ end
765
+
766
+ it 'formats the keys of returned response' do
767
+ allow(subject.http_client).to receive(:post).and_return(response)
768
+ keys = subject.request_data_removal(:foo => 'bar').keys
769
+ expect(keys.all? { |k| k.is_a?(Symbol) }).to be true
770
+ end
771
+ end
731
772
  end
732
773
  end
@@ -118,8 +118,8 @@ describe Postmark::MailMessageConverter do
118
118
  from "sheldon@bigbangtheory.com"
119
119
  to "lenard@bigbangtheory.com"
120
120
  subject "Hello!"
121
- body "Hello Sheldon!"
122
121
  add_file empty_gif_path
122
+ body "Hello Sheldon!"
123
123
  end
124
124
  end
125
125
 
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.24.1
4
+ version: 1.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomek Maszkowski
@@ -10,10 +10,10 @@ authors:
10
10
  - Nick Hammond
11
11
  - Petyo Ivanov
12
12
  - Ilya Sabanin
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2023-09-18 00:00:00.000000000 Z
16
+ date: 2023-10-11 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: 2.7.0
38
+ version: '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: 2.7.0
45
+ version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rake
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '0'
60
60
  description: Use this gem to send emails through Postmark HTTP API and retrieve info
61
61
  about bounces.
62
- email:
62
+ email:
63
63
  executables: []
64
64
  extensions: []
65
65
  extra_rdoc_files:
@@ -153,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: 1.3.7
155
155
  requirements: []
156
- rubygems_version: 3.1.6
157
- signing_key:
156
+ rubygems_version: 3.4.10
157
+ signing_key:
158
158
  specification_version: 4
159
159
  summary: Official Postmark API wrapper.
160
160
  test_files: