Skip to content

Commit 81ca133

Browse files
committed
Deprecate Ruby 2.x
1 parent 7c5e9ee commit 81ca133

17 files changed

+22
-21
lines changed

.github/workflows/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
strategy:
1616
matrix:
1717
ruby:
18-
- '2.7'
1918
- '3.0'
2019
- '3.1'
2120
- '3.2'

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AllCops:
88
- "vendor/**/*"
99
DisplayCopNames:
1010
Enabled: true
11-
TargetRubyVersion: 2.7
11+
TargetRubyVersion: 3.0
1212

1313
Capybara:
1414
Enabled: false

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## 14.7.0 - 2024-06-04
8+
## 15.0.1 - 2024-06-04
99

1010
### Changed
1111

@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717
repeated writes of the JSON metadata file. This is a change inspired by
1818
this pull request: https://github.com/joeyates/imap-backup/pull/200.
1919

20+
* Deprecated Ruby 2.x Support
21+
2022
## 14.6.1 - 2024-03-30
2123

2224
### Changed

contrib/extract-email

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Options
4646
"--account me@example.com " \
4747
"--folder INBOX " \
4848
"--uid 12345 " \
49-
"--quiet"
49+
"--quiet".freeze
5050

5151
def parser
5252
@parser ||= OptionParser.new do |opts|

docs/installation/rubygem.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Check you have Ruby installed
99
ruby -v
1010
```
1111

12-
You need at least Ruby 2.7 installed.
12+
You need at least Ruby 3.0 installed.
1313

1414
# Install
1515

imap-backup.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
1818

1919
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
2020
gem.require_paths = ["lib"]
21-
gem.required_ruby_version = ">= 2.7"
21+
gem.required_ruby_version = ">= 3.0"
2222

2323
gem.add_runtime_dependency "highline"
2424
gem.add_runtime_dependency "mail", "2.7.1"

lib/imap/backup/client/automatic_login_wrapper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def initialize(client:)
2323
# Proxies calls to the client.
2424
# Before the first call does login
2525
# @return the return value of the client method called
26-
def method_missing(method_name, *arguments, &block)
26+
def method_missing(method_name, ...)
2727
if login_called
28-
client.send(method_name, *arguments, &block)
28+
client.send(method_name, ...)
2929
else
3030
do_first_login
31-
client.send(method_name, *arguments, &block) if method_name != :login
31+
client.send(method_name, ...) if method_name != :login
3232
end
3333
end
3434

lib/imap/backup/naming.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Naming
77
# The characters that cannot be used in file names
88
INVALID_FILENAME_CHARACTERS = ":%;".freeze
99
# A regular expression that captures each disallowed character
10-
INVALID_FILENAME_CHARACTER_MATCH = /([#{INVALID_FILENAME_CHARACTERS}])/.freeze
10+
INVALID_FILENAME_CHARACTER_MATCH = /([#{INVALID_FILENAME_CHARACTERS}])/
1111

1212
# @param name [String] a folder name
1313
# @return [String] the supplied string iwth disallowed characters replaced

lib/imap/backup/setup/asker.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def self.password
5555

5656
private
5757

58-
EMAIL_MATCHER = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+$/i.freeze
58+
EMAIL_MATCHER = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+$/i
5959

6060
attr_reader :highline
6161
end

lib/imap/backup/version.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ module Imap; end
22

33
module Imap::Backup
44
# @private
5-
MAJOR = 14
5+
MAJOR = 15
66
# @private
7-
MINOR = 7
7+
MINOR = 0
88
# @private
9-
REVISION = 0
9+
REVISION = 1
1010
# @private
1111
PRE = nil
1212
# The application version

spec/features/helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
support_glob = File.expand_path("support/**/*.rb", __dir__)
2-
Dir[support_glob].sort.each { |f| require f }
2+
Dir[support_glob].each { |f| require f }

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
$LOAD_PATH << File.expand_path("../lib", __dir__)
77

88
support_glob = File.join(__dir__, "support", "**", "*.rb")
9-
Dir[support_glob].sort.each { |f| require f }
9+
Dir[support_glob].each { |f| require f }
1010

1111
silence_logging

spec/unit/cli/backup_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module Imap::Backup
1818

1919
it_behaves_like(
2020
"an action that requires an existing configuration",
21-
action: ->(subject) { subject.run }
21+
action: lambda(&:run)
2222
)
2323

2424
it "runs the backup for each connection" do

spec/unit/cli/local_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module Imap::Backup
5252
describe "accounts" do
5353
it_behaves_like(
5454
"an action that requires an existing configuration",
55-
action: ->(subject) { subject.accounts }
55+
action: lambda(&:accounts)
5656
)
5757

5858
it "lists configured emails" do

spec/unit/cli/restore_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Imap::Backup
2121

2222
it_behaves_like(
2323
"an action that requires an existing configuration",
24-
action: ->(subject) { subject.run }
24+
action: lambda(&:run)
2525
)
2626

2727
it "runs restore on the account" do

spec/unit/cli/setup_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Imap::Backup
1717

1818
it_behaves_like(
1919
"an action that doesn't require an existing configuration",
20-
action: ->(subject) { subject.run }
20+
action: lambda(&:run)
2121
)
2222

2323
it "reruns the setup process" do

spec/unit/cli/transfer_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module Imap::Backup
4949

5050
it_behaves_like(
5151
"an action that requires an existing configuration",
52-
action: ->(subject) { subject.run }
52+
action: lambda(&:run)
5353
)
5454

5555
context "when in migrate mode" do

0 commit comments

Comments
 (0)