google_contacts_api 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +15 -6
- data/VERSION +1 -1
- data/google_contacts_api.gemspec +3 -1
- data/lib/google_contacts_api/api.rb +3 -0
- data/spec/contact_set.json +1096 -0
- data/spec/google_contacts_api_spec.rb +192 -3
- data/spec/group_set.json +213 -0
- data/spec/spec_helper.rb +26 -2
- metadata +4 -2
data/README.markdown
CHANGED
@@ -12,10 +12,18 @@ GoogleContactsApi::User object for easier stuff.
|
|
12
12
|
google_contacts_user = GoogleContactsApi::User(oauth_access_token_for_user)
|
13
13
|
contacts = google_contacts_user.contacts
|
14
14
|
groups = google_contacts_user.groups
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
contacts
|
15
|
+
|
16
|
+
# group methods
|
17
|
+
group = groups[0]
|
18
|
+
group.contacts
|
19
|
+
|
20
|
+
# contact methods
|
21
|
+
contact = contacts[0]
|
22
|
+
contact.photo
|
23
|
+
contact.title
|
24
|
+
contact.id
|
25
|
+
contact.primary_email
|
26
|
+
contact.emails
|
19
27
|
```
|
20
28
|
|
21
29
|
In addition, Contacts and Groups are subclasses of [Hashie::Mash](https://github.com/intridea/hashie), so you can access any of the underlying data directly. Note that data is retrieved using Google's JSON API so the equivalent content of an XML element from the XML API is stored under the key "$t".
|
@@ -25,9 +33,10 @@ In addition, Contacts and Groups are subclasses of [Hashie::Mash](https://github
|
|
25
33
|
I welcome patches and pull requests, see the guidelines below (handily auto-generated
|
26
34
|
by jeweler).
|
27
35
|
|
28
|
-
*
|
36
|
+
* Any missing tests! (using RSpec, please)
|
29
37
|
* Read more contact information (structured name, address, phone, ...)
|
30
|
-
*
|
38
|
+
* Get single contacts and groups
|
39
|
+
* Posting/putting/deleting groups, contacts and their photos. This might require XML?
|
31
40
|
* Support ClientLogin
|
32
41
|
|
33
42
|
## Contributing to google_contacts_api
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/google_contacts_api.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{google_contacts_api}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alvin Liang"]
|
@@ -34,7 +34,9 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/google_contacts_api/result.rb",
|
35
35
|
"lib/google_contacts_api/result_set.rb",
|
36
36
|
"lib/google_contacts_api/user.rb",
|
37
|
+
"spec/contact_set.json",
|
37
38
|
"spec/google_contacts_api_spec.rb",
|
39
|
+
"spec/group_set.json",
|
38
40
|
"spec/spec_helper.rb"
|
39
41
|
]
|
40
42
|
s.homepage = %q{http://github.com/aliang/google_contacts_api}
|
@@ -23,6 +23,7 @@ module GoogleContactsApi
|
|
23
23
|
# Post request to specified link, with query params
|
24
24
|
# Not tried yet, might be issues with params
|
25
25
|
def post(link, params = {}, headers = {})
|
26
|
+
raise NotImplementedError
|
26
27
|
params["alt"] = "json"
|
27
28
|
@oauth.post("#{BASE_URL}#{link}?#{params.to_query}", headers)
|
28
29
|
end
|
@@ -30,6 +31,7 @@ module GoogleContactsApi
|
|
30
31
|
# Put request to specified link, with query params
|
31
32
|
# Not tried yet
|
32
33
|
def put(link, params = {}, headers = {})
|
34
|
+
raise NotImplementedError
|
33
35
|
params["alt"] = "json"
|
34
36
|
@oauth.put("#{BASE_URL}#{link}?#{params.to_query}", headers)
|
35
37
|
end
|
@@ -37,6 +39,7 @@ module GoogleContactsApi
|
|
37
39
|
# Delete request to specified link, with query params
|
38
40
|
# Not tried yet
|
39
41
|
def delete(link, params = {}, headers = {})
|
42
|
+
raise NotImplementedError
|
40
43
|
params["alt"] = "json"
|
41
44
|
@oauth.delete("#{BASE_URL}#{link}?#{params.to_query}", headers)
|
42
45
|
end
|