Skip to content

Commit

Permalink
Moved TLS fix over to a Ruby version check rather than an arity check…
Browse files Browse the repository at this point in the history
…. Both are fragile but this is more explicit.
  • Loading branch information
bguthrie committed Feb 15, 2010
1 parent 2fa92dd commit 34fc3f8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/smtp_tls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started

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
if RUBY_VERSION < "1.8.7"
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
Expand Down

0 comments on commit 34fc3f8

Please sign in to comment.