google_contacts_api 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -12,22 +12,30 @@ Right now upgrading should just work, barring any bugs in my implementation. In
12
12
 
13
13
  ## Usage
14
14
 
15
- 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.
15
+ You need to pass to the `GoogleContactsApi::User` constructor one of the following two objects:
16
+
17
+ * an OAuth::AccessToken from the [oauth-ruby](https://github.com/oauth/oauth-ruby) gem
18
+ * an OAuth2::AccessToken from the [oauth2](https://github.com/intridea/oauth2) gem
19
+
20
+ See their respective documentation for details on how to get this object. (I'm guessing there would be a few changes in implementation details of the GoogleContactsApi::Api class if you use another OAuth library, mostly to change how the base get/post/put/delete methods work.)
16
21
 
17
22
  Then you can instantiate a GoogleContactsApi::Api object for direct posting and parsing, or a
18
23
  GoogleContactsApi::User object for easier stuff.
19
24
 
20
25
  ```ruby
26
+ oauth_access_token_for_user
27
+ # => <OAuth2::AccessToken:0x000000029a69d36>
28
+
21
29
  google_contacts_user = GoogleContactsApi::User.new(oauth_access_token_for_user)
22
30
  contacts = google_contacts_user.contacts
23
31
  groups = google_contacts_user.groups
24
32
 
25
33
  # group methods
26
- group = groups[0]
34
+ group = groups.first
27
35
  group.contacts
28
36
 
29
37
  # contact methods
30
- contact = contacts[0]
38
+ contact = contacts.first
31
39
  contact.photo
32
40
  contact.title
33
41
  contact.id
@@ -63,6 +71,8 @@ by jeweler).
63
71
 
64
72
  ## Copyright
65
73
 
66
- Copyright (c) 2011-13 Alvin Liang. See LICENSE.txt for further details.
74
+ Copyright (c) 2011-14 Alvin Liang (aliang). See LICENSE.txt for further details.
75
+
76
+ Some code based on a few bugfixes in lfittl and fraudpointer forks.
67
77
 
68
- Some code based on a few bugfixes in lfittl and fraudpointer forks.
78
+ Support for Google Contacts API version 3 fields by draffensperger.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "google_contacts_api"
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
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"]
12
- s.date = "2014-08-21"
12
+ s.date = "2014-09-26"
13
13
  s.description = "Lets you read from the Google Contacts API. Posting to come later."
14
14
  s.email = "ayliang@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -18,8 +18,10 @@ module GoogleContactsApi
18
18
  @results = []
19
19
  end
20
20
 
21
- # Yields to block for each result
21
+ # Yields to block for each result.
22
+ # Returns an Enumerator if no block is passed.
22
23
  def each
24
+ return to_enum(:each) unless block_given?
23
25
  @results.each { |x| yield x }
24
26
  end
25
27
 
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.4.0
4
+ version: 0.4.1
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: 2014-08-21 00:00:00.000000000 Z
12
+ date: 2014-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -234,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  segments:
236
236
  - 0
237
- hash: -813692119890348937
237
+ hash: -2779317021500043099
238
238
  required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  none: false
240
240
  requirements: