Skip to content

Commit

Permalink
Should be able to skip login
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Dubina authored and niels committed Aug 24, 2011
1 parent d5ff6e4 commit 336215b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/contacts/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 336215b

Please sign in to comment.