diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 124818238..268321c88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/lib/net/imap.rb b/lib/net/imap.rb index e576c64a0..0ed3514c2 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -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]) diff --git a/lib/net/imap/authenticators.rb b/lib/net/imap/authenticators.rb index 44f781e58..3104a36c6 100644 --- a/lib/net/imap/authenticators.rb +++ b/lib/net/imap/authenticators.rb @@ -39,15 +39,11 @@ def add_authenticator(auth_type, authenticator) # # The returned object represents a single authentication exchange and must # not 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 diff --git a/net-imap.gemspec b/net-imap.gemspec index 6b791c868..b8c132802 100644 --- a/net-imap.gemspec +++ b/net-imap.gemspec @@ -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