11# frozen_string_literal: true
2+
23# = net/smtp.rb
34#
45# Copyright (c) 1999-2007 Yukihiro Matsumoto.
2223end
2324
2425module Net
25-
2626 # Module mixed in to all SMTP error classes
2727 module SMTPError
2828 # This *class* is a module for backward compatibility.
@@ -36,7 +36,7 @@ def initialize(response, message: nil)
3636 @message = message
3737 else
3838 @response = nil
39- @message = message || response
39+ @message = message || response
4040 end
4141 end
4242
@@ -187,7 +187,7 @@ class SMTPUnsupportedCommand < ProtocolError
187187 # user: 'Your Account', secret: 'Your Password', authtype: :cram_md5)
188188 #
189189 class SMTP < Protocol
190- VERSION = "0.3.3 "
190+ VERSION = "0.4.0 "
191191
192192 # The default SMTP port number, 25.
193193 def SMTP . default_port
@@ -210,7 +210,7 @@ class << self
210210
211211 def SMTP . default_ssl_context ( ssl_context_params = nil )
212212 context = OpenSSL ::SSL ::SSLContext . new
213- context . set_params ( ssl_context_params ? ssl_context_params : { } )
213+ context . set_params ( ssl_context_params || { } )
214214 context
215215 end
216216
@@ -281,7 +281,7 @@ def inspect
281281 attr_accessor :esmtp
282282
283283 # +true+ if the SMTP object uses ESMTP (which it does by default).
284- alias : esmtp? : esmtp
284+ alias esmtp? esmtp
285285
286286 # true if server advertises STARTTLS.
287287 # You cannot get valid value before opening SMTP session.
@@ -829,8 +829,6 @@ def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream
829829 # Authentication
830830 #
831831
832- public
833-
834832 DEFAULT_AUTH_TYPE = :plain
835833
836834 def authenticate ( user , secret , authtype = DEFAULT_AUTH_TYPE )
@@ -1130,11 +1128,9 @@ def to_s
11301128 @address
11311129 end
11321130 end
1133-
11341131 end # class SMTP
11351132
11361133 SMTPSession = SMTP # :nodoc:
1137-
11381134end
11391135
11401136require_relative 'smtp/authenticator'
0 commit comments