octokit 1.25.0 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (502) hide show
  1. data/Rakefile +10 -7
  2. data/lib/octokit.rb +22 -15
  3. data/lib/octokit/arguments.rb +14 -0
  4. data/lib/octokit/authentication.rb +48 -25
  5. data/lib/octokit/client.rb +245 -44
  6. data/lib/octokit/client/authorizations.rb +36 -10
  7. data/lib/octokit/client/commit_comments.rb +96 -0
  8. data/lib/octokit/client/commits.rb +152 -94
  9. data/lib/octokit/client/contents.rb +32 -24
  10. data/lib/octokit/client/downloads.rb +11 -7
  11. data/lib/octokit/client/emojis.rb +3 -1
  12. data/lib/octokit/client/events.rb +62 -18
  13. data/lib/octokit/client/gists.rb +27 -26
  14. data/lib/octokit/client/gitignore.rb +7 -3
  15. data/lib/octokit/client/issues.rb +43 -71
  16. data/lib/octokit/client/labels.rb +24 -20
  17. data/lib/octokit/client/legacy_search.rb +78 -0
  18. data/lib/octokit/client/markdown.rb +6 -1
  19. data/lib/octokit/client/meta.rb +21 -0
  20. data/lib/octokit/client/milestones.rb +13 -9
  21. data/lib/octokit/client/notifications.rb +24 -64
  22. data/lib/octokit/client/objects.rb +17 -12
  23. data/lib/octokit/client/organizations.rb +43 -52
  24. data/lib/octokit/client/pub_sub_hubbub.rb +68 -8
  25. data/lib/octokit/client/{pulls.rb → pull_requests.rb} +65 -41
  26. data/lib/octokit/client/rate_limit.rb +42 -8
  27. data/lib/octokit/client/refs.rb +16 -10
  28. data/lib/octokit/client/repositories.rb +73 -124
  29. data/lib/octokit/client/say.rb +7 -1
  30. data/lib/octokit/client/service_status.rb +39 -0
  31. data/lib/octokit/client/stats.rb +12 -6
  32. data/lib/octokit/client/statuses.rb +8 -29
  33. data/lib/octokit/client/users.rb +56 -75
  34. data/lib/octokit/configurable.rb +117 -0
  35. data/lib/octokit/default.rb +140 -0
  36. data/lib/octokit/error.rb +6 -5
  37. data/lib/octokit/gist.rb +11 -0
  38. data/lib/octokit/rate_limit.rb +22 -0
  39. data/lib/octokit/repo_arguments.rb +19 -0
  40. data/lib/octokit/repository.rb +11 -4
  41. data/lib/octokit/response/raise_error.rb +35 -0
  42. data/lib/octokit/version.rb +5 -1
  43. data/octokit.gemspec +4 -9
  44. data/spec/cassettes/Octokit_Client/_get/handles_query_params.json +1 -0
  45. data/spec/cassettes/Octokit_Client/_head/handles_query_params.json +1 -0
  46. data/spec/cassettes/Octokit_Client/_last_response/caches_the_last_agent_response.json +1 -0
  47. data/spec/cassettes/Octokit_Client/authentication/when_token_authenticated/fetches_and_memoizes_login.json +1 -0
  48. data/spec/cassettes/Octokit_Client/auto_pagination/fetches_all_the_pages.json +1 -0
  49. data/spec/cassettes/Octokit_Client/error_handling/raises_on_404.json +1 -0
  50. data/spec/cassettes/Octokit_Client_Authorizations/_authorization/returns_a_single_authorization.json +1 -0
  51. data/spec/cassettes/Octokit_Client_Authorizations/_authorizations/lists_existing_authorizations.json +1 -0
  52. data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_a_new_authorization_with_options.json +1 -0
  53. data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_an_API_authorization.json +1 -0
  54. data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_a_one-off_token.json +1 -0
  55. data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_the_current_token.json +1 -0
  56. data/spec/cassettes/Octokit_Client_Authorizations/_update_authorization/updates_and_existing_authorization.json +1 -0
  57. data/spec/cassettes/Octokit_Client_CommitComments/_commit_comment/returns_a_single_commit_comment.json +1 -0
  58. data/spec/cassettes/Octokit_Client_CommitComments/_commit_comments/returns_a_list_of_comments_for_a_specific_commit.json +1 -0
  59. data/spec/cassettes/Octokit_Client_CommitComments/_create_commit_comment/creates_a_commit_comment.json +1 -0
  60. data/spec/cassettes/Octokit_Client_CommitComments/_delete_commit_comment/deletes_a_commit_comment.json +1 -0
  61. data/spec/cassettes/Octokit_Client_CommitComments/_list_commit_comments/returns_a_list_of_all_commit_comments.json +1 -0
  62. data/spec/cassettes/Octokit_Client_CommitComments/_update_commit_comment/updates_a_commit_comment.json +1 -0
  63. data/spec/cassettes/Octokit_Client_Commits/_commit/returns_a_commit.json +1 -0
  64. data/spec/cassettes/Octokit_Client_Commits/_commits/handles_branch_or_sha_argument.json +1 -0
  65. data/spec/cassettes/Octokit_Client_Commits/_commits/handles_the_sha_option.json +1 -0
  66. data/spec/cassettes/Octokit_Client_Commits/_commits/returns_all_commits.json +1 -0
  67. data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_branch_or_sha_argument.json +1 -0
  68. data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_the_sha_option.json +1 -0
  69. data/spec/cassettes/Octokit_Client_Commits/_commits_before/returns_all_commits_until_the_specified_date.json +1 -0
  70. data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_branch_or_sha_argument.json +1 -0
  71. data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_the_sha_option.json +1 -0
  72. data/spec/cassettes/Octokit_Client_Commits/_commits_between/returns_all_commits_until_the_specified_date.json +1 -0
  73. data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_branch_or_sha_argument.json +1 -0
  74. data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_the_sha_option.json +1 -0
  75. data/spec/cassettes/Octokit_Client_Commits/_commits_on/returns_all_commits_on_the_specified_date.json +1 -0
  76. data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_branch_or_sha_argument.json +1 -0
  77. data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_the_sha_option.json +1 -0
  78. data/spec/cassettes/Octokit_Client_Commits/_commits_since/returns_all_commits_since_the_specified_date.json +1 -0
  79. data/spec/cassettes/Octokit_Client_Commits/_compare/returns_a_comparison.json +1 -0
  80. data/spec/cassettes/Octokit_Client_Commits/_create_commit/creates_a_commit.json +1 -0
  81. data/spec/cassettes/Octokit_Client_Commits/_merge/merges_a_branch_into_another.json +1 -0
  82. data/spec/cassettes/Octokit_Client_Contents/_archive_link/returns_the_headers_of_the_request.json +1 -0
  83. data/spec/cassettes/Octokit_Client_Contents/_contents/returns_the_contents_of_a_file.json +1 -0
  84. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_File_object.json +1 -0
  85. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_file_path.json +1 -0
  86. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_repository_contents_at_a_path.json +1 -0
  87. data/spec/cassettes/Octokit_Client_Contents/_delete_contents/deletes_repository_contents_at_a_path.json +1 -0
  88. data/spec/cassettes/Octokit_Client_Contents/_readme/returns_the_default_readme.json +1 -0
  89. data/spec/cassettes/Octokit_Client_Contents/_update_contents/updates_repository_contents_at_a_path.json +1 -0
  90. data/spec/cassettes/Octokit_Client_Downloads/_download/gets_a_single_download.json +1 -0
  91. data/spec/cassettes/Octokit_Client_Downloads/_downloads/lists_available_downloads.json +1 -0
  92. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/creates_a_download_resource.json +1 -0
  93. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/posts_to_an_S3_url.json +1 -0
  94. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_delete_download/deletes_a_download.json +1 -0
  95. data/spec/cassettes/Octokit_Client_Emojis/_emojis/returns_all_github_emojis.json +1 -0
  96. data/spec/cassettes/Octokit_Client_Events/_issue_event/lists_issue_events_for_a_repository.json +1 -0
  97. data/spec/cassettes/Octokit_Client_Events/_issue_events/lists_issue_events_for_a_repository.json +1 -0
  98. data/spec/cassettes/Octokit_Client_Events/_organization_events/returns_all_events_for_an_organization.json +1 -0
  99. data/spec/cassettes/Octokit_Client_Events/_organization_public_events/returns_an_organization_s_public_events.json +1 -0
  100. data/spec/cassettes/Octokit_Client_Events/_public_events/returns_all_public_events.json +1 -0
  101. data/spec/cassettes/Octokit_Client_Events/_received_events/returns_all_user_received_events.json +1 -0
  102. data/spec/cassettes/Octokit_Client_Events/_received_public_events/returns_public_user_received_events.json +1 -0
  103. data/spec/cassettes/Octokit_Client_Events/_repo_issue_events/lists_issue_events_for_a_repository.json +1 -0
  104. data/spec/cassettes/Octokit_Client_Events/_repository_events/returns_events_for_a_repository.json +1 -0
  105. data/spec/cassettes/Octokit_Client_Events/_repository_network_events/returns_events_for_a_repository_s_network.json +1 -0
  106. data/spec/cassettes/Octokit_Client_Events/_user_events/returns_all_user_events.json +1 -0
  107. data/spec/cassettes/Octokit_Client_Events/_user_public_events/returns_public_events_performed_by_a_user.json +1 -0
  108. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gist/returns_the_gist_by_ID.json +1 -0
  109. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/with_username_passed/returns_a_list_of_gists.json +1 -0
  110. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/without_a_username_passed/returns_a_list_of_gists.json +1 -0
  111. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_public_gists/returns_public_gists.json +1 -0
  112. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist/creates_a_new_gist.json +1 -0
  113. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist_comment/creates_a_gist_comment.json +1 -0
  114. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist/deletes_an_existing_gist.json +1 -0
  115. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist_comment/deletes_a_gist_comment.json +1 -0
  116. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_edit_gist/edit_an_existing_gist.json +1 -0
  117. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_fork_gist/forks_an_existing_gist.json +1 -0
  118. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comment/returns_a_gist_comment.json +1 -0
  119. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comments/returns_the_list_of_gist_comments.json +1 -0
  120. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_not_starred.json +1 -0
  121. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_starred.json +1 -0
  122. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gists/returns_a_list_of_gists.json +1 -0
  123. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_star_gist/stars_an_existing_gist.json +1 -0
  124. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_starred_gists/returns_the_user_s_starred_gists.json +1 -0
  125. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_unstar_gist/unstars_an_existing_gist.json +1 -0
  126. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_update_gist_comment/updates_a_gist_comment.json +1 -0
  127. data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_template/returns_the_ruby_gitignore_template.json +1 -0
  128. data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_templates/returns_all_gitignore_templates.json +1 -0
  129. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue.json +1 -0
  130. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_delimited_labels.json +1 -0
  131. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_labels_array.json +1 -0
  132. data/spec/cassettes/Octokit_Client_Issues/_issue_comment/returns_a_single_comment_for_an_issue.json +1 -0
  133. data/spec/cassettes/Octokit_Client_Issues/_issue_comments/returns_comments_for_an_issue.json +1 -0
  134. data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_dashboard_issues_for_the_authenticated_user.json +1 -0
  135. data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_issues_for_a_repository.json +1 -0
  136. data/spec/cassettes/Octokit_Client_Issues/_org_issues/returns_issues_for_the_organization_for_the_authenticated_user.json +1 -0
  137. data/spec/cassettes/Octokit_Client_Issues/_repository_issues_comments/returns_comments_for_all_issues_in_a_repository.json +1 -0
  138. data/spec/cassettes/Octokit_Client_Issues/_user_issues/returns_issues_for_the_authenticated_user_for_owned_and_member_repos.json +1 -0
  139. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_add_comment/adds_a_comment.json +1 -0
  140. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_close_issue/closes_an_issue.json +1 -0
  141. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_a_full_issue.json +1 -0
  142. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_an_issue.json +1 -0
  143. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_reopen_issue/reopens_an_issue.json +1 -0
  144. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_update_issue/updates_an_issue.json +1 -0
  145. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_delete_comment/deletes_an_existing_comment.json +1 -0
  146. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_update_comment/updates_an_existing_comment.json +1 -0
  147. data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_a_color.json +1 -0
  148. data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_default_color.json +1 -0
  149. data/spec/cassettes/Octokit_Client_Labels/_delete_label_/deletes_a_label_from_the_repository.json +1 -0
  150. data/spec/cassettes/Octokit_Client_Labels/_label/returns_a_single_label.json +1 -0
  151. data/spec/cassettes/Octokit_Client_Labels/_labels/returns_labels.json +1 -0
  152. data/spec/cassettes/Octokit_Client_Labels/_lables_for_milestone/returns_all_labels_for_a_repository.json +1 -0
  153. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_add_labels_to_an_issue/adds_labels_to_a_given_issue.json +1 -0
  154. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_labels_for_issue/returns_all_labels_for_a_given_issue.json +1 -0
  155. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_all_labels/removes_all_labels_from_the_specified_issue.json +1 -0
  156. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_label/removes_a_label_from_the_specified_issue.json +1 -0
  157. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_replace_all_labels/replaces_all_labels_for_an_issue.json +1 -0
  158. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_label/_update_label/updates_a_label_with_a_new_color.json +1 -0
  159. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_issues/returns_matching_issues.json +1 -0
  160. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_repos/returns_matching_repositories.json +1 -0
  161. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_users/returns_matching_username.json +1 -0
  162. data/spec/cassettes/Octokit_Client_Markdown/_markdown/renders_markdown.json +1 -0
  163. data/spec/cassettes/Octokit_Client_Meta/_github_meta/returns_meta_information_about_github.json +1 -0
  164. data/spec/cassettes/Octokit_Client_Milestones/_list_milestones/lists_milestones_belonging_to_repository.json +1 -0
  165. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_create_milestone/creates_a_milestone.json +1 -0
  166. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_delete_milestone/deletes_a_milestone_from_a_repository.json +1 -0
  167. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_milestone/gets_a_single_milestone_belonging_to_repository.json +1 -0
  168. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_update_milestone/updates_a_milestone.json +1 -0
  169. data/spec/cassettes/Octokit_Client_Notifications/_mark_notifications_as_read/returns_true_when_notifications_are_marked_as_read.json +1 -0
  170. data/spec/cassettes/Octokit_Client_Notifications/_mark_repository_notifications_as_read/returns_true_when_notifications_for_a_repo_are_marked_as_read.json +1 -0
  171. data/spec/cassettes/Octokit_Client_Notifications/_notifications/lists_the_notifications_for_the_current_user.json +1 -0
  172. data/spec/cassettes/Octokit_Client_Notifications/_repository_notifications/lists_all_notifications_for_a_repository.json +1 -0
  173. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_delete_thread_subscription/returns_true_with_successful_thread_deletion.json +1 -0
  174. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_mark_thread_as_read/marks_a_thread_as_read.json +1 -0
  175. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_notifications/returns_notifications_for_a_specific_thread.json +1 -0
  176. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_subscription/returns_a_thread_subscription.json +1 -0
  177. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_update_thread_subscription/updates_a_thread_subscription.json +1 -0
  178. data/spec/cassettes/Octokit_Client_Objects/_blob/returns_a_blob.json +1 -0
  179. data/spec/cassettes/Octokit_Client_Objects/_create_blob/creates_a_blob.json +1 -0
  180. data/spec/cassettes/Octokit_Client_Objects/_create_tag/creates_a_tag.json +1 -0
  181. data/spec/cassettes/Octokit_Client_Objects/_create_tree/creates_a_tree.json +1 -0
  182. data/spec/cassettes/Octokit_Client_Objects/_tag/returns_a_tag.json +1 -0
  183. data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree.json +1 -0
  184. data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree_recursively.json +1 -0
  185. data/spec/cassettes/Octokit_Client_Organizations/_organization/returns_an_organization.json +1 -0
  186. data/spec/cassettes/Octokit_Client_Organizations/_organization_member_/checks_organization_membership.json +1 -0
  187. data/spec/cassettes/Octokit_Client_Organizations/_organization_members/returns_all_public_members_of_an_organization.json +1 -0
  188. data/spec/cassettes/Octokit_Client_Organizations/_organization_public_member_/checks_publicized_org_membership.json +1 -0
  189. data/spec/cassettes/Octokit_Client_Organizations/_organization_repositories/returns_all_public_repositories_for_an_organization.json +1 -0
  190. data/spec/cassettes/Octokit_Client_Organizations/_organization_teams/returns_all_teams_for_an_organization.json +1 -0
  191. data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_a_user.json +1 -0
  192. data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_the_authenticated_user.json +1 -0
  193. data/spec/cassettes/Octokit_Client_Organizations/_update_organization/updates_an_organization.json +1 -0
  194. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_member/adds_a_team_member.json +1 -0
  195. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_repository/adds_a_team_repository.json +1 -0
  196. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_create_team/creates_a_team.json +1 -0
  197. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_delete_team/deletes_a_team.json +1 -0
  198. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_publicize_membership/publicizes_membership.json +1 -0
  199. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_member/removes_a_team_member.json +1 -0
  200. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_repository/removes_a_team_repository.json +1 -0
  201. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team/returns_a_team.json +1 -0
  202. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_member_/checks_if_a_user_is_member_of_a_team.json +1 -0
  203. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_members/returns_team_members.json +1 -0
  204. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_repositories/returns_team_repositories.json +1 -0
  205. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_unpublicize_membership/unpublicizes_membership.json +1 -0
  206. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_update_team/updates_a_team.json +1 -0
  207. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/raises_an_error_when_topic_is_not_recognized.json +1 -0
  208. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/subscribes_to_pull_events.json +1 -0
  209. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe_service_hook/subscribes_to_pull_events_on_specified_topic.json +1 -0
  210. data/spec/cassettes/Octokit_Client_PubSubHubbub/_unsubscribe/unsubscribes_from_pull_events.json +1 -0
  211. data/spec/cassettes/Octokit_Client_PubSubHubbub/unsubscribe_service_hook/unsubscribes_to_stop_receiving_events_on_specified_topic.json +1 -0
  212. data/spec/cassettes/Octokit_Client_PullRequests/_create_pull_request_for_issue/creates_a_pull_request_and_attach_it_to_an_existing_issue.json +1 -0
  213. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comment/returns_a_comment_on_a_pull_request.json +1 -0
  214. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comments/returns_the_comments_for_a_pull_request.json +1 -0
  215. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_commits/returns_the_commits_for_a_pull_request.json +1 -0
  216. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_files/lists_files_for_a_pull_request.json +1 -0
  217. data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests/returns_all_pull_requests.json +1 -0
  218. data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests_comments/returns_all_comments_on_all_pull_requests.json +1 -0
  219. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_close_pull_request/closes_a_pull_request.json +1 -0
  220. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_create_pull_request/creates_a_pull_request.json +1 -0
  221. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_merge_pull_request/merges_the_pull_request.json +1 -0
  222. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_merged_/returns_whether_the_pull_request_has_been_merged.json +1 -0
  223. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_request/returns_a_pull_request.json +1 -0
  224. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json +1 -0
  225. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment/creates_a_new_comment_on_a_pull_request.json +1 -0
  226. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment_reply/creates_a_new_reply_to_a_pull_request_comment.json +1 -0
  227. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_delete_pull_request_comment/deletes_a_pull_request_comment.json +1 -0
  228. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_update_pull_request_comment/updates_a_pull_request_comment.json +1 -0
  229. data/spec/cassettes/Octokit_Client_Refs/_ref/returns_a_tags_ref.json +1 -0
  230. data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_refs.json +1 -0
  231. data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_tag_refs.json +1 -0
  232. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_create_ref/creates_a_ref.json +1 -0
  233. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_delete_ref/deletes_an_existing_ref.json +1 -0
  234. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_update_ref/updates_a_ref.json +1 -0
  235. data/spec/cassettes/Octokit_Client_Repositories/_all_repositories/returns_all_repositories_on_github.json +1 -0
  236. data/spec/cassettes/Octokit_Client_Repositories/_assignees/lists_all_the_available_assignees_owner_collaborators_.json +1 -0
  237. data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_repository_s_branches.json +1 -0
  238. data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_single_branch.json +1 -0
  239. data/spec/cassettes/Octokit_Client_Repositories/_check_assignee/checks_to_see_if_a_particular_user_is_an_assignee_for_a_repository.json +1 -0
  240. data/spec/cassettes/Octokit_Client_Repositories/_collaborators/returns_a_repository_s_collaborators.json +1 -0
  241. data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors.json +1 -0
  242. data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors_excluding_anonymous.json +1 -0
  243. data/spec/cassettes/Octokit_Client_Repositories/_create_repository/creates_a_repository_for_an_organization.json +1 -0
  244. data/spec/cassettes/Octokit_Client_Repositories/_delete_subscription/returns_true_when_repo_subscription_deleted.json +1 -0
  245. data/spec/cassettes/Octokit_Client_Repositories/_fork/forks_a_repository.json +1 -0
  246. data/spec/cassettes/Octokit_Client_Repositories/_languages/returns_a_repository_s_languages.json +1 -0
  247. data/spec/cassettes/Octokit_Client_Repositories/_network/returns_a_repository_s_network.json +1 -0
  248. data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_a_user_s_repositories.json +1 -0
  249. data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_authenticated_user_s_repositories.json +1 -0
  250. data/spec/cassettes/Octokit_Client_Repositories/_repository/returns_the_matching_repository.json +1 -0
  251. data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_false_if_the_repository_doesn_t_exist.json +1 -0
  252. data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_true_if_the_repository_exists.json +1 -0
  253. data/spec/cassettes/Octokit_Client_Repositories/_star/stars_a_repository.json +1 -0
  254. data/spec/cassettes/Octokit_Client_Repositories/_stargazers/returns_all_repository_stargazers.json +1 -0
  255. data/spec/cassettes/Octokit_Client_Repositories/_subscribers/lists_all_the_users_watching_the_repository.json +1 -0
  256. data/spec/cassettes/Octokit_Client_Repositories/_subscription/returns_a_repository_subscription.json +1 -0
  257. data/spec/cassettes/Octokit_Client_Repositories/_tags/returns_a_repository_s_tags.json +1 -0
  258. data/spec/cassettes/Octokit_Client_Repositories/_unstar/unstars_a_repository.json +1 -0
  259. data/spec/cassettes/Octokit_Client_Repositories/_unwatch/unwatches_a_repository.json +1 -0
  260. data/spec/cassettes/Octokit_Client_Repositories/_update_subscription/updates_a_repository_subscription.json +1 -0
  261. data/spec/cassettes/Octokit_Client_Repositories/_watch/watches_a_repository.json +1 -0
  262. data/spec/cassettes/Octokit_Client_Repositories/_watchers/returns_all_repository_watchers.json +1 -0
  263. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_add_collaborator/adds_a_repository_collaborators.json +1 -0
  264. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_create_repository/creates_a_repository.json +1 -0
  265. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_delete_repository/deletes_a_repository.json +1 -0
  266. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_deploy_keys/returns_a_repository_s_deploy_keys.json +1 -0
  267. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_hooks/returns_a_repository_s_hooks.json +1 -0
  268. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_remove_collaborator/removes_a_repository_collaborators.json +1 -0
  269. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_repository_teams/returns_all_repository_teams.json +1 -0
  270. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_update_repository/updates_the_matching_repository.json +1 -0
  271. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_requiring_an_existing_deploy_key/_add_deploy_key/adds_a_repository_deploy_keys.json +1 -0
  272. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_create_hook/creates_a_hook.json +1 -0
  273. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_edit_hook/edits_a_hook.json +1 -0
  274. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_hook/returns_a_repository_s_single_hook.json +1 -0
  275. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_remove_hook/removes_a_hook.json +1 -0
  276. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_test_hook/tests_a_hook.json +1 -0
  277. data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat.json +1 -0
  278. data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat_with_custom_text.json +1 -0
  279. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +1 -0
  280. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +1 -0
  281. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +1 -0
  282. data/spec/cassettes/Octokit_Client_Stats/_code_frequency_stats/returns_the_code_frequency_stats.json +1 -0
  283. data/spec/cassettes/Octokit_Client_Stats/_commit_activity_stats/returns_the_commit_activity_stats.json +1 -0
  284. data/spec/cassettes/Octokit_Client_Stats/_contributors_stats/returns_contributors_and_their_contribution_stats.json +1 -0
  285. data/spec/cassettes/Octokit_Client_Stats/_participation_stats/returns_the_owner_and_contributor_participation_stats.json +1 -0
  286. data/spec/cassettes/Octokit_Client_Stats/_punch_card_stats/returns_commit_count_by_hour_punch_card_stats.json +1 -0
  287. data/spec/cassettes/Octokit_Client_Statuses/_create_status/creates_status.json +1 -0
  288. data/spec/cassettes/Octokit_Client_Statuses/_statuses/lists_commit_statuses.json +1 -0
  289. data/spec/cassettes/Octokit_Client_Users/_add_email/adds_an_email_address.json +1 -0
  290. data/spec/cassettes/Octokit_Client_Users/_all_users/returns_all_GitHub_users.json +1 -0
  291. data/spec/cassettes/Octokit_Client_Users/_emails/returns_email_addresses.json +1 -0
  292. data/spec/cassettes/Octokit_Client_Users/_follow/follows_a_user.json +1 -0
  293. data/spec/cassettes/Octokit_Client_Users/_followers/returns_followers_for_a_user.json +1 -0
  294. data/spec/cassettes/Octokit_Client_Users/_followers/returns_the_authenticated_user_s_followers.json +1 -0
  295. data/spec/cassettes/Octokit_Client_Users/_following/returns_following_for_a_user.json +1 -0
  296. data/spec/cassettes/Octokit_Client_Users/_following/returns_the_authenticated_user_s_following.json +1 -0
  297. data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_the_authenticated_user_follows_another.json +1 -0
  298. data/spec/cassettes/Octokit_Client_Users/_keys/returns_public_keys_for_the_authenticated_user.json +1 -0
  299. data/spec/cassettes/Octokit_Client_Users/_remove_email/removes_an_email_address.json +1 -0
  300. data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_a_user.json +1 -0
  301. data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_the_authenticated_user.json +1 -0
  302. data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository.json +1 -0
  303. data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_a_user_watches_for_notifications.json +1 -0
  304. data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_the_authenticated_user_watches_for_notifications.json +1 -0
  305. data/spec/cassettes/Octokit_Client_Users/_unfollow/unfollows_a_user.json +1 -0
  306. data/spec/cassettes/Octokit_Client_Users/_update_user/updates_a_user_profile.json +1 -0
  307. data/spec/cassettes/Octokit_Client_Users/_user/returns_a_user.json +1 -0
  308. data/spec/cassettes/Octokit_Client_Users/_user/returns_the_authenticated_user.json +1 -0
  309. data/spec/cassettes/Octokit_Client_Users/_user_keys/returns_public_keys_for_another_user.json +1 -0
  310. data/spec/cassettes/Octokit_Client_Users/_validate_credentials/validates_username_and_password.json +1 -0
  311. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_add_key/adds_a_public_key.json +1 -0
  312. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_key/returns_a_public_key.json +1 -0
  313. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_remove_key/removes_a_public_key.json +1 -0
  314. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_update_key/updates_a_public_key.json +1 -0
  315. data/spec/cassettes/delete_authorization.json +1 -0
  316. data/spec/cassettes/rate_limit.json +1 -0
  317. data/spec/cassettes/root.json +1 -0
  318. data/spec/fixtures/user.json +29 -18
  319. data/spec/fixtures/{user_token.json → web_flow_token.json} +0 -0
  320. data/spec/helper.rb +49 -22
  321. data/spec/octokit/client/authorizations_spec.rb +69 -80
  322. data/spec/octokit/client/commit_comments_spec.rb +62 -0
  323. data/spec/octokit/client/commits_spec.rb +93 -226
  324. data/spec/octokit/client/contents_spec.rb +64 -119
  325. data/spec/octokit/client/downloads_spec.rb +34 -38
  326. data/spec/octokit/client/emojis_spec.rb +5 -11
  327. data/spec/octokit/client/events_spec.rb +67 -51
  328. data/spec/octokit/client/gists_spec.rb +148 -142
  329. data/spec/octokit/client/gitignore_spec.rb +11 -14
  330. data/spec/octokit/client/issues_spec.rb +129 -161
  331. data/spec/octokit/client/labels_spec.rb +81 -114
  332. data/spec/octokit/client/legacy_search_spec.rb +42 -0
  333. data/spec/octokit/client/markdown_spec.rb +9 -12
  334. data/spec/octokit/client/meta_spec.rb +14 -0
  335. data/spec/octokit/client/milestones_spec.rb +40 -48
  336. data/spec/octokit/client/notifications_spec.rb +57 -113
  337. data/spec/octokit/client/objects_spec.rb +36 -74
  338. data/spec/octokit/client/organizations_spec.rb +140 -262
  339. data/spec/octokit/client/pub_sub_hubbub_spec.rb +58 -49
  340. data/spec/octokit/client/pull_requests_spec.rb +186 -0
  341. data/spec/octokit/client/rate_limit_spec.rb +40 -0
  342. data/spec/octokit/client/refs_spec.rb +47 -56
  343. data/spec/octokit/client/repositories_spec.rb +301 -438
  344. data/spec/octokit/client/say_spec.rb +8 -22
  345. data/spec/octokit/client/service_status_spec.rb +37 -0
  346. data/spec/octokit/client/stats_spec.rb +82 -32
  347. data/spec/octokit/client/statuses_spec.rb +11 -51
  348. data/spec/octokit/client/users_spec.rb +144 -348
  349. data/spec/octokit/client_spec.rb +345 -195
  350. data/spec/octokit/rate_limit_spec.rb +25 -0
  351. data/spec/octokit_spec.rb +31 -15
  352. metadata +585 -387
  353. data/lib/faraday/response/raise_octokit_error.rb +0 -25
  354. data/lib/octokit/client/github.rb +0 -19
  355. data/lib/octokit/client/pub_sub_hubbub/service_hooks.rb +0 -37
  356. data/lib/octokit/configuration.rb +0 -77
  357. data/lib/octokit/connection.rb +0 -53
  358. data/lib/octokit/request.rb +0 -110
  359. data/spec/faraday/response_spec.rb +0 -63
  360. data/spec/fixtures/all_repositories.json +0 -122
  361. data/spec/fixtures/all_users.json +0 -34
  362. data/spec/fixtures/authorization.json +0 -16
  363. data/spec/fixtures/authorizations.json +0 -66
  364. data/spec/fixtures/blob.json +0 -7
  365. data/spec/fixtures/blob_create.json +0 -3
  366. data/spec/fixtures/branches.json +0 -16
  367. data/spec/fixtures/code_frequency_stats.json +0 -897
  368. data/spec/fixtures/collaborators.json +0 -62
  369. data/spec/fixtures/comment.json +0 -14
  370. data/spec/fixtures/comments.json +0 -44
  371. data/spec/fixtures/commit.json +0 -50
  372. data/spec/fixtures/commit_activity_stats.json +0 -678
  373. data/spec/fixtures/commit_comment.json +0 -19
  374. data/spec/fixtures/commit_comment_create.json +0 -19
  375. data/spec/fixtures/commit_comment_update.json +0 -19
  376. data/spec/fixtures/commit_comments.json +0 -78
  377. data/spec/fixtures/commit_create.json +0 -25
  378. data/spec/fixtures/commits.json +0 -1414
  379. data/spec/fixtures/compare.json +0 -98
  380. data/spec/fixtures/contents.json +0 -14
  381. data/spec/fixtures/contributor_stats.json +0 -2196
  382. data/spec/fixtures/contributors.json +0 -891
  383. data/spec/fixtures/create_content.json +0 -44
  384. data/spec/fixtures/delete_content.json +0 -30
  385. data/spec/fixtures/download.json +0 -11
  386. data/spec/fixtures/download_create.json +0 -21
  387. data/spec/fixtures/downloads.json +0 -35
  388. data/spec/fixtures/emails.json +0 -4
  389. data/spec/fixtures/emojis.json +0 -500
  390. data/spec/fixtures/followers.json +0 -212
  391. data/spec/fixtures/following.json +0 -209
  392. data/spec/fixtures/forks.json +0 -872
  393. data/spec/fixtures/gist.json +0 -51
  394. data/spec/fixtures/gist_comment.json +0 -19
  395. data/spec/fixtures/gist_comment_create.json +0 -19
  396. data/spec/fixtures/gist_comment_update.json +0 -19
  397. data/spec/fixtures/gist_comments.json +0 -40
  398. data/spec/fixtures/gists.json +0 -548
  399. data/spec/fixtures/github_meta.json +0 -9
  400. data/spec/fixtures/github_status.json +0 -4
  401. data/spec/fixtures/github_status_last_message.json +0 -5
  402. data/spec/fixtures/github_status_messages.json +0 -12
  403. data/spec/fixtures/gitignore_template_ruby.json +0 -4
  404. data/spec/fixtures/gitignore_templates.json +0 -78
  405. data/spec/fixtures/hook.json +0 -18
  406. data/spec/fixtures/hooks.json +0 -70
  407. data/spec/fixtures/issue.json +0 -35
  408. data/spec/fixtures/issue_closed.json +0 -35
  409. data/spec/fixtures/issue_event.json +0 -42
  410. data/spec/fixtures/issue_events.json +0 -72
  411. data/spec/fixtures/issue_full.json +0 -38
  412. data/spec/fixtures/issues.json +0 -1562
  413. data/spec/fixtures/label.json +0 -5
  414. data/spec/fixtures/labels.json +0 -17
  415. data/spec/fixtures/languages.json +0 -5
  416. data/spec/fixtures/legacy/issues.json +0 -49
  417. data/spec/fixtures/legacy/repositories.json +0 -173
  418. data/spec/fixtures/legacy/users.json +0 -24
  419. data/spec/fixtures/list_commit_comments.json +0 -572
  420. data/spec/fixtures/markdown_gfm +0 -1
  421. data/spec/fixtures/merge.json +0 -47
  422. data/spec/fixtures/milestone.json +0 -11
  423. data/spec/fixtures/milestones.json +0 -28
  424. data/spec/fixtures/not_found.json +0 -3
  425. data/spec/fixtures/notification_thread.json +0 -32
  426. data/spec/fixtures/notifications.json +0 -32
  427. data/spec/fixtures/org_issues.json +0 -710
  428. data/spec/fixtures/organization-repositories.json +0 -4292
  429. data/spec/fixtures/organization-repository.json +0 -42
  430. data/spec/fixtures/organization.json +0 -18
  431. data/spec/fixtures/organization_events.json +0 -61
  432. data/spec/fixtures/organization_members.json +0 -576
  433. data/spec/fixtures/organization_public_events.json +0 -61
  434. data/spec/fixtures/organization_team_members.json +0 -16
  435. data/spec/fixtures/organization_team_repos.json +0 -62
  436. data/spec/fixtures/organizations.json +0 -44
  437. data/spec/fixtures/participation_stats.json +0 -110
  438. data/spec/fixtures/public_events.json +0 -1104
  439. data/spec/fixtures/public_gists.json +0 -968
  440. data/spec/fixtures/public_key.json +0 -5
  441. data/spec/fixtures/public_key_update.json +0 -5
  442. data/spec/fixtures/public_keys.json +0 -7
  443. data/spec/fixtures/pull_created.json +0 -138
  444. data/spec/fixtures/pull_request.json +0 -138
  445. data/spec/fixtures/pull_request_comment.json +0 -35
  446. data/spec/fixtures/pull_request_comment_create.json +0 -35
  447. data/spec/fixtures/pull_request_comment_reply.json +0 -35
  448. data/spec/fixtures/pull_request_comment_update.json +0 -35
  449. data/spec/fixtures/pull_request_comments.json +0 -35
  450. data/spec/fixtures/pull_request_commits.json +0 -45
  451. data/spec/fixtures/pull_request_files.json +0 -35
  452. data/spec/fixtures/pull_request_merged.json +0 -5
  453. data/spec/fixtures/pull_requests.json +0 -187
  454. data/spec/fixtures/pull_requests_comments.json +0 -82
  455. data/spec/fixtures/pull_update.json +0 -138
  456. data/spec/fixtures/punch_card_stats.json +0 -842
  457. data/spec/fixtures/readme.json +0 -14
  458. data/spec/fixtures/ref.json +0 -9
  459. data/spec/fixtures/ref_create.json +0 -29
  460. data/spec/fixtures/ref_update.json +0 -11
  461. data/spec/fixtures/refs.json +0 -38
  462. data/spec/fixtures/refs_tags.json +0 -29
  463. data/spec/fixtures/repo_assignees.json +0 -30
  464. data/spec/fixtures/repo_events.json +0 -1652
  465. data/spec/fixtures/repo_issues_events.json +0 -128
  466. data/spec/fixtures/repositories.json +0 -872
  467. data/spec/fixtures/repository.json +0 -34
  468. data/spec/fixtures/repository_issues_comments.json +0 -52
  469. data/spec/fixtures/repository_network_events.json +0 -155
  470. data/spec/fixtures/repository_notifications.json +0 -32
  471. data/spec/fixtures/say.txt +0 -22
  472. data/spec/fixtures/say_custom.txt +0 -22
  473. data/spec/fixtures/stargazers.json +0 -212
  474. data/spec/fixtures/starred.json +0 -1114
  475. data/spec/fixtures/starred_gists.json +0 -30
  476. data/spec/fixtures/status.json +0 -16
  477. data/spec/fixtures/statuses.json +0 -34
  478. data/spec/fixtures/subscribers.json +0 -9
  479. data/spec/fixtures/subscription.json +0 -8
  480. data/spec/fixtures/subscription_update.json +0 -8
  481. data/spec/fixtures/subscriptions.json +0 -39
  482. data/spec/fixtures/tag.json +0 -16
  483. data/spec/fixtures/tag_create.json +0 -16
  484. data/spec/fixtures/tags.json +0 -173
  485. data/spec/fixtures/team.json +0 -8
  486. data/spec/fixtures/teams.json +0 -12
  487. data/spec/fixtures/thread_subscription.json +0 -8
  488. data/spec/fixtures/thread_subscription_update.json +0 -8
  489. data/spec/fixtures/tree.json +0 -112
  490. data/spec/fixtures/tree_create.json +0 -14
  491. data/spec/fixtures/update_content.json +0 -44
  492. data/spec/fixtures/user_events.json +0 -101
  493. data/spec/fixtures/user_issues.json +0 -710
  494. data/spec/fixtures/user_performed_public_events.json +0 -78
  495. data/spec/fixtures/user_public_events.json +0 -78
  496. data/spec/fixtures/validation_failed.json +0 -11
  497. data/spec/fixtures/watched.json +0 -1022
  498. data/spec/fixtures/watchers.json +0 -182
  499. data/spec/octokit/client/github_spec.rb +0 -19
  500. data/spec/octokit/client/issue_events_spec.rb +0 -30
  501. data/spec/octokit/client/pub_sub_hubbub/service_hooks_spec.rb +0 -48
  502. data/spec/octokit/client/pulls_spec.rb +0 -210
@@ -1,17 +1,21 @@
1
1
  module Octokit
2
2
  class Client
3
+
4
+ # Methods for the Organizations API
5
+ #
6
+ # @see http://developer.github.com/v3/orgs/
3
7
  module Organizations
4
8
  # Get an organization
5
9
  #
6
10
  # @param org [String] Organization GitHub username.
7
- # @return [Hashie::Mash] Hash representing GitHub organization.
11
+ # @return [Sawyer::Resource] Hash representing GitHub organization.
8
12
  # @see http://developer.github.com/v3/orgs/#get-an-organization
9
13
  # @example
10
14
  # Octokit.organization('github')
11
15
  # @example
12
16
  # Octokit.org('github')
13
17
  def organization(org, options={})
14
- get("orgs/#{org}", options)
18
+ get "orgs/#{org}", options
15
19
  end
16
20
  alias :org :organization
17
21
 
@@ -26,8 +30,7 @@ module Octokit
26
30
  # @option values [String] :email Publicly visible email address.
27
31
  # @option values [String] :location Location of organization.
28
32
  # @option values [String] :name GitHub username for organization.
29
- # @return [Hashie::Mash] Hash representing GitHub organization.
30
- # @see Octokit::Client
33
+ # @return [Sawyer::Resource] Hash representing GitHub organization.
31
34
  # @see http://developer.github.com/v3/orgs/#edit-an-organization
32
35
  # @example
33
36
  # @client.update_organization('github', {
@@ -40,7 +43,7 @@ module Octokit
40
43
  # @example
41
44
  # @client.update_org('github', {:company => 'Unicorns, Inc.'})
42
45
  def update_organization(org, values, options={})
43
- patch("orgs/#{org}", options.merge({:organization => values}))
46
+ patch "orgs/#{org}", options.merge({:organization => values})
44
47
  end
45
48
  alias :update_org :update_organization
46
49
 
@@ -56,8 +59,7 @@ module Octokit
56
59
  # Private organizations are included only if the `@client` is authenticated.
57
60
  #
58
61
  # @param user [String] Username of the user to get list of organizations.
59
- # @return [Array<Hashie::Mash>] Array of hashes representing organizations.
60
- # @see Octokit::Client
62
+ # @return [Array<Sawyer::Resource>] Array of hashes representing organizations.
61
63
  # @see http://developer.github.com/v3/orgs/#list-user-organizations
62
64
  # @example
63
65
  # Octokit.organizations('pengwynn')
@@ -73,9 +75,9 @@ module Octokit
73
75
  # @client.organizations
74
76
  def organizations(user=nil, options={})
75
77
  if user
76
- get("users/#{user}/orgs", options)
78
+ get "users/#{user}/orgs", options
77
79
  else
78
- get("user/orgs", options)
80
+ get "user/orgs", options
79
81
  end
80
82
  end
81
83
  alias :list_organizations :organizations
@@ -91,8 +93,7 @@ module Octokit
91
93
  # @option options [String] :type ('all') Filter by repository type.
92
94
  # `all`, `public`, `member`, `sources`, `forks`, or `private`.
93
95
  #
94
- # @return [Array<Hashie::Mash>] List of repositories
95
- # @see Octokit::Client
96
+ # @return [Array<Sawyer::Resource>] List of repositories
96
97
  # @see http://developer.github.com/v3/repos/#list-organization-repositories
97
98
  # @example
98
99
  # Octokit.organization_repositories('github')
@@ -103,7 +104,7 @@ module Octokit
103
104
  # @example
104
105
  # @client.org_repos('github', {:type => 'private'})
105
106
  def organization_repositories(org, options={})
106
- get("orgs/#{org}/repos", options)
107
+ get "orgs/#{org}/repos", options
107
108
  end
108
109
  alias :org_repositories :organization_repositories
109
110
  alias :org_repos :organization_repositories
@@ -115,8 +116,7 @@ module Octokit
115
116
  # is required to get private members.
116
117
  #
117
118
  # @param org [String] Organization GitHub username.
118
- # @return [Array<Hashie::Mash>] Array of hashes representing users.
119
- # @see Octokit::Client
119
+ # @return [Array<Sawyer::Resource>] Array of hashes representing users.
120
120
  # @see http://developer.github.com/v3/orgs/members/#list-members
121
121
  # @example
122
122
  # Octokit.organization_members('github')
@@ -125,7 +125,7 @@ module Octokit
125
125
  # @example
126
126
  # Octokit.org_members('github')
127
127
  def organization_members(org, options={})
128
- get("orgs/#{org}/members", options)
128
+ get "orgs/#{org}/members", options
129
129
  end
130
130
  alias :org_members :organization_members
131
131
 
@@ -146,7 +146,12 @@ module Octokit
146
146
  # @client.organization_member?('your_organization', 'pengwynn')
147
147
  # => false
148
148
  def organization_member?(org, user, options={})
149
- boolean_from_response(:get, "orgs/#{org}/members/#{user}", options)
149
+ result = boolean_from_response(:get, "orgs/#{org}/members/#{user}", options)
150
+ if last_response.status == 302
151
+ boolean_from_response :get, last_response.headers['Location']
152
+ else
153
+ result
154
+ end
150
155
  end
151
156
  alias :org_member? :organization_member?
152
157
 
@@ -166,7 +171,7 @@ module Octokit
166
171
  # @client.organization_public_member?('github', 'pengwynn')
167
172
  # => true
168
173
  def organization_public_member?(org, user, options={})
169
- boolean_from_response(:get, "orgs/#{org}/public_members/#{user}", options)
174
+ boolean_from_response :get, "orgs/#{org}/public_members/#{user}", options
170
175
  end
171
176
  alias :org_public_member? :organization_public_member?
172
177
 
@@ -175,15 +180,14 @@ module Octokit
175
180
  # Requires authenticated organization member.
176
181
  #
177
182
  # @param org [String] Organization GitHub username.
178
- # @return [Array<Hashie::Mash>] Array of hashes representing teams.
179
- # @see Octokit::Client
183
+ # @return [Array<Sawyer::Resource>] Array of hashes representing teams.
180
184
  # @see http://developer.github.com/v3/orgs/teams/#list-teams
181
185
  # @example
182
186
  # @client.organization_teams('github')
183
187
  # @example
184
188
  # @client.org_teams('github')
185
189
  def organization_teams(org, options={})
186
- get("orgs/#{org}/teams", options)
190
+ get "orgs/#{org}/teams", options
187
191
  end
188
192
  alias :org_teams :organization_teams
189
193
 
@@ -200,8 +204,7 @@ module Octokit
200
204
  # `pull` - team members can pull, but not push to or administer these repositories.
201
205
  # `push` - team members can pull and push, but not administer these repositories.
202
206
  # `admin` - team members can pull, push and administer these repositories.
203
- # @return [Hashie::Mash] Hash representing new team.
204
- # @see Octokit::Client
207
+ # @return [Sawyer::Resource] Hash representing new team.
205
208
  # @see http://developer.github.com/v3/orgs/teams/#create-team
206
209
  # @example
207
210
  # @client.create_team('github', {
@@ -210,7 +213,7 @@ module Octokit
210
213
  # :permission => 'push'
211
214
  # })
212
215
  def create_team(org, options={})
213
- post("orgs/#{org}/teams", options)
216
+ post "orgs/#{org}/teams", options
214
217
  end
215
218
 
216
219
  # Get team
@@ -218,13 +221,12 @@ module Octokit
218
221
  # Requires authenticated organization member.
219
222
  #
220
223
  # @param team_id [Integer] Team id.
221
- # @return [Hashie::Mash] Hash representing team.
222
- # @see Octokit::Client
224
+ # @return [Sawyer::Resource] Hash representing team.
223
225
  # @see http://developer.github.com/v3/orgs/teams/#get-team
224
226
  # @example
225
227
  # @client.team(100000)
226
228
  def team(team_id, options={})
227
- get("teams/#{team_id}", options)
229
+ get "teams/#{team_id}", options
228
230
  end
229
231
 
230
232
  # Update team
@@ -238,8 +240,7 @@ module Octokit
238
240
  # `pull` - team members can pull, but not push to or administer these repositories.
239
241
  # `push` - team members can pull and push, but not administer these repositories.
240
242
  # `admin` - team members can pull, push and administer these repositories.
241
- # @return [Hashie::Mash] Hash representing updated team.
242
- # @see Octokit::Client
243
+ # @return [Sawyer::Resource] Hash representing updated team.
243
244
  # @see http://developer.github.com/v3/orgs/teams/#edit-team
244
245
  # @example
245
246
  # @client.update_team(100000, {
@@ -247,7 +248,7 @@ module Octokit
247
248
  # :permission => 'push'
248
249
  # })
249
250
  def update_team(team_id, options={})
250
- patch("teams/#{team_id}", options)
251
+ patch "teams/#{team_id}", options
251
252
  end
252
253
 
253
254
  # Delete team
@@ -256,12 +257,11 @@ module Octokit
256
257
  #
257
258
  # @param team_id [Integer] Team id.
258
259
  # @return [Boolean] True if deletion successful, false otherwise.
259
- # @see Octokit::Client
260
260
  # @see http://developer.github.com/v3/orgs/teams/#delete-team
261
261
  # @example
262
262
  # @client.delete_team(100000)
263
263
  def delete_team(team_id, options={})
264
- boolean_from_response(:delete, "teams/#{team_id}", options)
264
+ boolean_from_response :delete, "teams/#{team_id}", options
265
265
  end
266
266
 
267
267
  # List team members
@@ -269,13 +269,12 @@ module Octokit
269
269
  # Requires authenticated organization member.
270
270
  #
271
271
  # @param team_id [Integer] Team id.
272
- # @return [Array<Hashie::Mash>] Array of hashes representing users.
273
- # @see Octokit::Client
272
+ # @return [Array<Sawyer::Resource>] Array of hashes representing users.
274
273
  # @see http://developer.github.com/v3/orgs/teams/#list-team-members
275
274
  # @example
276
275
  # @client.team_members(100000)
277
276
  def team_members(team_id, options={})
278
- get("teams/#{team_id}/members", options)
277
+ get "teams/#{team_id}/members", options
279
278
  end
280
279
 
281
280
  # Add team member
@@ -286,7 +285,6 @@ module Octokit
286
285
  # @param team_id [Integer] Team id.
287
286
  # @param user [String] GitHub username of new team member.
288
287
  # @return [Boolean] True on successful addition, false otherwise.
289
- # @see Octokit::Client
290
288
  # @see http://developer.github.com/v3/orgs/teams/#add-team-member
291
289
  # @example
292
290
  # @client.add_team_member(100000, 'pengwynn')
@@ -294,7 +292,7 @@ module Octokit
294
292
  # There's a bug in this API call. The docs say to leave the body blank,
295
293
  # but it fails if the body is both blank and the content-length header
296
294
  # is not 0.
297
- boolean_from_response(:put, "teams/#{team_id}/members/#{user}", options.merge({:name => user}))
295
+ boolean_from_response :put, "teams/#{team_id}/members/#{user}", options.merge({:name => user})
298
296
  end
299
297
 
300
298
  # Remove team member
@@ -305,12 +303,11 @@ module Octokit
305
303
  # @param team_id [Integer] Team id.
306
304
  # @param user [String] GitHub username of the user to boot.
307
305
  # @return [Boolean] True if user removed, false otherwise.
308
- # @see Octokit::Client
309
306
  # @see http://developer.github.com/v3/orgs/teams/#remove-team-member
310
307
  # @example
311
308
  # @client.remove_team_member(100000, 'pengwynn')
312
309
  def remove_team_member(team_id, user, options={})
313
- boolean_from_response(:delete, "teams/#{team_id}/members/#{user}", options)
310
+ boolean_from_response :delete, "teams/#{team_id}/members/#{user}", options
314
311
  end
315
312
 
316
313
  # Check if a user is a member of a team.
@@ -329,7 +326,7 @@ module Octokit
329
326
  # @client.team_member?('your_team', 'pengwynn')
330
327
  # => false
331
328
  def team_member?(team_id, user, options={})
332
- boolean_from_response(:get, "teams/#{team_id}/members/#{user}", options)
329
+ boolean_from_response :get, "teams/#{team_id}/members/#{user}", options
333
330
  end
334
331
 
335
332
  # List team repositories
@@ -337,15 +334,14 @@ module Octokit
337
334
  # Requires authenticated organization member.
338
335
  #
339
336
  # @param team_id [Integer] Team id.
340
- # @return [Array<Hashie::Mash>] Array of hashes representing repositories.
341
- # @see Octokit::Client
337
+ # @return [Array<Sawyer::Resource>] Array of hashes representing repositories.
342
338
  # @see http://developer.github.com/v3/orgs/teams/#list-team-repos
343
339
  # @example
344
340
  # @client.team_repositories(100000)
345
341
  # @example
346
342
  # @client.team_repos(100000)
347
343
  def team_repositories(team_id, options={})
348
- get("teams/#{team_id}/repos", options)
344
+ get "teams/#{team_id}/repos", options
349
345
  end
350
346
  alias :team_repos :team_repositories
351
347
 
@@ -358,7 +354,6 @@ module Octokit
358
354
  # @param team_id [Integer] Team id.
359
355
  # @param repo [String, Hash, Repository] A GitHub repository.
360
356
  # @return [Boolean] True if successful, false otherwise.
361
- # @see Octokit::Client
362
357
  # @see Octokit::Repository
363
358
  # @see http://developer.github.com/v3/orgs/teams/#add-team-repo
364
359
  # @example
@@ -366,7 +361,7 @@ module Octokit
366
361
  # @example
367
362
  # @client.add_team_repo(100000, 'github/developer.github.com')
368
363
  def add_team_repository(team_id, repo, options={})
369
- boolean_from_response(:put, "teams/#{team_id}/repos/#{Repository.new(repo)}", options.merge(:name => Repository.new(repo)))
364
+ boolean_from_response :put, "teams/#{team_id}/repos/#{Repository.new(repo)}", options.merge(:name => Repository.new(repo))
370
365
  end
371
366
  alias :add_team_repo :add_team_repository
372
367
 
@@ -379,7 +374,6 @@ module Octokit
379
374
  # @param team_id [Integer] Team id.
380
375
  # @param repo [String, Hash, Repository] A GitHub repository.
381
376
  # @return [Boolean] Return true if repo removed from team, false otherwise.
382
- # @see Octokit::Client
383
377
  # @see Octokit::Repository
384
378
  # @see http://developer.github.com/v3/orgs/teams/#remove-team-repo
385
379
  # @example
@@ -387,7 +381,7 @@ module Octokit
387
381
  # @example
388
382
  # @client.remove_team_repo(100000, 'github/developer.github.com')
389
383
  def remove_team_repository(team_id, repo, options={})
390
- boolean_from_response(:delete, "teams/#{team_id}/repos/#{Repository.new(repo)}")
384
+ boolean_from_response :delete, "teams/#{team_id}/repos/#{Repository.new(repo)}"
391
385
  end
392
386
  alias :remove_team_repo :remove_team_repository
393
387
 
@@ -398,7 +392,6 @@ module Octokit
398
392
  # @param org [String] Organization GitHub username.
399
393
  # @param user [String] GitHub username of user to remove.
400
394
  # @return [Boolean] True if removal is successful, false otherwise.
401
- # @see Octokit::Client
402
395
  # @see http://developer.github.com/v3/orgs/teams/#remove-team-member
403
396
  # @example
404
397
  # @client.remove_organization_member('github', 'pengwynn')
@@ -407,7 +400,7 @@ module Octokit
407
400
  def remove_organization_member(org, user, options={})
408
401
  # this is a synonym for: for team in org.teams: remove_team_member(team.id, user)
409
402
  # provided in the GH API v3
410
- boolean_from_response(:delete, "orgs/#{org}/members/#{user}", options)
403
+ boolean_from_response :delete, "orgs/#{org}/members/#{user}", options
411
404
  end
412
405
  alias :remove_org_member :remove_organization_member
413
406
 
@@ -418,12 +411,11 @@ module Octokit
418
411
  # @param org [String] Organization GitHub username.
419
412
  # @param user [String] GitHub username of user to publicize.
420
413
  # @return [Boolean] True if publicization successful, false otherwise.
421
- # @see Octokit::Client
422
414
  # @see http://developer.github.com/v3/orgs/members/#publicize-a-users-membership
423
415
  # @example
424
416
  # @client.publicize_membership('github', 'pengwynn')
425
417
  def publicize_membership(org, user, options={})
426
- boolean_from_response(:put, "orgs/#{org}/public_members/#{user}", options)
418
+ boolean_from_response :put, "orgs/#{org}/public_members/#{user}", options
427
419
  end
428
420
 
429
421
  # Conceal a user's membership of an organization.
@@ -433,14 +425,13 @@ module Octokit
433
425
  # @param org [String] Organization GitHub username.
434
426
  # @param user [String] GitHub username of user to unpublicize.
435
427
  # @return [Boolean] True of unpublicization successful, false otherwise.
436
- # @see Octokit::Client
437
428
  # @see http://developer.github.com/v3/orgs/members/#conceal-a-users-membership
438
429
  # @example
439
430
  # @client.unpublicize_membership('github', 'pengwynn')
440
431
  # @example
441
432
  # @client.conceal_membership('github', 'pengwynn')
442
433
  def unpublicize_membership(org, user, options={})
443
- boolean_from_response(:delete, "orgs/#{org}/public_members/#{user}", options)
434
+ boolean_from_response :delete, "orgs/#{org}/public_members/#{user}", options
444
435
  end
445
436
  alias :conceal_membership :unpublicize_membership
446
437
 
@@ -1,11 +1,15 @@
1
1
  module Octokit
2
2
  class Client
3
+
4
+ # Methods for the PubSubHubbub API
5
+ #
6
+ # @see http://developer.github.com/v3/repos/hooks/#pubsubhubbub
3
7
  module PubSubHubbub
4
8
  # Subscribe to a pubsub topic
5
9
  #
6
10
  # @param topic [String] A recoginized and supported pubsub topic
7
11
  # @param callback [String] A callback url to be posted to when the topic event is fired
8
- # @return [boolean] true if the subscribe was successful, otherwise an error is raised
12
+ # @return [Boolean] true if the subscribe was successful, otherwise an error is raised
9
13
  # @example Subscribe to push events from one of your repositories, having an email sent when fired
10
14
  # client = Octokit::Client.new(:oauth_token = "token")
11
15
  # client.subscribe("https://github.com/joshk/devise_imapable/events/push", "github://Email?address=josh.kalderimis@gmail.com")
@@ -13,17 +17,18 @@ module Octokit
13
17
  options = {
14
18
  :"hub.mode" => "subscribe",
15
19
  :"hub.topic" => topic,
16
- :"hub.callback" => callback,
17
- :force_urlencoded => true
20
+ :"hub.callback" => callback
18
21
  }
19
- boolean_from_response(:post, "hub", options)
22
+ response = pub_sub_hubbub_request(options)
23
+
24
+ response.status == 204
20
25
  end
21
26
 
22
27
  # Unsubscribe from a pubsub topic
23
28
  #
24
29
  # @param topic [String] A recoginized pubsub topic
25
30
  # @param callback [String] A callback url to be unsubscribed from
26
- # @return [boolean] true if the unsubscribe was successful, otherwise an error is raised
31
+ # @return [Boolean] true if the unsubscribe was successful, otherwise an error is raised
27
32
  # @example Unsubscribe to push events from one of your repositories, no longer having an email sent when fired
28
33
  # client = Octokit::Client.new(:oauth_token = "token")
29
34
  # client.unsubscribe("https://github.com/joshk/devise_imapable/events/push", "github://Email?address=josh.kalderimis@gmail.com")
@@ -31,10 +36,65 @@ module Octokit
31
36
  options = {
32
37
  :"hub.mode" => "unsubscribe",
33
38
  :"hub.topic" => topic,
34
- :"hub.callback" => callback,
35
- :force_urlencoded => true
39
+ :"hub.callback" => callback
36
40
  }
37
- boolean_from_response(:post, "hub", options)
41
+ response = pub_sub_hubbub_request(options)
42
+
43
+ response.status == 204
44
+ end
45
+
46
+ # Subscribe to a repository through pubsub
47
+ #
48
+ # @param repo [String, Repository, Hash] A GitHub repository
49
+ # @param service_name [String] service name owner
50
+ # @param service_arguments [Hash] params that will be passed by subscribed hook.
51
+ # List of services is available @ https://github.com/github/github-services/tree/master/docs.
52
+ # Please refer Data node for complete list of arguments.
53
+ # @example Subscribe to push events to one of your repositories to Travis-CI
54
+ # client = Octokit::Client.new(:oauth_token = "token")
55
+ # client.subscribe_service_hook('joshk/device_imapable', 'Travis', { :token => "test", :domain => "domain", :user => "user" })
56
+ def subscribe_service_hook(repo, service_name, service_arguments = {})
57
+ topic = "#{Octokit.web_endpoint}#{Repository.new(repo)}/events/push"
58
+ callback = "github://#{service_name}?#{service_arguments.collect{ |k,v| [ k,v ].join("=") }.join("&") }"
59
+ subscribe(topic, callback)
60
+ end
61
+
62
+ # Unsubscribe repository through pubsub
63
+ #
64
+ # @param repo [String, Repository, Hash] A GitHub repository
65
+ # @param service_name [String] service name owner
66
+ # List of services is available @ https://github.com/github/github-services/tree/master/docs.
67
+ # @example Subscribe to push events to one of your repositories to Travis-CI
68
+ # client = Octokit::Client.new(:oauth_token = "token")
69
+ # client.unsubscribe_service_hook('joshk/device_imapable', 'Travis')
70
+ def unsubscribe_service_hook(repo, service_name)
71
+ topic = "#{Octokit.web_endpoint}#{Repository.new(repo)}/events/push"
72
+ callback = "github://#{service_name}"
73
+ unsubscribe(topic, callback)
74
+ end
75
+
76
+ private
77
+
78
+ def pub_sub_hubbub_request(options = {})
79
+ # This method is janky, bypass normal stack so we don'tl
80
+ # serialize request as JSON
81
+ conn = Faraday.new(:url => @api_endpoint) do |http|
82
+ http.headers[:user_agent] = user_agent
83
+ if basic_authenticated?
84
+ http.basic_auth(@login, @password)
85
+ elsif token_authenticated?
86
+ http.authorization 'token', @access_token
87
+ end
88
+ http.request :url_encoded
89
+ http.use Octokit::Response::RaiseError
90
+ http.adapter Faraday.default_adapter
91
+ end
92
+
93
+ response = conn.post do |req|
94
+ req.url "hub"
95
+ req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
96
+ req.body = options
97
+ end
38
98
  end
39
99
  end
40
100
  end