Skip to content

Commit

Permalink
Deprecate Ruby 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyates committed Jun 4, 2024
1 parent 7c5e9ee commit 58655b4
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
ruby:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AllCops:
- "vendor/**/*"
DisplayCopNames:
Enabled: true
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0

Capybara:
Enabled: false
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 14.7.0 - 2024-06-04
## 15.0.0 - 2024-06-04

### Changed

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

* Deprecated Ruby 2.x Support

## 14.6.1 - 2024-03-30

### Changed
Expand Down
2 changes: 1 addition & 1 deletion contrib/extract-email
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Options
"--account [email protected] " \
"--folder INBOX " \
"--uid 12345 " \
"--quiet"
"--quiet".freeze

def parser
@parser ||= OptionParser.new do |opts|
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/rubygem.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Check you have Ruby installed
ruby -v
```

You need at least Ruby 2.7 installed.
You need at least Ruby 3.0 installed.

# Install

Expand Down
2 changes: 1 addition & 1 deletion imap-backup.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |gem|

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

gem.add_runtime_dependency "highline"
gem.add_runtime_dependency "mail", "2.7.1"
Expand Down
6 changes: 3 additions & 3 deletions lib/imap/backup/client/automatic_login_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def initialize(client:)
# Proxies calls to the client.
# Before the first call does login
# @return the return value of the client method called
def method_missing(method_name, *arguments, &block)
def method_missing(method_name, ...)
if login_called
client.send(method_name, *arguments, &block)
client.send(method_name, ...)
else
do_first_login
client.send(method_name, *arguments, &block) if method_name != :login
client.send(method_name, ...) if method_name != :login
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/imap/backup/naming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Naming
# The characters that cannot be used in file names
INVALID_FILENAME_CHARACTERS = ":%;".freeze
# A regular expression that captures each disallowed character
INVALID_FILENAME_CHARACTER_MATCH = /([#{INVALID_FILENAME_CHARACTERS}])/.freeze
INVALID_FILENAME_CHARACTER_MATCH = /([#{INVALID_FILENAME_CHARACTERS}])/

# @param name [String] a folder name
# @return [String] the supplied string iwth disallowed characters replaced
Expand Down
2 changes: 1 addition & 1 deletion lib/imap/backup/setup/asker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def self.password

private

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

attr_reader :highline
end
Expand Down
4 changes: 2 additions & 2 deletions lib/imap/backup/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module Imap; end

module Imap::Backup
# @private
MAJOR = 14
MAJOR = 15
# @private
MINOR = 7
MINOR = 0
# @private
REVISION = 0
# @private
Expand Down
2 changes: 1 addition & 1 deletion spec/features/helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
support_glob = File.expand_path("support/**/*.rb", __dir__)
Dir[support_glob].sort.each { |f| require f }
Dir[support_glob].each { |f| require f }
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
$LOAD_PATH << File.expand_path("../lib", __dir__)

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

silence_logging
2 changes: 1 addition & 1 deletion spec/unit/cli/backup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Imap::Backup

it_behaves_like(
"an action that requires an existing configuration",
action: ->(subject) { subject.run }
action: lambda(&:run)
)

it "runs the backup for each connection" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/cli/local_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module Imap::Backup
describe "accounts" do
it_behaves_like(
"an action that requires an existing configuration",
action: ->(subject) { subject.accounts }
action: lambda(&:accounts)
)

it "lists configured emails" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/cli/restore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Imap::Backup

it_behaves_like(
"an action that requires an existing configuration",
action: ->(subject) { subject.run }
action: lambda(&:run)
)

it "runs restore on the account" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/cli/setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Imap::Backup

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

it "reruns the setup process" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/cli/transfer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module Imap::Backup

it_behaves_like(
"an action that requires an existing configuration",
action: ->(subject) { subject.run }
action: lambda(&:run)
)

context "when in migrate mode" do
Expand Down

0 comments on commit 58655b4

Please sign in to comment.