github_api_v3 0.2.2 → 0.3.0

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -2
  3. data/lib/github_api_v3/client/events.rb +3 -2
  4. data/lib/github_api_v3/client/feeds.rb +21 -0
  5. data/lib/github_api_v3/client/orgs.rb +40 -0
  6. data/lib/github_api_v3/client/repos.rb +101 -10
  7. data/lib/github_api_v3/client/users.rb +102 -1
  8. data/lib/github_api_v3/client.rb +16 -12
  9. data/lib/github_api_v3/default.rb +4 -1
  10. data/lib/github_api_v3/version.rb +1 -1
  11. data/spec/cassettes/GitHub_Client_Feeds/_feeds/returns_feed_information.json +1 -0
  12. data/spec/cassettes/GitHub_Client_Orgs/_organization/returns_an_organization.json +1 -0
  13. data/spec/cassettes/GitHub_Client_Repos/_star/stars_a_repository.json +1 -0
  14. data/spec/cassettes/GitHub_Client_Repos/_stargazers/returns_a_list_of_stargazers.json +1 -0
  15. data/spec/cassettes/GitHub_Client_Repos/_subscribe/subscribes_to_a_repository.json +1 -0
  16. data/spec/cassettes/GitHub_Client_Repos/_subscription/returns_subscription_information.json +1 -0
  17. data/spec/cassettes/GitHub_Client_Repos/_unstar/unstars_a_repository.json +1 -0
  18. data/spec/cassettes/GitHub_Client_Repos/_unsubscribe/unsubscribes_to_a_repository.json +1 -0
  19. data/spec/cassettes/GitHub_Client_Repos/_watchers/returns_a_list_of_watchers.json +1 -0
  20. data/spec/cassettes/GitHub_Client_Users/_notifications/returns_an_array_of_notifications.json +1 -0
  21. data/spec/cassettes/GitHub_Client_Users/_organizations/returns_an_authenticated_users_organizations.json +1 -0
  22. data/spec/cassettes/GitHub_Client_Users/_organizations/returns_an_unauthenticated_users_organizations.json +1 -0
  23. data/spec/cassettes/GitHub_Client_Users/_repo_notifications/returns_an_array_of_notifications.json +1 -0
  24. data/spec/cassettes/GitHub_Client_Users/_starring/returns_a_404_for_not_found.json +1 -0
  25. data/spec/cassettes/GitHub_Client_Users/_starring/returns_an_authenticated_users_repos.json +1 -0
  26. data/spec/cassettes/GitHub_Client_Users/_starring/returns_an_unauthenticated_users_repos.json +1 -0
  27. data/spec/cassettes/GitHub_Client_Users/_watching/returns_a_404_for_not_found.json +1 -0
  28. data/spec/cassettes/GitHub_Client_Users/_watching/returns_an_authenticated_users_repos.json +1 -0
  29. data/spec/cassettes/GitHub_Client_Users/_watching/returns_an_unauthenticated_users_repos.json +1 -0
  30. data/spec/github_api_v3/client/feeds_spec.rb +12 -0
  31. data/spec/github_api_v3/client/orgs_spec.rb +11 -0
  32. data/spec/github_api_v3/client/repos_spec.rb +43 -0
  33. data/spec/github_api_v3/client/users_spec.rb +50 -0
  34. metadata +47 -2
@@ -129,4 +129,54 @@ describe GitHub::Client::Users do
129
129
  end
130
130
  end
131
131
 
132
+ describe '.notifications', :vcr do
133
+ it 'returns an array of notifications' do
134
+ test_client.notifications.should be_instance_of Array
135
+ end
136
+ end
137
+
138
+ describe '.repo_notifications', :vcr do
139
+ it 'returns an array of notifications' do
140
+ test_client.repo_notifications('caseyscarborough','github').should be_instance_of Array
141
+ end
142
+ end
143
+
144
+ describe '.starring', :vcr do
145
+ it 'returns an unauthenticated users repos' do
146
+ GitHub.starring('caseyscarborough').should be_instance_of Array
147
+ end
148
+
149
+ it 'returns an authenticated users repos' do
150
+ test_client.starring.should be_instance_of Array
151
+ end
152
+
153
+ it 'returns a 404 for not found' do
154
+ expect { GitHub.starring('098f6bcd4621d373cade4e832627b4f6') }.to raise_error GitHub::NotFound
155
+ end
156
+ end
157
+
158
+ describe '.watching', :vcr do
159
+ it 'returns an unauthenticated users repos' do
160
+ GitHub.watching('caseyscarborough').should be_instance_of Array
161
+ end
162
+
163
+ it 'returns an authenticated users repos' do
164
+ test_client.watching.should be_instance_of Array
165
+ end
166
+
167
+ it 'returns a 404 for not found' do
168
+ expect { GitHub.watching('098f6bcd4621d373cade4e832627b4f6') }.to raise_error GitHub::NotFound
169
+ end
170
+ end
171
+
172
+ describe '.organizations', :vcr do
173
+ it 'returns an unauthenticated users organizations' do
174
+ GitHub.organizations('caseyscarborough').should be_instance_of Array
175
+ end
176
+
177
+ it 'returns an authenticated users organizations' do
178
+ test_client.organizations.should be_instance_of Array
179
+ end
180
+ end
181
+
132
182
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_api_v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Casey Scarborough
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-18 00:00:00.000000000 Z
11
+ date: 2013-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,9 +111,11 @@ files:
111
111
  - lib/github_api_v3.rb
112
112
  - lib/github_api_v3/client.rb
113
113
  - lib/github_api_v3/client/events.rb
114
+ - lib/github_api_v3/client/feeds.rb
114
115
  - lib/github_api_v3/client/gists.rb
115
116
  - lib/github_api_v3/client/gitignore.rb
116
117
  - lib/github_api_v3/client/markdown.rb
118
+ - lib/github_api_v3/client/orgs.rb
117
119
  - lib/github_api_v3/client/repos.rb
118
120
  - lib/github_api_v3/client/users.rb
119
121
  - lib/github_api_v3/default.rb
@@ -128,6 +130,7 @@ files:
128
130
  - spec/cassettes/GitHub_Client_Events/_repo_issue_events/returns_an_array_of_events.json
129
131
  - spec/cassettes/GitHub_Client_Events/_repo_network_events/returns_an_array_of_events.json
130
132
  - spec/cassettes/GitHub_Client_Events/_user_events/returns_an_array_of_events.json
133
+ - spec/cassettes/GitHub_Client_Feeds/_feeds/returns_feed_information.json
131
134
  - spec/cassettes/GitHub_Client_Gists/_create_gist/creates_a_gist.json
132
135
  - spec/cassettes/GitHub_Client_Gists/_create_gist_comment/creates_the_comment.json
133
136
  - spec/cassettes/GitHub_Client_Gists/_create_gist_comment/returns_comment_information_after_creation.json
@@ -158,6 +161,7 @@ files:
158
161
  - spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_the_correct_template.json
159
162
  - spec/cassettes/GitHub_Client_Gitignore/_gitignore_list/returns_an_array_of_templates.json
160
163
  - spec/cassettes/GitHub_Client_Markdown/_markdown/returns_rendered_markdown.json
164
+ - spec/cassettes/GitHub_Client_Orgs/_organization/returns_an_organization.json
161
165
  - spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/adds_a_collaborator.json
162
166
  - spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/removes_a_collaborator.json
163
167
  - spec/cassettes/GitHub_Client_Repos/_all_repos/returns_an_array_of_repositories.json
@@ -186,8 +190,15 @@ files:
186
190
  - spec/cassettes/GitHub_Client_Repos/_repo/returns_a_repo_as_a_hash.json
187
191
  - spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories.json
188
192
  - spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories_for_authenticated_user.json
193
+ - spec/cassettes/GitHub_Client_Repos/_star/stars_a_repository.json
194
+ - spec/cassettes/GitHub_Client_Repos/_stargazers/returns_a_list_of_stargazers.json
195
+ - spec/cassettes/GitHub_Client_Repos/_subscribe/subscribes_to_a_repository.json
196
+ - spec/cassettes/GitHub_Client_Repos/_subscription/returns_subscription_information.json
189
197
  - spec/cassettes/GitHub_Client_Repos/_tags/returns_a_404_if_repo_not_found.json
190
198
  - spec/cassettes/GitHub_Client_Repos/_tags/returns_an_array_of_tags.json
199
+ - spec/cassettes/GitHub_Client_Repos/_unstar/unstars_a_repository.json
200
+ - spec/cassettes/GitHub_Client_Repos/_unsubscribe/unsubscribes_to_a_repository.json
201
+ - spec/cassettes/GitHub_Client_Repos/_watchers/returns_a_list_of_watchers.json
191
202
  - spec/cassettes/GitHub_Client_Users/_create_key/returns_the_key_information.json
192
203
  - spec/cassettes/GitHub_Client_Users/_delete_key/returns_true_or_false.json
193
204
  - spec/cassettes/GitHub_Client_Users/_delete_key/should_delete_the_key.json
@@ -201,6 +212,13 @@ files:
201
212
  - spec/cassettes/GitHub_Client_Users/_follows_/returns_true_when_following.json
202
213
  - spec/cassettes/GitHub_Client_Users/_key/returns_a_key.json
203
214
  - spec/cassettes/GitHub_Client_Users/_key/returns_unauthorized_when_not_authorized.json
215
+ - spec/cassettes/GitHub_Client_Users/_notifications/returns_an_array_of_notifications.json
216
+ - spec/cassettes/GitHub_Client_Users/_organizations/returns_an_authenticated_users_organizations.json
217
+ - spec/cassettes/GitHub_Client_Users/_organizations/returns_an_unauthenticated_users_organizations.json
218
+ - spec/cassettes/GitHub_Client_Users/_repo_notifications/returns_an_array_of_notifications.json
219
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_a_404_for_not_found.json
220
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_an_authenticated_users_repos.json
221
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_an_unauthenticated_users_repos.json
204
222
  - spec/cassettes/GitHub_Client_Users/_unfollow/unfollows_a_user.json
205
223
  - spec/cassettes/GitHub_Client_Users/_update_key/returns_the_key_information.json
206
224
  - spec/cassettes/GitHub_Client_Users/_user/gets_the_correct_user_info.json
@@ -208,14 +226,19 @@ files:
208
226
  - spec/cassettes/GitHub_Client_Users/_user/returns_a_hash.json
209
227
  - spec/cassettes/GitHub_Client_Users/_users/returns_an_array.json
210
228
  - spec/cassettes/GitHub_Client_Users/_users/returns_an_array_of_hashes.json
229
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_a_404_for_not_found.json
230
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_an_authenticated_users_repos.json
231
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_an_unauthenticated_users_repos.json
211
232
  - spec/cassettes/GitHub_Client_Users/keys/returns_404_for_user_not_found.json
212
233
  - spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys.json
213
234
  - spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys_for_authenticated_user.json
214
235
  - spec/config.sample.yml
215
236
  - spec/github_api_v3/client/events_spec.rb
237
+ - spec/github_api_v3/client/feeds_spec.rb
216
238
  - spec/github_api_v3/client/gists_spec.rb
217
239
  - spec/github_api_v3/client/gitignore_spec.rb
218
240
  - spec/github_api_v3/client/markdown_spec.rb
241
+ - spec/github_api_v3/client/orgs_spec.rb
219
242
  - spec/github_api_v3/client/repos_spec.rb
220
243
  - spec/github_api_v3/client/users_spec.rb
221
244
  - spec/github_api_v3/client_spec.rb
@@ -254,6 +277,7 @@ test_files:
254
277
  - spec/cassettes/GitHub_Client_Events/_repo_issue_events/returns_an_array_of_events.json
255
278
  - spec/cassettes/GitHub_Client_Events/_repo_network_events/returns_an_array_of_events.json
256
279
  - spec/cassettes/GitHub_Client_Events/_user_events/returns_an_array_of_events.json
280
+ - spec/cassettes/GitHub_Client_Feeds/_feeds/returns_feed_information.json
257
281
  - spec/cassettes/GitHub_Client_Gists/_create_gist/creates_a_gist.json
258
282
  - spec/cassettes/GitHub_Client_Gists/_create_gist_comment/creates_the_comment.json
259
283
  - spec/cassettes/GitHub_Client_Gists/_create_gist_comment/returns_comment_information_after_creation.json
@@ -284,6 +308,7 @@ test_files:
284
308
  - spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_the_correct_template.json
285
309
  - spec/cassettes/GitHub_Client_Gitignore/_gitignore_list/returns_an_array_of_templates.json
286
310
  - spec/cassettes/GitHub_Client_Markdown/_markdown/returns_rendered_markdown.json
311
+ - spec/cassettes/GitHub_Client_Orgs/_organization/returns_an_organization.json
287
312
  - spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/adds_a_collaborator.json
288
313
  - spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/removes_a_collaborator.json
289
314
  - spec/cassettes/GitHub_Client_Repos/_all_repos/returns_an_array_of_repositories.json
@@ -312,8 +337,15 @@ test_files:
312
337
  - spec/cassettes/GitHub_Client_Repos/_repo/returns_a_repo_as_a_hash.json
313
338
  - spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories.json
314
339
  - spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories_for_authenticated_user.json
340
+ - spec/cassettes/GitHub_Client_Repos/_star/stars_a_repository.json
341
+ - spec/cassettes/GitHub_Client_Repos/_stargazers/returns_a_list_of_stargazers.json
342
+ - spec/cassettes/GitHub_Client_Repos/_subscribe/subscribes_to_a_repository.json
343
+ - spec/cassettes/GitHub_Client_Repos/_subscription/returns_subscription_information.json
315
344
  - spec/cassettes/GitHub_Client_Repos/_tags/returns_a_404_if_repo_not_found.json
316
345
  - spec/cassettes/GitHub_Client_Repos/_tags/returns_an_array_of_tags.json
346
+ - spec/cassettes/GitHub_Client_Repos/_unstar/unstars_a_repository.json
347
+ - spec/cassettes/GitHub_Client_Repos/_unsubscribe/unsubscribes_to_a_repository.json
348
+ - spec/cassettes/GitHub_Client_Repos/_watchers/returns_a_list_of_watchers.json
317
349
  - spec/cassettes/GitHub_Client_Users/_create_key/returns_the_key_information.json
318
350
  - spec/cassettes/GitHub_Client_Users/_delete_key/returns_true_or_false.json
319
351
  - spec/cassettes/GitHub_Client_Users/_delete_key/should_delete_the_key.json
@@ -327,6 +359,13 @@ test_files:
327
359
  - spec/cassettes/GitHub_Client_Users/_follows_/returns_true_when_following.json
328
360
  - spec/cassettes/GitHub_Client_Users/_key/returns_a_key.json
329
361
  - spec/cassettes/GitHub_Client_Users/_key/returns_unauthorized_when_not_authorized.json
362
+ - spec/cassettes/GitHub_Client_Users/_notifications/returns_an_array_of_notifications.json
363
+ - spec/cassettes/GitHub_Client_Users/_organizations/returns_an_authenticated_users_organizations.json
364
+ - spec/cassettes/GitHub_Client_Users/_organizations/returns_an_unauthenticated_users_organizations.json
365
+ - spec/cassettes/GitHub_Client_Users/_repo_notifications/returns_an_array_of_notifications.json
366
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_a_404_for_not_found.json
367
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_an_authenticated_users_repos.json
368
+ - spec/cassettes/GitHub_Client_Users/_starring/returns_an_unauthenticated_users_repos.json
330
369
  - spec/cassettes/GitHub_Client_Users/_unfollow/unfollows_a_user.json
331
370
  - spec/cassettes/GitHub_Client_Users/_update_key/returns_the_key_information.json
332
371
  - spec/cassettes/GitHub_Client_Users/_user/gets_the_correct_user_info.json
@@ -334,15 +373,21 @@ test_files:
334
373
  - spec/cassettes/GitHub_Client_Users/_user/returns_a_hash.json
335
374
  - spec/cassettes/GitHub_Client_Users/_users/returns_an_array.json
336
375
  - spec/cassettes/GitHub_Client_Users/_users/returns_an_array_of_hashes.json
376
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_a_404_for_not_found.json
377
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_an_authenticated_users_repos.json
378
+ - spec/cassettes/GitHub_Client_Users/_watching/returns_an_unauthenticated_users_repos.json
337
379
  - spec/cassettes/GitHub_Client_Users/keys/returns_404_for_user_not_found.json
338
380
  - spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys.json
339
381
  - spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys_for_authenticated_user.json
340
382
  - spec/config.sample.yml
341
383
  - spec/github_api_v3/client/events_spec.rb
384
+ - spec/github_api_v3/client/feeds_spec.rb
342
385
  - spec/github_api_v3/client/gists_spec.rb
343
386
  - spec/github_api_v3/client/gitignore_spec.rb
344
387
  - spec/github_api_v3/client/markdown_spec.rb
388
+ - spec/github_api_v3/client/orgs_spec.rb
345
389
  - spec/github_api_v3/client/repos_spec.rb
346
390
  - spec/github_api_v3/client/users_spec.rb
347
391
  - spec/github_api_v3/client_spec.rb
348
392
  - spec/spec_helper.rb
393
+ has_rdoc: