google_contacts_api 0.3.0 → 0.3.1
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 +7 -5
- data/VERSION +1 -1
- data/google_contacts_api.gemspec +1 -1
- data/lib/google_contacts_api/user.rb +5 -1
- data/spec/google_contacts_api_spec.rb +2 -2
- metadata +2 -2
data/README.markdown
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# google_contacts_api
|
2
2
|
|
3
|
-
An unofficial Google Contacts API for ruby. Might not be stable (but probably is).
|
3
|
+
An unofficial Google Contacts API for ruby. Might not be stable (but probably is).
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
You need to provide an OAuth client, with access token, from an OAuth access library to this library. I've tested it with OAuth::AccessToken from the [oauth-ruby](https://github.com/oauth/oauth-ruby) gem. I'm guessing there would be a few small changes in implementation details of the GoogleContactsApi::Api class if you use another library, mostly to change how the base get/post/put/delete methods work.
|
7
|
+
You need to provide an OAuth client, with access token, from an OAuth access library to this library. I've tested it with OAuth::AccessToken from the [oauth-ruby](https://github.com/oauth/oauth-ruby) gem and an OAuth2::AccessToken from the [oauth2](https://github.com/intridea/oauth2) gem. I'm guessing there would be a few small changes in implementation details of the GoogleContactsApi::Api class if you use another library, mostly to change how the base get/post/put/delete methods work.
|
8
8
|
|
9
9
|
Then you can instantiate a GoogleContactsApi::Api object for direct posting and parsing, or a
|
10
10
|
GoogleContactsApi::User object for easier stuff.
|
@@ -37,10 +37,10 @@ I welcome patches and pull requests, see the guidelines below (handily auto-gene
|
|
37
37
|
by jeweler).
|
38
38
|
|
39
39
|
* Any missing tests! (using RSpec, please)
|
40
|
-
* Read more contact information (structured name, address,
|
40
|
+
* Read more contact information (structured name, address, ...)
|
41
41
|
* Get single contacts and groups
|
42
42
|
* Posting/putting/deleting groups, contacts and their photos. This might require XML?
|
43
|
-
*
|
43
|
+
* Adapter layer for different OAuth libraries? I'm not sure there are any other widely used libraries though
|
44
44
|
* Support ClientLogin (maybe not, since Google's old library covers it)
|
45
45
|
|
46
46
|
## Contributing to google_contacts_api
|
@@ -55,4 +55,6 @@ by jeweler).
|
|
55
55
|
|
56
56
|
## Copyright
|
57
57
|
|
58
|
-
Copyright (c) 2011 Alvin Liang. See LICENSE.txt for further details.
|
58
|
+
Copyright (c) 2011 Alvin Liang. See LICENSE.txt for further details.
|
59
|
+
|
60
|
+
Some code based on a few bugfixes in lfittl and fraudpointer forks.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/google_contacts_api.gemspec
CHANGED
@@ -16,11 +16,15 @@ module GoogleContactsApi
|
|
16
16
|
# alt, q, max-results, start-index, updated-min,
|
17
17
|
# orderby, showdeleted, requirealldeleted, sortorder
|
18
18
|
params["max-results"] = 100000 unless params.key?("max-results")
|
19
|
+
|
20
|
+
# Set the version, for some reason the header is not effective on its own?
|
21
|
+
params["v"] = 2
|
22
|
+
|
19
23
|
url = "groups/default/full"
|
20
24
|
# TODO: So weird thing, version 3 doesn't return system groups
|
21
25
|
# When it does, uncomment this line and use it to request instead
|
22
26
|
# response = @api.get(url, params)
|
23
|
-
response = @api.get(url, params
|
27
|
+
response = @api.get(url, params)
|
24
28
|
|
25
29
|
case GoogleContactsApi::Api.parse_response_code(response)
|
26
30
|
when 401; raise
|
@@ -67,8 +67,8 @@ describe "GoogleContactsApi" do
|
|
67
67
|
GoogleContactsApi::ContactSet.stub(:new).and_return("contact set")
|
68
68
|
end
|
69
69
|
# Should hit the right URLs and return the right stuff
|
70
|
-
it "should be able to get groups" do
|
71
|
-
@user.api.should_receive(:get).with("groups/default/full",
|
70
|
+
it "should be able to get groups including system groups" do
|
71
|
+
@user.api.should_receive(:get).with("groups/default/full", hash_including(v: 2))
|
72
72
|
@user.groups.should == "group set"
|
73
73
|
end
|
74
74
|
it "should be able to get contacts" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_contacts_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -217,7 +217,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
segments:
|
219
219
|
- 0
|
220
|
-
hash: -
|
220
|
+
hash: -3015739328210497821
|
221
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
222
|
none: false
|
223
223
|
requirements:
|