deneuxa-contacts 1.2.9 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/contacts.rb CHANGED
@@ -1,4 +1,5 @@
1
- $:.unshift(File.dirname(__FILE__)+"/contacts/")
1
+ class Contacts
2
+ $:.unshift(File.dirname(__FILE__)+"/contacts/")
2
3
 
3
4
  require 'rubygems'
4
5
 
@@ -10,3 +11,4 @@ require 'yahoo'
10
11
  require 'plaxo'
11
12
  require 'aol'
12
13
  require 'mailru'
14
+ end
@@ -62,12 +62,17 @@ class Contacts
62
62
  url = URI.parse(contact_list_url)
63
63
  data, resp, cookies, forward = get(get_contact_list_url, @cookies )
64
64
  data.gsub!(";",",")
65
- @contacts = FasterCSV.parse(data, {:headers => true}).map do |row|
65
+ data.gsub!("'","")
66
+ data = data.gsub(/[\x80-\xff]/,"")
67
+
68
+ @contacts = FasterCSV.parse(data, {:headers => true, :col_sep => ','}).map do |row|
66
69
  name = ""
67
70
  name = row["First Name"] if !row["First Name"].nil?
68
71
  name << " #{row["Last Name"]}" if !row["Last Name"].nil?
69
- [name, row["E-mail Address"]]
72
+ email = row["E-mail Address"] || ""
73
+ [name, email]
70
74
  end
75
+ @contacts.delete_if{|x| x[1].blank?}
71
76
  else
72
77
  @contacts || []
73
78
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deneuxa-contacts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 9
10
- version: 1.2.9
9
+ - 10
10
+ version: 1.2.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lucas Carlson
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-02-22 00:00:00 Z
20
+ date: 2012-02-23 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: json