Skip to content

Commit cfa233b

Browse files
authored
Merge pull request #37 from railsware/drop-ruby-3-0
Drop Ruby 3.0 support
2 parents 47ffeda + be11db7 commit cfa233b

13 files changed

+65
-61
lines changed

.github/workflows/main.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ jobs:
99
strategy:
1010
matrix:
1111
ruby:
12-
- '3.0.7'
1312
- '3.1.6'
14-
- '3.2.4'
15-
- '3.3.3'
16-
13+
- '3.2.7'
14+
- '3.3.7'
15+
- '3.4.2'
1716
steps:
1817
- uses: actions/checkout@v4
1918
- name: Set up Ruby

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ inherit_mode:
77
- Exclude
88

99
AllCops:
10-
TargetRubyVersion: 3.0
10+
TargetRubyVersion: 3.1
1111
NewCops: enable
1212
Exclude:
1313
- "gemfiles/**/*"

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [2.3.0] - 2025-03-06
2+
3+
- Drop Ruby 3.0 support
4+
- Update dependencies
5+
16
## [2.2.0] - 2024-12-18
27

38
- Added `reply_to` parameter support

Gemfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
mailtrap (2.2.0)
4+
mailtrap (2.3.0)
55

66
GEM
77
remote: https://rubygems.org/
@@ -17,7 +17,7 @@ GEM
1717
crack (1.0.0)
1818
bigdecimal
1919
rexml
20-
date (3.3.4)
20+
date (3.4.1)
2121
diff-lcs (1.5.1)
2222
hashdiff (1.1.0)
2323
json (2.7.2)
@@ -28,7 +28,7 @@ GEM
2828
net-pop
2929
net-smtp
3030
mini_mime (1.1.5)
31-
net-imap (0.4.14)
31+
net-imap (0.5.6)
3232
date
3333
net-protocol
3434
net-pop (0.1.2)
@@ -82,7 +82,7 @@ GEM
8282
rubocop (~> 1.61)
8383
ruby-progressbar (1.13.0)
8484
thor (1.3.1)
85-
timeout (0.4.1)
85+
timeout (0.4.3)
8686
unicode-display_width (2.5.0)
8787
vcr (6.2.0)
8888
webmock (3.23.1)
@@ -108,4 +108,4 @@ DEPENDENCIES
108108
webmock
109109

110110
BUNDLED WITH
111-
2.5.14
111+
2.6.5

lib/mailtrap/client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize( # rubocop:disable Metrics/ParameterLists
3535
raise ArgumentError, 'api_key is required' if api_key.nil?
3636
raise ArgumentError, 'api_port is required' if api_port.nil?
3737

38-
api_host ||= select_api_host(bulk: bulk, sandbox: sandbox)
38+
api_host ||= select_api_host(bulk:, sandbox:)
3939
raise ArgumentError, 'inbox_id is required for sandbox API' if sandbox && inbox_id.nil?
4040

4141
@api_key = api_key

lib/mailtrap/mail/base.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def attachments=(attachments)
6767

6868
def add_attachment(content:, filename:, type: nil, disposition: nil, content_id: nil)
6969
attachment = Mailtrap::Attachment.new(
70-
content: content,
71-
filename: filename,
72-
type: type,
73-
disposition: disposition,
74-
content_id: content_id
70+
content:,
71+
filename:,
72+
type:,
73+
disposition:,
74+
content_id:
7575
)
7676
attachments << attachment
7777

lib/mailtrap/mail/from_template.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ def initialize( # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
1818
template_variables: {}
1919
)
2020
super(
21-
from: from,
22-
to: to,
23-
reply_to: reply_to,
24-
cc: cc,
25-
bcc: bcc,
26-
attachments: attachments,
27-
headers: headers,
28-
custom_variables: custom_variables
21+
from:,
22+
to:,
23+
reply_to:,
24+
cc:,
25+
bcc:,
26+
attachments:,
27+
headers:,
28+
custom_variables:
2929
)
3030
@template_uuid = template_uuid
3131
@template_variables = template_variables

lib/mailtrap/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Mailtrap
4-
VERSION = '2.2.0'
4+
VERSION = '2.3.0'
55
end

mailtrap.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
1212
spec.description = 'Official mailtrap.io API client'
1313
spec.homepage = 'https://github.com/railsware/mailtrap-ruby'
1414
spec.license = 'MIT'
15-
spec.required_ruby_version = '>= 3.0.0'
15+
spec.required_ruby_version = '>= 3.1.0'
1616

1717
spec.metadata['homepage_uri'] = spec.homepage
1818
spec.metadata['source_code_uri'] = 'https://github.com/railsware/mailtrap-ruby'

spec/mailtrap/attachment_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
RSpec.describe Mailtrap::Attachment do
77
subject(:attachment) do
88
described_class.new(
9-
content: content,
10-
filename: filename,
11-
type: type,
12-
disposition: disposition,
13-
content_id: content_id
9+
content:,
10+
filename:,
11+
type:,
12+
disposition:,
13+
content_id:
1414
)
1515
end
1616

spec/mailtrap/client_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Mailtrap::Client do
4-
subject(:client) { described_class.new(api_key: api_key) }
4+
subject(:client) { described_class.new(api_key:) }
55

66
let(:api_key) { 'correct-api-key' }
77

@@ -65,7 +65,7 @@
6565

6666
context 'with an alternative host' do
6767
let(:client) do
68-
described_class.new(api_key: api_key, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
68+
described_class.new(api_key:, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
6969
end
7070

7171
it 'sending is successful' do
@@ -75,7 +75,7 @@
7575

7676
context 'with bulk flag' do
7777
let(:client) do
78-
described_class.new(api_key: api_key, bulk: true)
78+
described_class.new(api_key:, bulk: true)
7979
end
8080

8181
it 'chooses host for bulk sending' do
@@ -85,7 +85,7 @@
8585

8686
context 'with bulk flag and alternative host' do
8787
let(:client) do
88-
described_class.new(api_key: api_key, bulk: true, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
88+
described_class.new(api_key:, bulk: true, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
8989
end
9090

9191
it 'chooses alternative host' do
@@ -95,7 +95,7 @@
9595

9696
context 'with sandbox flag' do
9797
let(:client) do
98-
described_class.new(api_key: api_key, sandbox: true, inbox_id: 12)
98+
described_class.new(api_key:, sandbox: true, inbox_id: 12)
9999
end
100100

101101
it 'chooses host for sandbox sending' do
@@ -105,15 +105,15 @@
105105

106106
context 'with sandbox flag without inbox id' do
107107
let(:client) do
108-
described_class.new(api_key: api_key, sandbox: true)
108+
described_class.new(api_key:, sandbox: true)
109109
end
110110

111111
it { expect { send }.to raise_error(ArgumentError, 'inbox_id is required for sandbox API') }
112112
end
113113

114114
context 'with bulk and sandbox flag' do
115115
let(:client) do
116-
described_class.new(api_key: api_key, bulk: true, sandbox: true)
116+
described_class.new(api_key:, bulk: true, sandbox: true)
117117
end
118118

119119
it { expect { send }.to raise_error(ArgumentError, 'bulk mode is not applicable for sandbox API') }
@@ -155,7 +155,7 @@
155155

156156
context 'when using sandbox' do
157157
let(:client) do
158-
described_class.new(api_key: api_key, sandbox: true, inbox_id: 13)
158+
described_class.new(api_key:, sandbox: true, inbox_id: 13)
159159
end
160160

161161
it 'sending is successful' do
@@ -178,7 +178,7 @@
178178
end
179179

180180
def stub_api_send(status, body = nil)
181-
stub = stub_request(:post, %r{/api/send}).to_return(status: status, body: body)
181+
stub = stub_request(:post, %r{/api/send}).to_return(status:, body:)
182182
yield
183183
expect(stub).to have_been_requested
184184
end

spec/mailtrap/mail/base_spec.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
RSpec.describe Mailtrap::Mail::Base do
77
subject(:mail) do
88
described_class.new(
9-
from: from,
10-
to: to,
11-
reply_to: reply_to,
12-
cc: cc,
13-
bcc: bcc,
9+
from:,
10+
to:,
11+
reply_to:,
12+
cc:,
13+
bcc:,
1414
subject: mail_subject,
15-
text: text,
16-
html: html,
17-
attachments: attachments,
18-
headers: headers,
19-
category: category,
20-
custom_variables: custom_variables
15+
text:,
16+
html:,
17+
attachments:,
18+
headers:,
19+
category:,
20+
custom_variables:
2121
)
2222
end
2323

spec/mailtrap/mail/from_template_spec.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
RSpec.describe Mailtrap::Mail::FromTemplate do
77
subject(:mail) do
88
described_class.new(
9-
from: from,
10-
to: to,
11-
reply_to: reply_to,
12-
cc: cc,
13-
bcc: bcc,
14-
attachments: attachments,
15-
headers: headers,
16-
custom_variables: custom_variables,
17-
template_uuid: template_uuid,
18-
template_variables: template_variables
9+
from:,
10+
to:,
11+
reply_to:,
12+
cc:,
13+
bcc:,
14+
attachments:,
15+
headers:,
16+
custom_variables:,
17+
template_uuid:,
18+
template_variables:
1919
)
2020
end
2121

0 commit comments

Comments
 (0)