Skip to content

Commit

Permalink
⬆️ Drop v2.6 support; Require v2.7.3; Use "..." arg
Browse files Browse the repository at this point in the history
v2.7.0-v2.7.2, didn't allow "..." to be used with leading arguments, so
the minimum version is v2.7.3.
  • Loading branch information
nevans committed Jan 2, 2023
1 parent 87ba74e commit 2ea4086
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ jobs:
ruby: [ head, '3.1', '3.0', '2.7' ]
os: [ ubuntu-latest, macos-latest ]
experimental: [false]
include:
# - ruby: 2.6
# os: ubuntu-latest
# experimental: true
- ruby: 2.6
os: macos-latest
experimental: false
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions lib/net/imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,8 @@ def starttls(options = {}, verify = true)
# imap.login username, password
# end
#
def authenticate(mechanism, *args, **props, &cb)
authenticator = self.class.authenticator(mechanism, *args, **props, &cb)
def authenticate(mechanism, ...)
authenticator = self.class.authenticator(mechanism, ...)
send_command("AUTHENTICATE", mechanism) do |resp|
if resp.instance_of?(ContinuationRequest)
data = authenticator.process(resp.data.text.unpack("m")[0])
Expand Down
10 changes: 3 additions & 7 deletions lib/net/imap/authenticators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ def add_authenticator(auth_type, authenticator)
#
# The returned object represents a single authentication exchange and <em>must
# not</em> be reused for multiple authentication attempts.
def authenticator(mechanism, *authargs, **properties, &callback)
authenticator = authenticators.fetch(mechanism.upcase) do
def authenticator(mechanism, ...)
auth = authenticators.fetch(mechanism.upcase) do
raise ArgumentError, 'unknown auth type - "%s"' % mechanism
end
if authenticator.respond_to?(:new)
authenticator.new(*authargs, **properties, &callback)
else
authenticator.call(*authargs, **properties, &callback)
end
auth.respond_to?(:new) ? auth.new(...) : auth.call(...)
end

private
Expand Down
2 changes: 1 addition & 1 deletion net-imap.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.summary = %q{Ruby client api for Internet Message Access Protocol}
spec.description = %q{Ruby client api for Internet Message Access Protocol}
spec.homepage = "https://github.com/ruby/net-imap"
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.3")
spec.licenses = ["Ruby", "BSD-2-Clause"]

spec.metadata["homepage_uri"] = spec.homepage
Expand Down

0 comments on commit 2ea4086

Please sign in to comment.