gmail_contacts 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ class GmailContacts::TestStub
44
44
  <email>eric@example.com</email>
45
45
  </author>
46
46
  <generator version="1.0" uri="http://www.google.com/m8/feeds">Contacts</generator>
47
- <openSearch:totalResults>3</openSearch:totalResults>
47
+ <openSearch:totalResults>4</openSearch:totalResults>
48
48
  <openSearch:startIndex>1</openSearch:startIndex>
49
49
  <openSearch:itemsPerPage>2</openSearch:itemsPerPage>
50
50
  <entry gd:etag="&quot;SHg-cTVSLip7ImA9WB5WGUUIQgc.&quot;">
@@ -99,7 +99,7 @@ AnyTown, ZZ 99999</gd:postalAddress>
99
99
  <email>eric@example.com</email>
100
100
  </author>
101
101
  <generator version="1.0" uri="http://www.google.com/m8/feeds">Contacts</generator>
102
- <openSearch:totalResults>3</openSearch:totalResults>
102
+ <openSearch:totalResults>4</openSearch:totalResults>
103
103
  <openSearch:startIndex>3</openSearch:startIndex>
104
104
  <openSearch:itemsPerPage>2</openSearch:itemsPerPage>
105
105
  <entry gd:etag="&quot;QXk_fTVSLyp7ImA9WxVUFUQITgA.&quot;">
@@ -114,6 +114,17 @@ AnyTown, ZZ 99999</gd:postalAddress>
114
114
  <gd:email rel="http://schemas.google.com/g/2005#other" address="coby@example.com" primary="true"/>
115
115
  <gContact:groupMembershipInfo deleted="false" href="http://www.google.com/m8/feeds/groups/eric%40example.com/base/6"/>
116
116
  </entry>
117
+ <entry gd:etag="&quot;QXk_fTVSLyp7ImA9WxVUFUQITgAz&quot;">
118
+ <id>http://www.google.com/m8/feeds/contacts/eric%40example.com/base/5834fb5d0b47bfdb</id>
119
+ <updated>2009-03-20T23:49:00.745Z</updated>
120
+ <app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-20T23:49:00.745Z</app:edited>
121
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/>
122
+ <title>No-email</title>
123
+ <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="http://www.google.com/m8/feeds/photos/media/eric%40example.com/5834fb5d0b47bfdb" gd:etag="&quot;eRJhPnolbCp7ImBjG0U0GBtuHmVAdnsJYzMz&quot;"/>
124
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/eric%40example.com/full/5834fb5d0b47bfdb"/>
125
+ <link rel="edit" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/eric%40example.com/full/5834fb5d0b47bfdb"/>
126
+ <gContact:groupMembershipInfo deleted="false" href="http://www.google.com/m8/feeds/groups/eric%40example.com/base/6"/>
127
+ </entry>
117
128
  </feed>
118
129
  ATOM
119
130
 
@@ -10,7 +10,7 @@ require 'nokogiri'
10
10
 
11
11
  class GmailContacts
12
12
 
13
- VERSION = '1.0'
13
+ VERSION = '1.0.1'
14
14
 
15
15
  Contact = Struct.new :title, :emails, :ims, :phone_numbers, :addresses
16
16
 
@@ -182,7 +182,9 @@ class GmailContacts
182
182
  xml.xpath('//xmlns:feed/xmlns:entry').each do |entry|
183
183
  title = entry.xpath('.//xmlns:title').first.text
184
184
  emails = []
185
- emails << entry.xpath('.//gd:email[@primary]').first['address']
185
+ primary = entry.xpath('.//gd:email[@primary]')
186
+ next unless primary.first
187
+ emails << primary.first['address']
186
188
  alternates = entry.xpath('.//gd:email[not(@primary)]')
187
189
 
188
190
  emails.push(*alternates.map { |e| e['address'] })
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmail_contacts
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -30,7 +30,7 @@ cert_chain:
30
30
  x52qPcexcYZR7w==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-04-08 00:00:00 -07:00
33
+ date: 2009-04-14 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file