Permalink
Browse files

Should be able to skip login

  • Loading branch information...
1 parent d5ff6e4 commit 336215b1c81a0922289fe337284fa64e3264158c Anton Dubina committed with niels Aug 20, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/contacts/base.rb
View
@@ -27,12 +27,15 @@ def initialize(login, password, options={})
@captcha_token = options[:captcha_token]
@captcha_response = options[:captcha_response]
@connections = {}
+ @skip_login = options[:skip_login]
connect
end
def connect
- raise AuthenticationError, "Login and password must not be nil, login: #{@login.inspect}, password: #{@password.inspect}" if @login.nil? || @login.empty? || @password.nil? || @password.empty?
- real_connect
+ unless @skip_login
+ raise AuthenticationError, "Login and password must not be nil, login: #{@login.inspect}, password: #{@password.inspect}" if @login.nil? || @login.empty? || @password.nil? || @password.empty?
+ real_connect
+ end
end
def connected?

0 comments on commit 336215b

Please sign in to comment.