mailtrap 2.0.0 → 2.1.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: 7529f2a048f1670c6eb22f04a9308e17fb3072a0bcacdff87f3772e45f792201
4
- data.tar.gz: bc71abbd0af5a9c79d719aaaa69671aa836ec00f3a42c1c94991605ab803494d
3
+ metadata.gz: 5423fd6ba2817ace06e724da478e925615f3c8b4dfcbf24eb271f6bb12fded4c
4
+ data.tar.gz: b331be242b93d7176adf0ca92d01f33d0bc7a9407766d8d139d8bb39d7d2382b
5
5
  SHA512:
6
- metadata.gz: ad794ce35f915afd6ff52da55278c21146630f8f05a5f544477dbeb53c9eb7cf3277632b0f3584c909c6b3d8f2bd339c575f1d32da5065b86f88450053e716c1
7
- data.tar.gz: f5b564ce76bc6d9157c5e58654cbfe54ee7f1cf169b53b2d3856ecf8fda1cd7b1fef6becc6eac2ed6bf3bbbed29eb63b8bcfb8c58fb237e37d4b68e43a78a020
6
+ metadata.gz: 9c2556e7ea3b7405ec76910a718ba949694563dabc4547fc6b33771bd52a2bd0e444e287bcc341c6c5e1bdab07bd12573c3ce9607cbcc84afbd8398aafbccf4c
7
+ data.tar.gz: 06f0ea3e473461ad889e101540ba2d2a37cfda75ce3a4677ab58708ddae8ce4cae53d16426f4b30e54bf899e9a5f3cca0c46e0616c49b9da80be9c1e8c308c67
data/.rubocop.yml CHANGED
@@ -1,10 +1,16 @@
1
- require: rubocop-rspec
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
5
+ inherit_mode:
6
+ merge:
7
+ - Exclude
2
8
 
3
9
  AllCops:
4
- TargetRubyVersion: 2.7
10
+ TargetRubyVersion: 3.0
5
11
  NewCops: enable
6
12
  Exclude:
7
- - 'gemfiles/**/*'
13
+ - "gemfiles/**/*"
8
14
 
9
15
  Layout/LineLength:
10
16
  Max: 120
@@ -34,8 +40,8 @@ Style/StringLiteralsInInterpolation:
34
40
 
35
41
  Style/FrozenStringLiteralComment:
36
42
  Exclude:
37
- - 'examples/**/*'
43
+ - "examples/**/*"
38
44
 
39
45
  Style/TrailingCommaInHashLiteral:
40
46
  Exclude:
41
- - 'examples/**/*'
47
+ - "examples/**/*"
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.3.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [2.1.0] - 2024-07-08
2
+
3
+ - Fixed extraneous headers added by ActionMailer #21
4
+ - Dropped Ruby 2.7 support and added test coverage for Ruby up to 3.3 #22
5
+
1
6
  ## [2.0.0] - 2024-03-20
2
7
 
3
8
  - Added arguments for `Mailtrap::Client`
data/Gemfile CHANGED
@@ -11,6 +11,7 @@ gem 'rake', '~> 13.0'
11
11
  gem 'rspec', '~> 3.0'
12
12
  gem 'rspec-its'
13
13
  gem 'rubocop', '~> 1.21'
14
+ gem 'rubocop-rake', require: false
14
15
  gem 'rubocop-rspec', require: false
15
16
  gem 'vcr'
16
17
  gem 'webmock'
data/Gemfile.lock CHANGED
@@ -1,68 +1,93 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mailtrap (2.0.0)
4
+ mailtrap (2.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.8.0)
10
- public_suffix (>= 2.0.2, < 5.0)
11
- appraisal (2.4.1)
9
+ addressable (2.8.7)
10
+ public_suffix (>= 2.0.2, < 7.0)
11
+ appraisal (2.5.0)
12
12
  bundler
13
13
  rake
14
14
  thor (>= 0.14.0)
15
15
  ast (2.4.2)
16
- crack (0.4.5)
16
+ bigdecimal (3.1.8)
17
+ crack (1.0.0)
18
+ bigdecimal
17
19
  rexml
18
- diff-lcs (1.5.0)
19
- hashdiff (1.0.1)
20
- mail (2.7.1)
20
+ date (3.3.4)
21
+ diff-lcs (1.5.1)
22
+ hashdiff (1.1.0)
23
+ json (2.7.2)
24
+ language_server-protocol (3.17.0.3)
25
+ mail (2.8.1)
21
26
  mini_mime (>= 0.1.1)
22
- mini_mime (1.1.2)
23
- net-smtp (0.1.0)
24
- parallel (1.22.1)
25
- parser (3.1.2.0)
27
+ net-imap
28
+ net-pop
29
+ net-smtp
30
+ mini_mime (1.1.5)
31
+ net-imap (0.4.14)
32
+ date
33
+ net-protocol
34
+ net-pop (0.1.2)
35
+ net-protocol
36
+ net-protocol (0.2.2)
37
+ timeout
38
+ net-smtp (0.5.0)
39
+ net-protocol
40
+ parallel (1.25.1)
41
+ parser (3.3.3.0)
26
42
  ast (~> 2.4.1)
27
- public_suffix (4.0.7)
43
+ racc
44
+ public_suffix (5.1.1)
45
+ racc (1.8.0)
28
46
  rainbow (3.1.1)
29
- rake (13.0.6)
30
- regexp_parser (2.4.0)
31
- rexml (3.2.5)
32
- rspec (3.11.0)
33
- rspec-core (~> 3.11.0)
34
- rspec-expectations (~> 3.11.0)
35
- rspec-mocks (~> 3.11.0)
36
- rspec-core (3.11.0)
37
- rspec-support (~> 3.11.0)
38
- rspec-expectations (3.11.0)
47
+ rake (13.2.1)
48
+ regexp_parser (2.9.2)
49
+ rexml (3.3.1)
50
+ strscan
51
+ rspec (3.13.0)
52
+ rspec-core (~> 3.13.0)
53
+ rspec-expectations (~> 3.13.0)
54
+ rspec-mocks (~> 3.13.0)
55
+ rspec-core (3.13.0)
56
+ rspec-support (~> 3.13.0)
57
+ rspec-expectations (3.13.1)
39
58
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.11.0)
59
+ rspec-support (~> 3.13.0)
41
60
  rspec-its (1.3.0)
42
61
  rspec-core (>= 3.0.0)
43
62
  rspec-expectations (>= 3.0.0)
44
- rspec-mocks (3.11.1)
63
+ rspec-mocks (3.13.1)
45
64
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.11.0)
47
- rspec-support (3.11.0)
48
- rubocop (1.29.1)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
67
+ rubocop (1.64.1)
68
+ json (~> 2.3)
69
+ language_server-protocol (>= 3.17.0)
49
70
  parallel (~> 1.10)
50
- parser (>= 3.1.0.0)
71
+ parser (>= 3.3.0.2)
51
72
  rainbow (>= 2.2.2, < 4.0)
52
73
  regexp_parser (>= 1.8, < 3.0)
53
74
  rexml (>= 3.2.5, < 4.0)
54
- rubocop-ast (>= 1.17.0, < 2.0)
75
+ rubocop-ast (>= 1.31.1, < 2.0)
55
76
  ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 1.4.0, < 3.0)
57
- rubocop-ast (1.18.0)
58
- parser (>= 3.1.1.0)
59
- rubocop-rspec (2.11.1)
60
- rubocop (~> 1.19)
61
- ruby-progressbar (1.11.0)
62
- thor (1.2.1)
63
- unicode-display_width (2.1.0)
64
- vcr (6.1.0)
65
- webmock (3.14.0)
77
+ unicode-display_width (>= 2.4.0, < 3.0)
78
+ rubocop-ast (1.31.3)
79
+ parser (>= 3.3.1.0)
80
+ rubocop-rake (0.6.0)
81
+ rubocop (~> 1.0)
82
+ rubocop-rspec (3.0.2)
83
+ rubocop (~> 1.61)
84
+ ruby-progressbar (1.13.0)
85
+ strscan (3.1.0)
86
+ thor (1.3.1)
87
+ timeout (0.4.1)
88
+ unicode-display_width (2.5.0)
89
+ vcr (6.2.0)
90
+ webmock (3.23.1)
66
91
  addressable (>= 2.8.0)
67
92
  crack (>= 0.3.2)
68
93
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -79,9 +104,10 @@ DEPENDENCIES
79
104
  rspec (~> 3.0)
80
105
  rspec-its
81
106
  rubocop (~> 1.21)
107
+ rubocop-rake
82
108
  rubocop-rspec
83
109
  vcr
84
110
  webmock
85
111
 
86
112
  BUNDLED WITH
87
- 2.1.4
113
+ 2.5.14
@@ -40,7 +40,7 @@ module Mailtrap
40
40
 
41
41
  def encode(io)
42
42
  string = io.read.encode('UTF-8') unless io.respond_to?(:binmode?) && io.binmode?
43
- Base64.encode64(string).gsub(/\n/, '')
43
+ Base64.encode64(string).gsub("\n", '')
44
44
  end
45
45
 
46
46
  def base64?(string)
data/lib/mailtrap/mail.rb CHANGED
@@ -26,7 +26,7 @@ module Mailtrap
26
26
 
27
27
  private
28
28
 
29
- PROCESSED_HEADERS = %w[
29
+ SPECIAL_HEADERS = %w[
30
30
  from
31
31
  to
32
32
  cc
@@ -37,6 +37,19 @@ module Mailtrap
37
37
  contenttype
38
38
  ].freeze
39
39
 
40
+ # ActionMailer adds these headers by calling `Mail::Message#encoded`,
41
+ # as if the message is to be delivered via SMTP.
42
+ # Since the message will actually be generated on the Mailtrap side from its components,
43
+ # the headers are redundant and potentially conflicting, so we remove them.
44
+ ACTIONMAILER_ADDED_HEADERS = %w[
45
+ contenttransferencoding
46
+ date
47
+ messageid
48
+ mimeversion
49
+ ].freeze
50
+
51
+ HEADERS_TO_REMOVE = (SPECIAL_HEADERS + ACTIONMAILER_ADDED_HEADERS).freeze
52
+
40
53
  def address_list(header)
41
54
  header.respond_to?(:element) ? header.element : header&.address_list
42
55
  end
@@ -48,7 +61,7 @@ module Mailtrap
48
61
  def prepare_headers(message)
49
62
  message
50
63
  .header_fields
51
- .reject { |header| PROCESSED_HEADERS.include?(header.name.downcase.delete('-')) }
64
+ .reject { |header| HEADERS_TO_REMOVE.include?(header.name.downcase.delete('-')) }
52
65
  .to_h { |header| [header.name, header.value] }
53
66
  .compact
54
67
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailtrap
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
data/mailtrap.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Official mailtrap.io API client'
13
13
  spec.homepage = 'https://github.com/railsware/mailtrap-ruby'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = '>= 2.7.0'
15
+ spec.required_ruby_version = '>= 3.0.0'
16
16
 
17
17
  spec.metadata['homepage_uri'] = spec.homepage
18
18
  spec.metadata['source_code_uri'] = 'https://github.com/railsware/mailtrap-ruby'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailtrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Railsware Products Studio LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Official mailtrap.io API client
14
14
  email:
@@ -56,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 2.7.0
59
+ version: 3.0.0
60
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.4.10
66
+ rubygems_version: 3.5.11
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Official mailtrap.io API client