Skip to content

Commit 4b89a14

Browse files
Update minimal Ruby version to 3.0. Update Ruby version used on CI. Update CI script. Update development gems
1 parent 705b4a2 commit 4b89a14

File tree

12 files changed

+94
-60
lines changed

12 files changed

+94
-60
lines changed

.github/workflows/main.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ jobs:
99
strategy:
1010
matrix:
1111
ruby:
12-
- '2.7.6'
13-
- '3.0.4'
14-
- '3.1.2'
12+
- '3.0.7'
13+
- '3.1.6'
14+
- '3.2.4'
15+
- '3.3.3'
1516

1617
steps:
17-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1819
- name: Set up Ruby
1920
uses: ruby/setup-ruby@v1
2021
with:
2122
ruby-version: ${{ matrix.ruby }}
22-
- name: Bundle
23-
run: bundle install
23+
bundler-cache: true
24+
2425
- name: Appraisal install
2526
run: bundle exec appraisal install
2627

.rubocop.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
require: rubocop-rspec
1+
require:
2+
- rubocop-rake
3+
- rubocop-rspec
4+
5+
inherit_mode:
6+
merge:
7+
- Exclude
28

39
AllCops:
4-
TargetRubyVersion: 2.7
10+
TargetRubyVersion: 3.0
511
NewCops: enable
612
Exclude:
7-
- 'gemfiles/**/*'
13+
- "gemfiles/**/*"
814

915
Layout/LineLength:
1016
Max: 120
@@ -34,8 +40,8 @@ Style/StringLiteralsInInterpolation:
3440

3541
Style/FrozenStringLiteralComment:
3642
Exclude:
37-
- 'examples/**/*'
43+
- "examples/**/*"
3844

3945
Style/TrailingCommaInHashLiteral:
4046
Exclude:
41-
- 'examples/**/*'
47+
- "examples/**/*"

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.6
1+
3.3.3

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ gem 'rake', '~> 13.0'
1111
gem 'rspec', '~> 3.0'
1212
gem 'rspec-its'
1313
gem 'rubocop', '~> 1.21'
14+
gem 'rubocop-rake', require: false
1415
gem 'rubocop-rspec', require: false
1516
gem 'vcr'
1617
gem 'webmock'

Gemfile.lock

+66-40
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,88 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
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)
1212
bundler
1313
rake
1414
thor (>= 0.14.0)
1515
ast (2.4.2)
16-
crack (0.4.5)
16+
bigdecimal (3.1.8)
17+
crack (1.0.0)
18+
bigdecimal
1719
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)
2126
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)
2642
ast (~> 2.4.1)
27-
public_suffix (4.0.7)
43+
racc
44+
public_suffix (5.1.1)
45+
racc (1.8.0)
2846
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)
3958
diff-lcs (>= 1.2.0, < 2.0)
40-
rspec-support (~> 3.11.0)
59+
rspec-support (~> 3.13.0)
4160
rspec-its (1.3.0)
4261
rspec-core (>= 3.0.0)
4362
rspec-expectations (>= 3.0.0)
44-
rspec-mocks (3.11.1)
63+
rspec-mocks (3.13.1)
4564
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)
4970
parallel (~> 1.10)
50-
parser (>= 3.1.0.0)
71+
parser (>= 3.3.0.2)
5172
rainbow (>= 2.2.2, < 4.0)
5273
regexp_parser (>= 1.8, < 3.0)
5374
rexml (>= 3.2.5, < 4.0)
54-
rubocop-ast (>= 1.17.0, < 2.0)
75+
rubocop-ast (>= 1.31.1, < 2.0)
5576
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)
6691
addressable (>= 2.8.0)
6792
crack (>= 0.3.2)
6893
hashdiff (>= 0.4.0, < 2.0.0)
@@ -79,9 +104,10 @@ DEPENDENCIES
79104
rspec (~> 3.0)
80105
rspec-its
81106
rubocop (~> 1.21)
107+
rubocop-rake
82108
rubocop-rspec
83109
vcr
84110
webmock
85111

86112
BUNDLED WITH
87-
2.1.4
113+
2.5.14

examples/full.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131

3232
data = File.read('/path/to/image.jpg')
33-
encoded = Base64.encode64(data).gsub(/\n/, '')
33+
encoded = Base64.encode64(data).gsub("\n", '')
3434

3535
mail.add_attachment(content: encoded, filename: 'image.png')
3636

lib/mailtrap/attachment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def content=(content)
4040

4141
def encode(io)
4242
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", '')
4444
end
4545

4646
def base64?(string)

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 = '>= 2.7.0'
15+
spec.required_ruby_version = '>= 3.0.0'
1616

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

spec/mailtrap/action_mailer/delivery_method_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
end
4343

4444
before do
45-
allow(::Mail::ContentTypeField).to receive(:generate_boundary).and_return('--==_mimepart_random_boundary')
45+
allow(Mail::ContentTypeField).to receive(:generate_boundary).and_return('--==_mimepart_random_boundary')
4646
allow(Mailtrap::Client).to receive(:new).and_call_original
4747
end
4848

spec/mailtrap/mail/base_spec.rb

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

3-
require_relative './shared'
3+
require_relative 'shared'
44

55
# rubocop:disable RSpec/MultipleMemoizedHelpers
66
RSpec.describe Mailtrap::Mail::Base do
@@ -129,7 +129,7 @@
129129
'"cc":[{"email":"[email protected]"}],' \
130130
'"bcc":[{"email":"[email protected]"}],' \
131131
'"subject":"This is subject",' \
132-
'"text":"This is text",'\
132+
'"text":"This is text",' \
133133
'"html":"<div>Test HTML</div>",' \
134134
'"attachments":[{"content":"aGVsbG8gd29ybGQ=","filename":"attachment.txt"}],' \
135135
'"headers":{"Category-Header":"some_category"},' \

spec/mailtrap/mail/from_template_spec.rb

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

3-
require_relative './shared'
3+
require_relative 'shared'
44

55
# rubocop:disable RSpec/MultipleMemoizedHelpers
66
RSpec.describe Mailtrap::Mail::FromTemplate do

spec/mailtrap/mail_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
described_class.from_message(message)
77
end
88

9-
let(:message) { ::Mail::Message.new(**message_params) }
9+
let(:message) { Mail::Message.new(**message_params) }
1010
let(:message_params) do
1111
{
1212
from: 'Mailtrap Test <[email protected]>',

0 commit comments

Comments
 (0)