liangzan-contacts 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/contacts/gmail.rb +10 -1
  2. metadata +9 -8
@@ -18,9 +18,18 @@ class Contacts
18
18
 
19
19
  @contacts = feed.elements.to_a('entry').collect do |entry|
20
20
  title, email = entry.elements['title'].text, nil
21
+ primary_email = nil
22
+
21
23
  entry.elements.each('gd:email') do |e|
22
- email = e.attribute('address').value if e.attribute('primary')
24
+ if e.attribute('primary')
25
+ primary_email = e.attribute('address').value
26
+ else
27
+ email = e.attribute('address').value
28
+ end
23
29
  end
30
+
31
+ email = primary_email unless primary_email.nil?
32
+
24
33
  [title, email] unless email.nil?
25
34
  end
26
35
  @contacts.compact!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liangzan-contacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.2.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,15 @@ authors:
9
9
  - Brad Imbierowicz
10
10
  - Wong Liang Zan
11
11
  - Mateusz Konikowski
12
+ - Laurynas Butkus
12
13
  autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
- date: 2012-03-02 00:00:00.000000000Z
16
+ date: 2012-03-13 00:00:00.000000000Z
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency
18
19
  name: json
19
- requirement: &8102920 !ruby/object:Gem::Requirement
20
+ requirement: &4012780 !ruby/object:Gem::Requirement
20
21
  none: false
21
22
  requirements:
22
23
  - - ~>
@@ -24,10 +25,10 @@ dependencies:
24
25
  version: 1.6.5
25
26
  type: :runtime
26
27
  prerelease: false
27
- version_requirements: *8102920
28
+ version_requirements: *4012780
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: gdata_19
30
- requirement: &8101380 !ruby/object:Gem::Requirement
31
+ requirement: &4011260 !ruby/object:Gem::Requirement
31
32
  none: false
32
33
  requirements:
33
34
  - - ~>
@@ -35,10 +36,10 @@ dependencies:
35
36
  version: 1.1.3
36
37
  type: :runtime
37
38
  prerelease: false
38
- version_requirements: *8101380
39
+ version_requirements: *4011260
39
40
  - !ruby/object:Gem::Dependency
40
41
  name: nokogiri
41
- requirement: &8100560 !ruby/object:Gem::Requirement
42
+ requirement: &4010340 !ruby/object:Gem::Requirement
42
43
  none: false
43
44
  requirements:
44
45
  - - ~>
@@ -46,7 +47,7 @@ dependencies:
46
47
  version: 1.5.0
47
48
  type: :runtime
48
49
  prerelease: false
49
- version_requirements: *8100560
50
+ version_requirements: *4010340
50
51
  description: A universal interface to grab contact list information from various providers
51
52
  including Yahoo, AOL, Gmail, Hotmail, and Plaxo. Now supporting Ruby 1.9.
52
53
  email: zan@liangzan.net