rakutenusa-blackbook 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 0
3
- :patch: 13
3
+ :patch: 14
4
4
  :major: 1
data/lib/blackbook.rb CHANGED
@@ -8,6 +8,7 @@ class Blackbook
8
8
 
9
9
  class BlackbookError < ::StandardError; end
10
10
  class BadCredentialsError < BlackbookError; end
11
+ class LegacyAccount < BlackbookError; end
11
12
 
12
13
  attr_accessor :importers
13
14
  attr_accessor :exporters
@@ -27,7 +27,12 @@ class Blackbook::Importer::Aol < Blackbook::Importer::PageScraper
27
27
  form.password = options[:password]
28
28
  page = agent.submit(form, form.buttons.first)
29
29
 
30
- raise( Blackbook::BadCredentialsError, "That username and password was not accepted. Please check them and try again." ) if page.body =~ /Invalid Screen Name or Password. Please try again./
30
+ case page.body
31
+ when /Invalid Screen Name or Password. Please try again./
32
+ raise( Blackbook::BadCredentialsError, "That username and password was not accepted. Please check them and try again." )
33
+ when /Terms of Service/
34
+ raise( Blackbook::LegacyAccount, "Your AOL account is not setup for WebMail. Please signup: http://webmail.aol.com")
35
+ end
31
36
 
32
37
  base_uri = page.body.scan(/^var gSuccessPath = \"(.+)\";/).first.first
33
38
  raise( Blackbook::BadCredentialsError, "You do not appear to be signed in." ) unless base_uri
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakutenusa-blackbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rany Keddo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-03-10 00:00:00 -07:00
13
+ date: 2009-03-31 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16