omnicontacts 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/omnicontacts.rb +1 -1
- data/lib/omnicontacts/importer/gmail.rb +5 -3
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/omnicontacts.rb
CHANGED
@@ -36,15 +36,17 @@ module OmniContacts
|
|
36
36
|
|
37
37
|
def contacts_from_response response_as_json
|
38
38
|
response = JSON.parse(response_as_json)
|
39
|
+
return [] if response['feed'].nil? || response['feed']['entry'].nil?
|
39
40
|
contacts = []
|
40
41
|
response['feed']['entry'].each do |entry|
|
41
42
|
# creating nil fields to keep the fields consistent across other networks
|
42
43
|
contact = {:id => nil, :first_name => nil, :last_name => nil, :name => nil, :email => nil, :gender => nil, :birthday => nil, :profile_picture=> nil, :relation => nil}
|
43
44
|
contact[:id] = entry['id']['$t'] if entry['id']
|
44
45
|
if entry['gd$name']
|
45
|
-
|
46
|
-
contact[:
|
47
|
-
contact[:
|
46
|
+
gd_name = entry['gd$name']
|
47
|
+
contact[:first_name] = normalize_name(entry['gd$name']['gd$givenName']['$t']) if gd_name['gd$givenName']
|
48
|
+
contact[:last_name] = normalize_name(entry['gd$name']['gd$familyName']['$t']) if gd_name['gd$familyName']
|
49
|
+
contact[:name] = normalize_name(entry['gd$name']['gd$fullName']['$t']) if gd_name['gd$fullName']
|
48
50
|
contact[:name] = full_name(contact[:first_name],contact[:last_name]) if contact[:name].nil?
|
49
51
|
end
|
50
52
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnicontacts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|