Skip to content

Commit

Permalink
Support Ruby 1.8.7 in monkey patch for Net::SMTP TLS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Spataro authored and bguthrie committed Feb 15, 2010
1 parent 5abf0d8 commit 2fa92dd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/smtp_tls.rb
Expand Up @@ -4,7 +4,19 @@
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret, authtype if user or secret

if user or secret
arity = instance_method(:check_auth_args).arity

if arity == 2
#Ruby 1.8.7 and above -- check_auth_args takes two args, check_auth_method is separate
check_auth_method(authtype || DEFAULT_AUTH_TYPE)
check_auth_args user, secret
else
#Ruby 1.8.6 and below -- check_auth_args takes three args
check_auth_args user, secret, authtype
end
end

open_conversation(helodomain)

Expand Down

0 comments on commit 2fa92dd

Please sign in to comment.