octokit 1.24.0 → 2.0.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 (507) hide show
  1. data/CONTRIBUTING.md +5 -2
  2. data/LICENSE.md +1 -1
  3. data/README.md +362 -95
  4. data/Rakefile +10 -7
  5. data/lib/octokit/arguments.rb +14 -0
  6. data/lib/octokit/authentication.rb +48 -25
  7. data/lib/octokit/client/authorizations.rb +49 -23
  8. data/lib/octokit/client/commit_comments.rb +96 -0
  9. data/lib/octokit/client/commits.rb +162 -104
  10. data/lib/octokit/client/contents.rb +120 -9
  11. data/lib/octokit/client/downloads.rb +12 -8
  12. data/lib/octokit/client/emojis.rb +5 -3
  13. data/lib/octokit/client/events.rb +71 -27
  14. data/lib/octokit/client/gists.rb +43 -42
  15. data/lib/octokit/client/gitignore.rb +9 -5
  16. data/lib/octokit/client/issues.rb +77 -104
  17. data/lib/octokit/client/labels.rb +51 -49
  18. data/lib/octokit/client/legacy_search.rb +43 -0
  19. data/lib/octokit/client/markdown.rb +9 -4
  20. data/lib/octokit/client/meta.rb +21 -0
  21. data/lib/octokit/client/milestones.rb +23 -19
  22. data/lib/octokit/client/notifications.rb +37 -77
  23. data/lib/octokit/client/objects.rb +25 -20
  24. data/lib/octokit/client/organizations.rb +65 -74
  25. data/lib/octokit/client/pub_sub_hubbub.rb +68 -8
  26. data/lib/octokit/client/{pulls.rb → pull_requests.rb} +89 -65
  27. data/lib/octokit/client/rate_limit.rb +42 -8
  28. data/lib/octokit/client/refs.rb +20 -14
  29. data/lib/octokit/client/repositories.rb +168 -201
  30. data/lib/octokit/client/say.rb +8 -3
  31. data/lib/octokit/client/search.rb +79 -0
  32. data/lib/octokit/client/service_status.rb +39 -0
  33. data/lib/octokit/client/stats.rb +87 -0
  34. data/lib/octokit/client/statuses.rb +12 -33
  35. data/lib/octokit/client/users.rb +87 -97
  36. data/lib/octokit/client.rb +251 -44
  37. data/lib/octokit/configurable.rb +119 -0
  38. data/lib/octokit/default.rb +141 -0
  39. data/lib/octokit/error.rb +81 -15
  40. data/lib/octokit/gist.rb +12 -3
  41. data/lib/octokit/rate_limit.rb +33 -0
  42. data/lib/octokit/repo_arguments.rb +19 -0
  43. data/lib/octokit/repository.rb +19 -13
  44. data/lib/octokit/response/raise_error.rb +21 -0
  45. data/lib/octokit/version.rb +5 -1
  46. data/lib/octokit.rb +22 -15
  47. data/octokit.gemspec +7 -12
  48. data/spec/cassettes/Octokit_Client/_get/handles_query_params.json +1 -0
  49. data/spec/cassettes/Octokit_Client/_head/handles_query_params.json +1 -0
  50. data/spec/cassettes/Octokit_Client/_last_response/caches_the_last_agent_response.json +1 -0
  51. data/spec/cassettes/Octokit_Client/authentication/when_token_authenticated/fetches_and_memoizes_login.json +1 -0
  52. data/spec/cassettes/Octokit_Client/auto_pagination/fetches_all_the_pages.json +1 -0
  53. data/spec/cassettes/Octokit_Client/error_handling/raises_on_404.json +1 -0
  54. data/spec/cassettes/Octokit_Client_Authorizations/_authorization/returns_a_single_authorization.json +1 -0
  55. data/spec/cassettes/Octokit_Client_Authorizations/_authorizations/lists_existing_authorizations.json +1 -0
  56. data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_a_new_authorization_with_options.json +1 -0
  57. data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_an_API_authorization.json +1 -0
  58. data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_a_one-off_token.json +1 -0
  59. data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_the_current_token.json +1 -0
  60. data/spec/cassettes/Octokit_Client_Authorizations/_update_authorization/updates_and_existing_authorization.json +1 -0
  61. data/spec/cassettes/Octokit_Client_CommitComments/_commit_comment/returns_a_single_commit_comment.json +1 -0
  62. data/spec/cassettes/Octokit_Client_CommitComments/_commit_comments/returns_a_list_of_comments_for_a_specific_commit.json +1 -0
  63. data/spec/cassettes/Octokit_Client_CommitComments/_create_commit_comment/creates_a_commit_comment.json +1 -0
  64. data/spec/cassettes/Octokit_Client_CommitComments/_delete_commit_comment/deletes_a_commit_comment.json +1 -0
  65. data/spec/cassettes/Octokit_Client_CommitComments/_list_commit_comments/returns_a_list_of_all_commit_comments.json +1 -0
  66. data/spec/cassettes/Octokit_Client_CommitComments/_update_commit_comment/updates_a_commit_comment.json +1 -0
  67. data/spec/cassettes/Octokit_Client_Commits/_commit/returns_a_commit.json +1 -0
  68. data/spec/cassettes/Octokit_Client_Commits/_commits/handles_branch_or_sha_argument.json +1 -0
  69. data/spec/cassettes/Octokit_Client_Commits/_commits/handles_the_sha_option.json +1 -0
  70. data/spec/cassettes/Octokit_Client_Commits/_commits/returns_all_commits.json +1 -0
  71. data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_branch_or_sha_argument.json +1 -0
  72. data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_the_sha_option.json +1 -0
  73. data/spec/cassettes/Octokit_Client_Commits/_commits_before/returns_all_commits_until_the_specified_date.json +1 -0
  74. data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_branch_or_sha_argument.json +1 -0
  75. data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_the_sha_option.json +1 -0
  76. data/spec/cassettes/Octokit_Client_Commits/_commits_between/returns_all_commits_until_the_specified_date.json +1 -0
  77. data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_branch_or_sha_argument.json +1 -0
  78. data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_the_sha_option.json +1 -0
  79. data/spec/cassettes/Octokit_Client_Commits/_commits_on/returns_all_commits_on_the_specified_date.json +1 -0
  80. data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_branch_or_sha_argument.json +1 -0
  81. data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_the_sha_option.json +1 -0
  82. data/spec/cassettes/Octokit_Client_Commits/_commits_since/returns_all_commits_since_the_specified_date.json +1 -0
  83. data/spec/cassettes/Octokit_Client_Commits/_compare/returns_a_comparison.json +1 -0
  84. data/spec/cassettes/Octokit_Client_Commits/_create_commit/creates_a_commit.json +1 -0
  85. data/spec/cassettes/Octokit_Client_Commits/_merge/merges_a_branch_into_another.json +1 -0
  86. data/spec/cassettes/Octokit_Client_Contents/_archive_link/returns_the_headers_of_the_request.json +1 -0
  87. data/spec/cassettes/Octokit_Client_Contents/_contents/returns_the_contents_of_a_file.json +1 -0
  88. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_File_object.json +1 -0
  89. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_file_path.json +1 -0
  90. data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_repository_contents_at_a_path.json +1 -0
  91. data/spec/cassettes/Octokit_Client_Contents/_delete_contents/deletes_repository_contents_at_a_path.json +1 -0
  92. data/spec/cassettes/Octokit_Client_Contents/_readme/returns_the_default_readme.json +1 -0
  93. data/spec/cassettes/Octokit_Client_Contents/_update_contents/updates_repository_contents_at_a_path.json +1 -0
  94. data/spec/cassettes/Octokit_Client_Downloads/_download/gets_a_single_download.json +1 -0
  95. data/spec/cassettes/Octokit_Client_Downloads/_downloads/lists_available_downloads.json +1 -0
  96. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/creates_a_download_resource.json +1 -0
  97. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/posts_to_an_S3_url.json +1 -0
  98. data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_delete_download/deletes_a_download.json +1 -0
  99. data/spec/cassettes/Octokit_Client_Emojis/_emojis/returns_all_github_emojis.json +1 -0
  100. data/spec/cassettes/Octokit_Client_Events/_issue_event/lists_issue_events_for_a_repository.json +1 -0
  101. data/spec/cassettes/Octokit_Client_Events/_issue_events/lists_issue_events_for_a_repository.json +1 -0
  102. data/spec/cassettes/Octokit_Client_Events/_organization_events/returns_all_events_for_an_organization.json +1 -0
  103. data/spec/cassettes/Octokit_Client_Events/_organization_public_events/returns_an_organization_s_public_events.json +1 -0
  104. data/spec/cassettes/Octokit_Client_Events/_public_events/returns_all_public_events.json +1 -0
  105. data/spec/cassettes/Octokit_Client_Events/_received_events/returns_all_user_received_events.json +1 -0
  106. data/spec/cassettes/Octokit_Client_Events/_received_public_events/returns_public_user_received_events.json +1 -0
  107. data/spec/cassettes/Octokit_Client_Events/_repo_issue_events/lists_issue_events_for_a_repository.json +1 -0
  108. data/spec/cassettes/Octokit_Client_Events/_repository_events/returns_events_for_a_repository.json +1 -0
  109. data/spec/cassettes/Octokit_Client_Events/_repository_network_events/returns_events_for_a_repository_s_network.json +1 -0
  110. data/spec/cassettes/Octokit_Client_Events/_user_events/returns_all_user_events.json +1 -0
  111. data/spec/cassettes/Octokit_Client_Events/_user_public_events/returns_public_events_performed_by_a_user.json +1 -0
  112. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gist/returns_the_gist_by_ID.json +1 -0
  113. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/with_username_passed/returns_a_list_of_gists.json +1 -0
  114. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/without_a_username_passed/returns_a_list_of_gists.json +1 -0
  115. data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_public_gists/returns_public_gists.json +1 -0
  116. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist/creates_a_new_gist.json +1 -0
  117. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist_comment/creates_a_gist_comment.json +1 -0
  118. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist/deletes_an_existing_gist.json +1 -0
  119. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist_comment/deletes_a_gist_comment.json +1 -0
  120. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_edit_gist/edit_an_existing_gist.json +1 -0
  121. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_fork_gist/forks_an_existing_gist.json +1 -0
  122. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comment/returns_a_gist_comment.json +1 -0
  123. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comments/returns_the_list_of_gist_comments.json +1 -0
  124. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_not_starred.json +1 -0
  125. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_starred.json +1 -0
  126. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gists/returns_a_list_of_gists.json +1 -0
  127. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_star_gist/stars_an_existing_gist.json +1 -0
  128. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_starred_gists/returns_the_user_s_starred_gists.json +1 -0
  129. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_unstar_gist/unstars_an_existing_gist.json +1 -0
  130. data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_update_gist_comment/updates_a_gist_comment.json +1 -0
  131. data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_template/returns_the_ruby_gitignore_template.json +1 -0
  132. data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_templates/returns_all_gitignore_templates.json +1 -0
  133. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue.json +1 -0
  134. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_delimited_labels.json +1 -0
  135. data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_labels_array.json +1 -0
  136. data/spec/cassettes/Octokit_Client_Issues/_issue_comment/returns_a_single_comment_for_an_issue.json +1 -0
  137. data/spec/cassettes/Octokit_Client_Issues/_issue_comments/returns_comments_for_an_issue.json +1 -0
  138. data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_dashboard_issues_for_the_authenticated_user.json +1 -0
  139. data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_issues_for_a_repository.json +1 -0
  140. data/spec/cassettes/Octokit_Client_Issues/_org_issues/returns_issues_for_the_organization_for_the_authenticated_user.json +1 -0
  141. data/spec/cassettes/Octokit_Client_Issues/_repository_issues_comments/returns_comments_for_all_issues_in_a_repository.json +1 -0
  142. data/spec/cassettes/Octokit_Client_Issues/_user_issues/returns_issues_for_the_authenticated_user_for_owned_and_member_repos.json +1 -0
  143. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_add_comment/adds_a_comment.json +1 -0
  144. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_close_issue/closes_an_issue.json +1 -0
  145. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_a_full_issue.json +1 -0
  146. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_an_issue.json +1 -0
  147. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_reopen_issue/reopens_an_issue.json +1 -0
  148. data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_update_issue/updates_an_issue.json +1 -0
  149. 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
  150. 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
  151. data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_a_color.json +1 -0
  152. data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_default_color.json +1 -0
  153. data/spec/cassettes/Octokit_Client_Labels/_delete_label_/deletes_a_label_from_the_repository.json +1 -0
  154. data/spec/cassettes/Octokit_Client_Labels/_label/returns_a_single_label.json +1 -0
  155. data/spec/cassettes/Octokit_Client_Labels/_labels/returns_labels.json +1 -0
  156. data/spec/cassettes/Octokit_Client_Labels/_lables_for_milestone/returns_all_labels_for_a_repository.json +1 -0
  157. 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
  158. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_labels_for_issue/returns_all_labels_for_a_given_issue.json +1 -0
  159. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_all_labels/removes_all_labels_from_the_specified_issue.json +1 -0
  160. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_label/removes_a_label_from_the_specified_issue.json +1 -0
  161. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_replace_all_labels/replaces_all_labels_for_an_issue.json +1 -0
  162. data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_label/_update_label/updates_a_label_with_a_new_color.json +1 -0
  163. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_issues/returns_matching_issues.json +1 -0
  164. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_repos/returns_matching_repositories.json +1 -0
  165. data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_users/returns_matching_username.json +1 -0
  166. data/spec/cassettes/Octokit_Client_Markdown/_markdown/renders_markdown.json +1 -0
  167. data/spec/cassettes/Octokit_Client_Meta/_github_meta/returns_meta_information_about_github.json +1 -0
  168. data/spec/cassettes/Octokit_Client_Milestones/_list_milestones/lists_milestones_belonging_to_repository.json +1 -0
  169. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_create_milestone/creates_a_milestone.json +1 -0
  170. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_delete_milestone/deletes_a_milestone_from_a_repository.json +1 -0
  171. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_milestone/gets_a_single_milestone_belonging_to_repository.json +1 -0
  172. data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_update_milestone/updates_a_milestone.json +1 -0
  173. data/spec/cassettes/Octokit_Client_Notifications/_mark_notifications_as_read/returns_true_when_notifications_are_marked_as_read.json +1 -0
  174. 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
  175. data/spec/cassettes/Octokit_Client_Notifications/_notifications/lists_the_notifications_for_the_current_user.json +1 -0
  176. data/spec/cassettes/Octokit_Client_Notifications/_repository_notifications/lists_all_notifications_for_a_repository.json +1 -0
  177. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_delete_thread_subscription/returns_true_with_successful_thread_deletion.json +1 -0
  178. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_mark_thread_as_read/marks_a_thread_as_read.json +1 -0
  179. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_notifications/returns_notifications_for_a_specific_thread.json +1 -0
  180. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_subscription/returns_a_thread_subscription.json +1 -0
  181. data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_update_thread_subscription/updates_a_thread_subscription.json +1 -0
  182. data/spec/cassettes/Octokit_Client_Objects/_blob/returns_a_blob.json +1 -0
  183. data/spec/cassettes/Octokit_Client_Objects/_create_blob/creates_a_blob.json +1 -0
  184. data/spec/cassettes/Octokit_Client_Objects/_create_tag/creates_a_tag.json +1 -0
  185. data/spec/cassettes/Octokit_Client_Objects/_create_tree/creates_a_tree.json +1 -0
  186. data/spec/cassettes/Octokit_Client_Objects/_tag/returns_a_tag.json +1 -0
  187. data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree.json +1 -0
  188. data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree_recursively.json +1 -0
  189. data/spec/cassettes/Octokit_Client_Organizations/_organization/returns_an_organization.json +1 -0
  190. data/spec/cassettes/Octokit_Client_Organizations/_organization_member_/checks_organization_membership.json +1 -0
  191. data/spec/cassettes/Octokit_Client_Organizations/_organization_members/returns_all_public_members_of_an_organization.json +1 -0
  192. data/spec/cassettes/Octokit_Client_Organizations/_organization_public_member_/checks_publicized_org_membership.json +1 -0
  193. data/spec/cassettes/Octokit_Client_Organizations/_organization_repositories/returns_all_public_repositories_for_an_organization.json +1 -0
  194. data/spec/cassettes/Octokit_Client_Organizations/_organization_teams/returns_all_teams_for_an_organization.json +1 -0
  195. data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_a_user.json +1 -0
  196. data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_the_authenticated_user.json +1 -0
  197. data/spec/cassettes/Octokit_Client_Organizations/_update_organization/updates_an_organization.json +1 -0
  198. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_member/adds_a_team_member.json +1 -0
  199. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_repository/adds_a_team_repository.json +1 -0
  200. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_create_team/creates_a_team.json +1 -0
  201. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_delete_team/deletes_a_team.json +1 -0
  202. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_publicize_membership/publicizes_membership.json +1 -0
  203. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_member/removes_a_team_member.json +1 -0
  204. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_repository/removes_a_team_repository.json +1 -0
  205. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team/returns_a_team.json +1 -0
  206. 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
  207. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_members/returns_team_members.json +1 -0
  208. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_repositories/returns_team_repositories.json +1 -0
  209. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_unpublicize_membership/unpublicizes_membership.json +1 -0
  210. data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_update_team/updates_a_team.json +1 -0
  211. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/raises_an_error_when_topic_is_not_recognized.json +1 -0
  212. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/subscribes_to_pull_events.json +1 -0
  213. data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe_service_hook/subscribes_to_pull_events_on_specified_topic.json +1 -0
  214. data/spec/cassettes/Octokit_Client_PubSubHubbub/_unsubscribe/unsubscribes_from_pull_events.json +1 -0
  215. data/spec/cassettes/Octokit_Client_PubSubHubbub/unsubscribe_service_hook/unsubscribes_to_stop_receiving_events_on_specified_topic.json +1 -0
  216. 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
  217. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comment/returns_a_comment_on_a_pull_request.json +1 -0
  218. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comments/returns_the_comments_for_a_pull_request.json +1 -0
  219. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_commits/returns_the_commits_for_a_pull_request.json +1 -0
  220. data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_files/lists_files_for_a_pull_request.json +1 -0
  221. data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests/returns_all_pull_requests.json +1 -0
  222. data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests_comments/returns_all_comments_on_all_pull_requests.json +1 -0
  223. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_close_pull_request/closes_a_pull_request.json +1 -0
  224. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_create_pull_request/creates_a_pull_request.json +1 -0
  225. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_merge_pull_request/merges_the_pull_request.json +1 -0
  226. 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
  227. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_request/returns_a_pull_request.json +1 -0
  228. data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json +1 -0
  229. 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
  230. 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
  231. 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
  232. 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
  233. data/spec/cassettes/Octokit_Client_Refs/_ref/returns_a_tags_ref.json +1 -0
  234. data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_refs.json +1 -0
  235. data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_tag_refs.json +1 -0
  236. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_create_ref/creates_a_ref.json +1 -0
  237. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_delete_ref/deletes_an_existing_ref.json +1 -0
  238. data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_update_ref/updates_a_ref.json +1 -0
  239. data/spec/cassettes/Octokit_Client_Repositories/_all_repositories/returns_all_repositories_on_github.json +1 -0
  240. data/spec/cassettes/Octokit_Client_Repositories/_assignees/lists_all_the_available_assignees_owner_collaborators_.json +1 -0
  241. data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_repository_s_branches.json +1 -0
  242. data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_single_branch.json +1 -0
  243. data/spec/cassettes/Octokit_Client_Repositories/_check_assignee/checks_to_see_if_a_particular_user_is_an_assignee_for_a_repository.json +1 -0
  244. data/spec/cassettes/Octokit_Client_Repositories/_collaborators/returns_a_repository_s_collaborators.json +1 -0
  245. data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors.json +1 -0
  246. data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors_excluding_anonymous.json +1 -0
  247. data/spec/cassettes/Octokit_Client_Repositories/_create_repository/creates_a_repository_for_an_organization.json +1 -0
  248. data/spec/cassettes/Octokit_Client_Repositories/_delete_subscription/returns_true_when_repo_subscription_deleted.json +1 -0
  249. data/spec/cassettes/Octokit_Client_Repositories/_fork/forks_a_repository.json +1 -0
  250. data/spec/cassettes/Octokit_Client_Repositories/_languages/returns_a_repository_s_languages.json +1 -0
  251. data/spec/cassettes/Octokit_Client_Repositories/_network/returns_a_repository_s_network.json +1 -0
  252. data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_a_user_s_repositories.json +1 -0
  253. data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_authenticated_user_s_repositories.json +1 -0
  254. data/spec/cassettes/Octokit_Client_Repositories/_repository/returns_the_matching_repository.json +1 -0
  255. data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_false_if_the_repository_doesn_t_exist.json +1 -0
  256. data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_true_if_the_repository_exists.json +1 -0
  257. data/spec/cassettes/Octokit_Client_Repositories/_star/stars_a_repository.json +1 -0
  258. data/spec/cassettes/Octokit_Client_Repositories/_stargazers/returns_all_repository_stargazers.json +1 -0
  259. data/spec/cassettes/Octokit_Client_Repositories/_subscribers/lists_all_the_users_watching_the_repository.json +1 -0
  260. data/spec/cassettes/Octokit_Client_Repositories/_subscription/returns_a_repository_subscription.json +1 -0
  261. data/spec/cassettes/Octokit_Client_Repositories/_tags/returns_a_repository_s_tags.json +1 -0
  262. data/spec/cassettes/Octokit_Client_Repositories/_unstar/unstars_a_repository.json +1 -0
  263. data/spec/cassettes/Octokit_Client_Repositories/_unwatch/unwatches_a_repository.json +1 -0
  264. data/spec/cassettes/Octokit_Client_Repositories/_update_subscription/updates_a_repository_subscription.json +1 -0
  265. data/spec/cassettes/Octokit_Client_Repositories/_watch/watches_a_repository.json +1 -0
  266. data/spec/cassettes/Octokit_Client_Repositories/_watchers/returns_all_repository_watchers.json +1 -0
  267. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_add_collaborator/adds_a_repository_collaborators.json +1 -0
  268. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_create_repository/creates_a_repository.json +1 -0
  269. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_delete_repository/deletes_a_repository.json +1 -0
  270. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_deploy_keys/returns_a_repository_s_deploy_keys.json +1 -0
  271. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_hooks/returns_a_repository_s_hooks.json +1 -0
  272. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_remove_collaborator/removes_a_repository_collaborators.json +1 -0
  273. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_repository_teams/returns_all_repository_teams.json +1 -0
  274. data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_update_repository/updates_the_matching_repository.json +1 -0
  275. 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
  276. 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
  277. 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
  278. 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
  279. 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
  280. 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
  281. data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat.json +1 -0
  282. data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat_with_custom_text.json +1 -0
  283. data/spec/cassettes/Octokit_Client_Search/_search_code/searches_code.json +1 -0
  284. data/spec/cassettes/Octokit_Client_Search/_search_issues/searches_issues.json +1 -0
  285. data/spec/cassettes/Octokit_Client_Search/_search_repositories/searches_repositories.json +1 -0
  286. data/spec/cassettes/Octokit_Client_Search/_search_users/searches_users.json +1 -0
  287. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +1 -0
  288. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +1 -0
  289. data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +1 -0
  290. data/spec/cassettes/Octokit_Client_Stats/_code_frequency_stats/returns_the_code_frequency_stats.json +1 -0
  291. data/spec/cassettes/Octokit_Client_Stats/_commit_activity_stats/returns_the_commit_activity_stats.json +1 -0
  292. data/spec/cassettes/Octokit_Client_Stats/_contributors_stats/returns_contributors_and_their_contribution_stats.json +1 -0
  293. data/spec/cassettes/Octokit_Client_Stats/_participation_stats/returns_the_owner_and_contributor_participation_stats.json +1 -0
  294. data/spec/cassettes/Octokit_Client_Stats/_punch_card_stats/returns_commit_count_by_hour_punch_card_stats.json +1 -0
  295. data/spec/cassettes/Octokit_Client_Statuses/_create_status/creates_status.json +1 -0
  296. data/spec/cassettes/Octokit_Client_Statuses/_statuses/lists_commit_statuses.json +1 -0
  297. data/spec/cassettes/Octokit_Client_Users/_add_email/adds_an_email_address.json +1 -0
  298. data/spec/cassettes/Octokit_Client_Users/_all_users/returns_all_GitHub_users.json +1 -0
  299. data/spec/cassettes/Octokit_Client_Users/_emails/returns_email_addresses.json +1 -0
  300. data/spec/cassettes/Octokit_Client_Users/_follow/follows_a_user.json +1 -0
  301. data/spec/cassettes/Octokit_Client_Users/_followers/returns_followers_for_a_user.json +1 -0
  302. data/spec/cassettes/Octokit_Client_Users/_followers/returns_the_authenticated_user_s_followers.json +1 -0
  303. data/spec/cassettes/Octokit_Client_Users/_following/returns_following_for_a_user.json +1 -0
  304. data/spec/cassettes/Octokit_Client_Users/_following/returns_the_authenticated_user_s_following.json +1 -0
  305. data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_given_user_is_following_target_user.json +1 -0
  306. data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_the_authenticated_user_follows_another.json +1 -0
  307. data/spec/cassettes/Octokit_Client_Users/_keys/returns_public_keys_for_the_authenticated_user.json +1 -0
  308. data/spec/cassettes/Octokit_Client_Users/_remove_email/removes_an_email_address.json +1 -0
  309. data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_a_user.json +1 -0
  310. data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_the_authenticated_user.json +1 -0
  311. data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository.json +1 -0
  312. data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_a_user_watches_for_notifications.json +1 -0
  313. data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_the_authenticated_user_watches_for_notifications.json +1 -0
  314. data/spec/cassettes/Octokit_Client_Users/_unfollow/unfollows_a_user.json +1 -0
  315. data/spec/cassettes/Octokit_Client_Users/_update_user/updates_a_user_profile.json +1 -0
  316. data/spec/cassettes/Octokit_Client_Users/_user/returns_a_user.json +1 -0
  317. data/spec/cassettes/Octokit_Client_Users/_user/returns_the_authenticated_user.json +1 -0
  318. data/spec/cassettes/Octokit_Client_Users/_user_keys/returns_public_keys_for_another_user.json +1 -0
  319. data/spec/cassettes/Octokit_Client_Users/_validate_credentials/validates_username_and_password.json +1 -0
  320. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_add_key/adds_a_public_key.json +1 -0
  321. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_key/returns_a_public_key.json +1 -0
  322. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_remove_key/removes_a_public_key.json +1 -0
  323. data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_update_key/updates_a_public_key.json +1 -0
  324. data/spec/cassettes/delete_authorization.json +1 -0
  325. data/spec/cassettes/rate_limit.json +1 -0
  326. data/spec/cassettes/root.json +1 -0
  327. data/spec/fixtures/new_file.txt +1 -0
  328. data/spec/fixtures/updated_file.txt +1 -0
  329. data/spec/fixtures/user.json +29 -18
  330. data/spec/helper.rb +50 -22
  331. data/spec/octokit/client/authorizations_spec.rb +69 -80
  332. data/spec/octokit/client/commit_comments_spec.rb +62 -0
  333. data/spec/octokit/client/commits_spec.rb +93 -226
  334. data/spec/octokit/client/contents_spec.rb +81 -31
  335. data/spec/octokit/client/downloads_spec.rb +34 -38
  336. data/spec/octokit/client/emojis_spec.rb +5 -11
  337. data/spec/octokit/client/events_spec.rb +67 -51
  338. data/spec/octokit/client/gists_spec.rb +148 -142
  339. data/spec/octokit/client/gitignore_spec.rb +11 -14
  340. data/spec/octokit/client/issues_spec.rb +129 -161
  341. data/spec/octokit/client/labels_spec.rb +81 -114
  342. data/spec/octokit/client/legacy_search_spec.rb +42 -0
  343. data/spec/octokit/client/markdown_spec.rb +9 -12
  344. data/spec/octokit/client/meta_spec.rb +14 -0
  345. data/spec/octokit/client/milestones_spec.rb +40 -48
  346. data/spec/octokit/client/notifications_spec.rb +57 -113
  347. data/spec/octokit/client/objects_spec.rb +36 -74
  348. data/spec/octokit/client/organizations_spec.rb +140 -262
  349. data/spec/octokit/client/pub_sub_hubbub_spec.rb +58 -49
  350. data/spec/octokit/client/pull_requests_spec.rb +186 -0
  351. data/spec/octokit/client/rate_limit_spec.rb +44 -0
  352. data/spec/octokit/client/refs_spec.rb +47 -56
  353. data/spec/octokit/client/repositories_spec.rb +307 -425
  354. data/spec/octokit/client/say_spec.rb +8 -22
  355. data/spec/octokit/client/search_spec.rb +59 -0
  356. data/spec/octokit/client/service_status_spec.rb +37 -0
  357. data/spec/octokit/client/stats_spec.rb +105 -0
  358. data/spec/octokit/client/statuses_spec.rb +11 -51
  359. data/spec/octokit/client/users_spec.rb +147 -334
  360. data/spec/octokit/client_spec.rb +427 -190
  361. data/spec/octokit/rate_limit_spec.rb +30 -0
  362. data/spec/octokit_spec.rb +31 -15
  363. metadata +604 -371
  364. data/CHANGELOG.md +0 -133
  365. data/lib/faraday/response/raise_octokit_error.rb +0 -25
  366. data/lib/octokit/client/github.rb +0 -19
  367. data/lib/octokit/client/pub_sub_hubbub/service_hooks.rb +0 -37
  368. data/lib/octokit/configuration.rb +0 -77
  369. data/lib/octokit/connection.rb +0 -53
  370. data/lib/octokit/request.rb +0 -109
  371. data/spec/faraday/response_spec.rb +0 -63
  372. data/spec/fixtures/all_repositories.json +0 -122
  373. data/spec/fixtures/all_users.json +0 -34
  374. data/spec/fixtures/authorization.json +0 -16
  375. data/spec/fixtures/authorizations.json +0 -66
  376. data/spec/fixtures/blob.json +0 -7
  377. data/spec/fixtures/blob_create.json +0 -3
  378. data/spec/fixtures/branches.json +0 -16
  379. data/spec/fixtures/collaborators.json +0 -62
  380. data/spec/fixtures/comment.json +0 -14
  381. data/spec/fixtures/comments.json +0 -44
  382. data/spec/fixtures/commit.json +0 -50
  383. data/spec/fixtures/commit_comment.json +0 -19
  384. data/spec/fixtures/commit_comment_create.json +0 -19
  385. data/spec/fixtures/commit_comment_update.json +0 -19
  386. data/spec/fixtures/commit_comments.json +0 -78
  387. data/spec/fixtures/commit_create.json +0 -25
  388. data/spec/fixtures/commits.json +0 -1414
  389. data/spec/fixtures/compare.json +0 -98
  390. data/spec/fixtures/contents.json +0 -14
  391. data/spec/fixtures/contributors.json +0 -891
  392. data/spec/fixtures/download.json +0 -11
  393. data/spec/fixtures/download_create.json +0 -21
  394. data/spec/fixtures/downloads.json +0 -35
  395. data/spec/fixtures/emails.json +0 -4
  396. data/spec/fixtures/emojis.json +0 -500
  397. data/spec/fixtures/followers.json +0 -212
  398. data/spec/fixtures/following.json +0 -209
  399. data/spec/fixtures/forks.json +0 -872
  400. data/spec/fixtures/gist.json +0 -51
  401. data/spec/fixtures/gist_comment.json +0 -19
  402. data/spec/fixtures/gist_comment_create.json +0 -19
  403. data/spec/fixtures/gist_comment_update.json +0 -19
  404. data/spec/fixtures/gist_comments.json +0 -40
  405. data/spec/fixtures/gists.json +0 -548
  406. data/spec/fixtures/github_meta.json +0 -9
  407. data/spec/fixtures/github_status.json +0 -4
  408. data/spec/fixtures/github_status_last_message.json +0 -5
  409. data/spec/fixtures/github_status_messages.json +0 -12
  410. data/spec/fixtures/gitignore_template_ruby.json +0 -4
  411. data/spec/fixtures/gitignore_templates.json +0 -78
  412. data/spec/fixtures/hook.json +0 -18
  413. data/spec/fixtures/hooks.json +0 -70
  414. data/spec/fixtures/issue.json +0 -35
  415. data/spec/fixtures/issue_closed.json +0 -35
  416. data/spec/fixtures/issue_event.json +0 -42
  417. data/spec/fixtures/issue_events.json +0 -72
  418. data/spec/fixtures/issue_full.json +0 -38
  419. data/spec/fixtures/issues.json +0 -1562
  420. data/spec/fixtures/label.json +0 -5
  421. data/spec/fixtures/labels.json +0 -17
  422. data/spec/fixtures/languages.json +0 -5
  423. data/spec/fixtures/legacy/issues.json +0 -49
  424. data/spec/fixtures/legacy/repositories.json +0 -173
  425. data/spec/fixtures/legacy/users.json +0 -24
  426. data/spec/fixtures/list_commit_comments.json +0 -572
  427. data/spec/fixtures/markdown_gfm +0 -1
  428. data/spec/fixtures/merge.json +0 -47
  429. data/spec/fixtures/milestone.json +0 -11
  430. data/spec/fixtures/milestones.json +0 -28
  431. data/spec/fixtures/not_found.json +0 -3
  432. data/spec/fixtures/notification_thread.json +0 -32
  433. data/spec/fixtures/notifications.json +0 -32
  434. data/spec/fixtures/org_issues.json +0 -710
  435. data/spec/fixtures/organization-repositories.json +0 -4292
  436. data/spec/fixtures/organization-repository.json +0 -42
  437. data/spec/fixtures/organization.json +0 -18
  438. data/spec/fixtures/organization_events.json +0 -61
  439. data/spec/fixtures/organization_members.json +0 -576
  440. data/spec/fixtures/organization_public_events.json +0 -61
  441. data/spec/fixtures/organization_team_members.json +0 -16
  442. data/spec/fixtures/organization_team_repos.json +0 -62
  443. data/spec/fixtures/organizations.json +0 -44
  444. data/spec/fixtures/public_events.json +0 -1104
  445. data/spec/fixtures/public_gists.json +0 -968
  446. data/spec/fixtures/public_key.json +0 -5
  447. data/spec/fixtures/public_key_update.json +0 -5
  448. data/spec/fixtures/public_keys.json +0 -7
  449. data/spec/fixtures/pull_created.json +0 -138
  450. data/spec/fixtures/pull_request.json +0 -138
  451. data/spec/fixtures/pull_request_comment.json +0 -35
  452. data/spec/fixtures/pull_request_comment_create.json +0 -35
  453. data/spec/fixtures/pull_request_comment_reply.json +0 -35
  454. data/spec/fixtures/pull_request_comment_update.json +0 -35
  455. data/spec/fixtures/pull_request_comments.json +0 -35
  456. data/spec/fixtures/pull_request_commits.json +0 -45
  457. data/spec/fixtures/pull_request_files.json +0 -35
  458. data/spec/fixtures/pull_request_merged.json +0 -5
  459. data/spec/fixtures/pull_requests.json +0 -187
  460. data/spec/fixtures/pull_requests_comments.json +0 -82
  461. data/spec/fixtures/pull_update.json +0 -138
  462. data/spec/fixtures/readme.json +0 -14
  463. data/spec/fixtures/ref.json +0 -9
  464. data/spec/fixtures/ref_create.json +0 -29
  465. data/spec/fixtures/ref_update.json +0 -11
  466. data/spec/fixtures/refs.json +0 -38
  467. data/spec/fixtures/refs_tags.json +0 -29
  468. data/spec/fixtures/repo_assignees.json +0 -30
  469. data/spec/fixtures/repo_events.json +0 -1652
  470. data/spec/fixtures/repo_issues_events.json +0 -128
  471. data/spec/fixtures/repositories.json +0 -872
  472. data/spec/fixtures/repository.json +0 -34
  473. data/spec/fixtures/repository_issues_comments.json +0 -52
  474. data/spec/fixtures/repository_network_events.json +0 -155
  475. data/spec/fixtures/repository_notifications.json +0 -32
  476. data/spec/fixtures/say.txt +0 -22
  477. data/spec/fixtures/say_custom.txt +0 -22
  478. data/spec/fixtures/stargazers.json +0 -212
  479. data/spec/fixtures/starred.json +0 -1114
  480. data/spec/fixtures/starred_gists.json +0 -30
  481. data/spec/fixtures/status.json +0 -16
  482. data/spec/fixtures/statuses.json +0 -34
  483. data/spec/fixtures/subscribers.json +0 -9
  484. data/spec/fixtures/subscription.json +0 -8
  485. data/spec/fixtures/subscription_update.json +0 -8
  486. data/spec/fixtures/subscriptions.json +0 -39
  487. data/spec/fixtures/tag.json +0 -16
  488. data/spec/fixtures/tag_create.json +0 -16
  489. data/spec/fixtures/tags.json +0 -173
  490. data/spec/fixtures/team.json +0 -8
  491. data/spec/fixtures/teams.json +0 -12
  492. data/spec/fixtures/thread_subscription.json +0 -8
  493. data/spec/fixtures/thread_subscription_update.json +0 -8
  494. data/spec/fixtures/tree.json +0 -112
  495. data/spec/fixtures/tree_create.json +0 -14
  496. data/spec/fixtures/user_events.json +0 -101
  497. data/spec/fixtures/user_issues.json +0 -710
  498. data/spec/fixtures/user_performed_public_events.json +0 -78
  499. data/spec/fixtures/user_public_events.json +0 -78
  500. data/spec/fixtures/validation_failed.json +0 -11
  501. data/spec/fixtures/watched.json +0 -1022
  502. data/spec/fixtures/watchers.json +0 -182
  503. data/spec/octokit/client/github_spec.rb +0 -19
  504. data/spec/octokit/client/issue_events_spec.rb +0 -30
  505. data/spec/octokit/client/pub_sub_hubbub/service_hooks_spec.rb +0 -48
  506. data/spec/octokit/client/pulls_spec.rb +0 -210
  507. /data/spec/fixtures/{user_token.json → web_flow_token.json} +0 -0
data/CONTRIBUTING.md CHANGED
@@ -1,10 +1,13 @@
1
1
  ## Submitting a Pull Request
2
+
3
+ 0. Check out Hacking on Octokit in the README guide for
4
+ bootstrapping the project for local development.
2
5
  1. [Fork the repository.][fork]
3
6
  2. [Create a topic branch.][branch]
4
7
  3. Add specs for your unimplemented feature or bug fix.
5
- 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
8
+ 4. Run `bundle exec rspec-queue spec`. If your specs pass, return to step 3.
6
9
  5. Implement your feature or bug fix.
7
- 6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
10
+ 6. Run `bundle exec rspec-queue spec`. If your specs fail, return to step 5.
8
11
  7. Run `open coverage/index.html`. If your changes are not completely covered
9
12
  by your tests, return to step 3.
10
13
  8. Add documentation for your feature or bug fix.
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2013 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober
1
+ Copyright (c) 2009-2013 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,134 +1,426 @@
1
1
  # Octokit
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/octokit.png)][gem]
4
- [![Build Status](https://secure.travis-ci.org/pengwynn/octokit.png?branch=master)][travis]
5
- [![Dependency Status](https://gemnasium.com/pengwynn/octokit.png?travis)][gemnasium]
6
- [![Code Climate](https://codeclimate.com/github/pengwynn/octokit.png)][codeclimate]
7
- [![Coverage Status](https://coveralls.io/repos/pengwynn/octokit/badge.png?branch=master)][coveralls]
3
+ Ruby toolkit for the GitHub API.
8
4
 
9
- [gem]: https://rubygems.org/gems/octokit
10
- [travis]: http://travis-ci.org/pengwynn/octokit
11
- [gemnasium]: https://gemnasium.com/pengwynn/octokit
12
- [codeclimate]: https://codeclimate.com/github/pengwynn/octokit
13
- [coveralls]: https://coveralls.io/r/pengwynn/octokit
5
+ ![Logo][logo]
6
+ [logo]: http://cl.ly/image/3Y013H0A2z3z/gundam-ruby.png
14
7
 
15
- Simple Ruby wrapper for the GitHub v3 API.
8
+ Octokit 2.0 is out, check the [Upgrade Guide](#upgrading-guide) before
9
+ upgrading from 1.x.
10
+
11
+ ## Philosophy
12
+
13
+ API wrappers [should reflect the idioms of the language in which they were
14
+ written][wrappers]. Octokit.rb wraps the [GitHub API][github-api] in a flat API
15
+ client that follows Ruby conventions and requires little knowledge of REST.
16
+ Most methods have positional arguments for required input and an options hash
17
+ for optional parameters, headers, or other options:
18
+
19
+ ```ruby
20
+ # Fetch a README with Accept header for HTML format
21
+ Octokit.readme 'al3x/sovereign', :accept => 'application/vnd.github.html'
22
+ ```
23
+
24
+
25
+ [wrappers]: http://wynnnetherland.com/journal/what-makes-a-good-api-wrapper
26
+ [github-api]: http://developer.github.com
27
+
28
+ ## Quick start
29
+
30
+ Install via Rubygems
16
31
 
17
- ## Installation
18
32
  gem install octokit
19
33
 
20
- ## Documentation
21
- [http://rdoc.info/gems/octokit][documentation]
34
+ ... or add to your Gemfile
35
+
36
+ gem "octokit", "~> 2.0"
37
+
38
+ ### Making requests
22
39
 
23
- [documentation]: http://rdoc.info/gems/octokit
40
+ API methods are available as module methods (consuming module-level
41
+ configuration) or as client instance methods.
24
42
 
25
- ## Examples
26
- ### Show a user
27
43
  ```ruby
28
- Octokit.user("sferik")
29
- => <#Hashie::Rash blog="http://twitter.com/sferik" company="Code for America" created_at="2008/05/14 13:36:12 -0700" email="sferik@gmail.com" followers_count=177 following_count=83 gravatar_id="1f74b13f1e5c6c69cb5d7fbaabb1e2cb" id=10308 location="San Francisco" login="sferik" name="Erik Michaels-Ober" permission=nil public_gist_count=16 public_repo_count=30 type="User">
44
+ # Provide authentication credentials
45
+ Octokit.configure do |c|
46
+ c.login 'defunkt'
47
+ c.password 'c0d3b4ssssss!'
48
+ end
49
+
50
+ # Fetch the current user
51
+ Octokit.user
30
52
  ```
53
+ or
31
54
 
32
- ### Show who a user follows
33
55
  ```ruby
34
- Octokit.following("sferik")
35
- => ["rails", "puls", "wycats", "dhh", "jm3", "joshsusser", "nkallen", "technoweenie", "blaine", "al3x", "defunkt", "schacon", "bmizerany", "rtomayko", "jpr5", "lholden", "140proof", "ephramzerb", "carlhuda", "carllerche", "jnunemaker", "josh", "hoverbird", "jamiew", "jeremyevans", "brynary", "mojodna", "mojombo", "joshbuddy", "igrigorik", "perplexes", "joearasin", "hassox", "nickmarden", "pengwynn", "mmcgrana", "reddavis", "reinh", "mzsanford", "aanand", "pjhyett", "kneath", "tekkub", "adamstac", "timtrueman", "aaronblohowiak", "josevalim", "kaapa", "hurrycane", "jackdempsey", "drogus", "cameronpriest", "danmelton", "marcel", "r", "atmos", "mbleigh", "isaacs", "maxogden", "codeforamerica", "chadk", "laserlemon", "gruber", "lsegal", "bblimke", "wayneeseguin", "brixen", "dkubb", "bhb", "bcardarella", "elliottcable", "fbjork", "mlightner", "dianakimball", "amerine", "danchoi", "develop", "dmfrancisco", "unruthless", "trotter", "hannestyden", "codahale", "ry"]
56
+ # Provide authentication credentials
57
+ client = Octokit::Client.new :login => 'defunkt', :password => 'c0d3b4ssssss!'
58
+ # Fetch the current user
59
+ client.user
36
60
  ```
37
61
 
38
- ### Repositories
39
- For convenience, methods that require a repository argument may be passed in
40
- any of the following forms:
62
+ ### Consuming resources
63
+
64
+ Most methods return a `Resource` object which provides dot notation and `[]`
65
+ access for fields returned in the API response.
41
66
 
42
67
  ```ruby
43
- Octokit.repo("pengwynn/octokit")
68
+ # Fetch a user
69
+ user = Octokit.user 'jbarnette'
70
+ puts user.name
71
+ # => "John Barnette"
72
+ puts user.fields
73
+ # => <Set: {:login, :id, :gravatar_id, :type, :name, :company, :blog, :location, :email, :hireable, :bio, :public_repos, :followers, :following, :created_at, :updated_at, :public_gists}>
74
+ puts user[:company]
75
+ # => "GitHub"
76
+ user.rels[:gists].href
77
+ # => "https://api.github.com/users/jbarnette/gists"
78
+ ```
44
79
 
45
- Octokit.repo({:username => "pengwynn", :name => "octokit"})
80
+ **Note:** URL fields are culled into a separate `.rels` collection for easier
81
+ [Hypermedia](#hypermedia-agent) support.
46
82
 
47
- Octokit.repo({:username => "pengwynn", :repo => "octokit"})
83
+ ### Accessing HTTP responses
48
84
 
49
- Octokit.repo(Repository.new('pengwynn/octokit'))
85
+ While most methods return a `Resource` object or a Boolean, sometimes you may
86
+ need access to the raw HTTP response headers. You can access the last HTTP
87
+ response with `Client#last_response`:
50
88
 
51
- => <#Hashie::Rash created_at="2009/12/10 13:41:49 -0800" description="Simple Ruby wrapper for the GitHub API and feeds" fork=false forks=25 has_downloads=true has_issues=true has_wiki=true homepage="http://wynnnetherland.com/projects/octokit" integrate_branch="master" language="Ruby" name="octokit" open_issues=8 owner="pengwynn" private=false pushed_at="2011/05/05 10:48:57 -0700" size=1804 url="https://github.com/pengwynn/octokit" watchers=92>
89
+ ```ruby
90
+ user = Octokit.user 'andrewpthorp'
91
+ response = Octokit.last_response
92
+ etag = response.headers[:etag]
52
93
  ```
53
94
 
54
- ### List the commits for a repository
95
+ ## Authentication
96
+
97
+ Octokit supports the various [authentication methods supported by the GitHub
98
+ API][auth]:
99
+
100
+ ### Basic Authentication
101
+
102
+ Using your GitHub username and password is the easiest way to get started
103
+ making authenticated requests:
55
104
 
56
105
  ```ruby
57
- Octokit.commits("pengwynn/octokit")
106
+ client = Octokit::Client.new \
107
+ :login => 'defunkt',
108
+ :password => 'c0d3b4ssssss!'
109
+
110
+ user = client.user
111
+ user.login
112
+ # => "defunkt"
113
+ ```
114
+ While Basic Authentication makes it easy to get started quickly, OAuth access
115
+ tokens are the preferred way to authenticate on behalf of users.
116
+
117
+ ### OAuth access tokens
118
+
119
+ [OAuth access tokens][oauth] provide two main benefits over using your username
120
+ and password:
121
+
122
+ * **Revokable access**. Access tokens can be revoked, removing access for just
123
+ that token without having to change your password everywhere.
124
+ * **Limited access**. Access tokens have [access scopes][] which allow for more
125
+ granular access to API resources. For instance, you can grant a third party
126
+ access to your gists but not your private repositories.
58
127
 
59
- Octokit.list_commits("pengwynn/octokit")
128
+ To use an access token with the Octokit client, just pass it in lieu of your
129
+ username and password:
60
130
 
61
- => [#<Hashie::Mash author=#<Hashie::Mash avatar_url="https://secure.gravatar.com/avatar/7e19cd5486b5d6dc1ef90e671ba52ae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" gravatar_id="7e19cd5486b5d6dc1ef90e671ba52ae0" id=865 login="pengwynn" url="https://api.github.com/users/pengwynn"> commit=#<Hashie::Mash author=#<Hashie::Mash date="2012-10-31T15:17:51Z" email="wynn@github.com" name="Wynn Netherland"> comment_count=0 committer=#<Hashie::Mash date="2012-10-31T15:17:51Z" email="wynn@github.com" name="Wynn Netherland"> message="Fix bug with archive_link for private repo" tree=#<Hashie::Mash sha="49bf2a476aa819f29b0fc1a8805f7567f010006d" url="https://api.github.com/repos/pengwynn/octokit/git/trees/49bf2a476aa819f29b0fc1a8805f7567f010006d"> url="https://api.github.com/repos/pengwynn/octokit/git/commits/8db3df37fad3a021eb8036b007c718149836cb32"> committer=#<Hashie::Mash avatar_url="https://secure.gravatar.com/avatar/7e19cd5486b5d6dc1ef90e671ba52ae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" gravatar_id="7e19cd5486b5d6dc1ef90e671ba52ae0" id=865 login="pengwynn" url="https://api.github.com/users/pengwynn"> parents=[#<Hashie::Mash sha="7a67f4b47791cb77de33e491df87cef06012c79f" url="https://api.github.com/repos/pengwynn/octokit/commits/7a67f4b47791cb77de33e491df87cef06012c79f">] sha="8db3df37fad3a021eb8036b007c718149836cb32" url="https://api.github.com/repos/pengwynn/octokit/commits/8db3df37fad3a021eb8036b007c718149836cb32">, ... , ...]
131
+ ```ruby
132
+ client = Octokit::Client.new :access_token => "<your 40 char token>"
133
+
134
+ user = client.user
135
+ user.login
136
+ # => "defunkt"
62
137
  ```
63
138
 
64
- ## Authenticated Requests
65
- For methods that require authentication, you'll need to setup a client with
66
- your login and password.
139
+ You can use `.create_authorization` to create a token using Basic Authorization
140
+ that you can use for subsequent calls.
141
+
142
+ ### Using a .netrc file
143
+
144
+ Octokit supports reading credentials from a netrc file (defaulting to
145
+ `~/.netrc`). Given these lines in your netrc:
146
+
147
+ ```
148
+ machine api.github.com
149
+ login defunkt
150
+ password c0d3b4ssssss!
151
+ ```
152
+ You can now create a client with those credentials:
67
153
 
68
154
  ```ruby
69
- client = Octokit::Client.new(:login => "me", :password => "sekret")
70
- client.follow("sferik")
155
+ client = Octokit::Client.new :netrc => true
156
+ client.login
157
+ # => "defunkt"
158
+ ```
159
+ But _I want to use OAuth_ you say. Since the GitHub API supports using an OAuth
160
+ token as a Basic password, you totally can:
161
+
162
+ ```
163
+ machine api.github.com
164
+ login defunkt
165
+ password <your 40 char token>
71
166
  ```
72
167
 
73
- Alternately, you can authenticate with a [GitHub OAuth2 token][oauth].
168
+ **Note:** Support for netrc requires adding the [netrc gem][] to your Gemfile
169
+ or `.gemspec`.
74
170
 
75
- [oauth]: http://developer.github.com/v3/oauth
171
+ ### Application authentication
172
+
173
+ Octokit also supports application-only authentication [using OAuth application client
174
+ credentials][app-creds]. Using application credentials will result in making
175
+ anonymous API calls on behalf of an application in order to take advantage of
176
+ the higher rate limit.
76
177
 
77
178
  ```ruby
78
- client = Octokit::Client.new(:login => "me", :oauth_token => "oauth2token")
79
- client.follow("sferik")
179
+ client = Octokit::Client.new \
180
+ :client_id => "<your 20 char id>",
181
+ :client_secret => "<your 40 char secret>"
182
+
183
+ user = client.users 'defunkt'
80
184
  ```
81
185
 
82
- ### Using `.netrc` for stored credentials
83
186
 
84
- Octokit now supports [`.netrc`][netrc] files for storing your GitHub Basic Auth
85
- credentials. Given a `~/.netrc` like the following
86
187
 
87
- [netrc]: http://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html
188
+ [auth]: http://developer.github.com/v3/#authentication
189
+ [oauth]: http://developer.github.com/v3/oauth/
190
+ [access scopes]: http://developer.github.com/v3/oauth/#scopes
191
+ [app-creds]: http://developer.github.com/v3/#unauthenticated-rate-limited-requests
192
+
193
+
194
+ ## Configuration and defaults
195
+
196
+ While `Octokit::Client` accepts a range of options when creating a new client
197
+ instance, Octokit's configuration API allows you to set your configuration
198
+ options at the module level. This is particularly handy if you're creating a
199
+ number of client instances based on some shared defaults.
200
+
201
+ ### Configuring module defaults
202
+
203
+ Every writable attribute in {Octokit::Configurable} can be set one at a time:
88
204
 
205
+ ```ruby
206
+ Octokit.api_endpoint = 'http://api.github.dev'
207
+ Octokit.web_endpoint = 'http://github.dev'
89
208
  ```
90
- machine api.github.com login pengwynn password 0ct0c4tz4ev3r!
209
+
210
+ or in batch:
211
+
212
+ ```ruby
213
+ Octokit.configure do |c|
214
+ c.api_endpoint = 'http://api.github.dev'
215
+ c.web_endpoint = 'http://github.dev'
216
+ end
91
217
  ```
92
218
 
93
- You can make authenticated calls by telling Octokit to use credentials from
94
- this file:
219
+ ### Using ENV variables
220
+
221
+ Default configuration values are specified in {Octokit::Default}. Many
222
+ attributes will look for a default value from the ENV before returning
223
+ Octokit's default.
95
224
 
96
225
  ```ruby
97
- Octokit.netrc = true # or /path/to/file
98
- Octokit.user # authenticates as 'pengwynn' user
226
+ # Given $OCTOKIT_API_ENDPOINT is "http://api.github.dev"
227
+ Octokit.api_endpoint
228
+
229
+ # => "http://api.github.dev"
99
230
  ```
100
231
 
101
- ## Requesting a specific media type
232
+ ## Hypermedia agent
233
+
234
+ Starting in version 2.0, Octokit is [hypermedia][]-enabled. Under the hood,
235
+ {Octokit::Client} uses [Sawyer][], a hypermedia client built on [Faraday][].
102
236
 
103
- You can pass an `:accept` option value to request a particular [media
104
- type][media-types].
237
+ ### Hypermedia in Octokit
105
238
 
106
- [media-types]: http://developer.github.com/v3/media/
239
+ Resources returned by Octokit methods contain not only data but hypermedia
240
+ link relations:
107
241
 
108
242
  ```ruby
109
- Octokit.contents 'pengwynn/octokit', :path => 'README.md', :accept => 'application/vnd.github.html'
243
+ user = Octokit.user 'technoweenie'
244
+
245
+ # Get the repos rel, returned from the API
246
+ # as repos_url in the resource
247
+ user.rels[:repos].href
248
+ # => "https://api.github.com/users/technoweenie/repos"
249
+
250
+ repos = user.rels[:repos].get.data
251
+ repos.last.name
252
+ # => "faraday-zeromq"
110
253
  ```
111
254
 
112
- ## Using with GitHub Enterprise
255
+ When processing API responses, all `*_url` attributes are culled in to the link
256
+ relations collection. Any `url` attribute becomes `.rels[:self]`.
113
257
 
114
- To use with [GitHub Enterprise](https://enterprise.github.com/), you'll need to
115
- set the API and web endpoints before instantiating a client.
258
+ ### URI templates
259
+
260
+ You might notice many link relations have variable placeholders. Octokit
261
+ supports [URI Templates][uri-templates] for parameterized URI expansion:
116
262
 
117
263
  ```ruby
118
- Octokit.configure do |c|
119
- c.api_endpoint = 'https://github.company.com/api/v3'
120
- c.web_endpoint = 'https://github.company.com/'
264
+ repo = Octokit.repo 'pengwynn/pingwynn'
265
+ rel = repo.rels[:issues]
266
+ # => #<Sawyer::Relation: issues: get https://api.github.com/repos/pengwynn/pingwynn/issues{/number}>
267
+
268
+ # Get a page of issues
269
+ repo.rels[:issues].get.data
270
+
271
+ # Get issue #2
272
+ repo.rels[:issues].get(:uri => {:number => 2}).data
273
+ ```
274
+
275
+ ### The Full Hypermedia Experience™
276
+
277
+ If you want to use Octokit as a pure hypermedia API client, you can start at
278
+ the API root and and follow link relations from there:
279
+
280
+ ```ruby
281
+ root = Octokit.root
282
+ root.rels[:repository].get :uri => {:owner => "octokit", :repo => "octokit.rb" }
283
+ ```
284
+
285
+ Octokit 3.0 aims to be hypermedia-driven, removing the internal URL
286
+ construction currently used throughout the client.
287
+
288
+ [hypermedia]: http://en.wikipedia.org/wiki/Hypermedia
289
+ [Sawyer]: https://github.com/lostisland/sawyer
290
+ [Faraday]: https://github.com/lostisland/faraday
291
+ [uri-templates]: http://tools.ietf.org/html/rfc6570
292
+
293
+ ## Upgrading guide
294
+
295
+ Version 2.0 includes a completely rewritten `Client` factory that now memoizes
296
+ client instances based on unique configuration options. Breaking changes also
297
+ include:
298
+
299
+ * `:oauth_token` is now `:access_token`
300
+ * `Hashie::Mash` has been removed. Responses now return a `Sawyer::Resource`
301
+ object. This new type behaves mostly like a Ruby `Hash`, but does not fully
302
+ support the `Hashie::Mash` API.
303
+ * Two new client error types are raised where appropriate:
304
+ `Octokit::TooManyRequests` and `Octokit::TooManyLoginAttempts`
305
+ * The `search_*` methods from v1.x are now found at `legacy_search_*`
306
+ * Support for netrc requires including the [netrc gem][] in your Gemfile or
307
+ gemspec.
308
+
309
+ [netrc gem]: https://rubygems.org/gems/netrc
310
+
311
+
312
+ ## Advanced usage
313
+
314
+ Since Octokit employs [Faraday][faraday] under the hood, some behavior can be
315
+ extended via middleware.
316
+
317
+ ### Debugging
318
+
319
+ Often, it helps to know what Octokit is doing under the hood. Faraday makes it
320
+ easy to peek into the underlying HTTP traffic:
321
+
322
+ ```ruby
323
+ stack = Faraday::Builder.new do |builder|
324
+ builder.response :logger
325
+ builder.use Octokit::Response::RaiseError
326
+ builder.adapter Faraday.default_adapter
121
327
  end
328
+ Octokit.middleware = stack
329
+ Octokit.user 'pengwynn'
330
+ ```
331
+ ```
332
+ I, [2013-08-22T15:54:38.583300 #88227] INFO -- : get https://api.github.com/users/pengwynn
333
+ D, [2013-08-22T15:54:38.583401 #88227] DEBUG -- request: Accept: "application/vnd.github.beta+json"
334
+ User-Agent: "Octokit Ruby Gem 2.0.0.rc4"
335
+ I, [2013-08-22T15:54:38.843313 #88227] INFO -- Status: 200
336
+ D, [2013-08-22T15:54:38.843459 #88227] DEBUG -- response: server: "GitHub.com"
337
+ date: "Thu, 22 Aug 2013 20:54:40 GMT"
338
+ content-type: "application/json; charset=utf-8"
339
+ transfer-encoding: "chunked"
340
+ connection: "close"
341
+ status: "200 OK"
342
+ x-ratelimit-limit: "60"
343
+ x-ratelimit-remaining: "39"
344
+ x-ratelimit-reset: "1377205443"
345
+ ...
346
+ ```
347
+
348
+ See the [Faraday README][faraday] for more middleware magic.
349
+
350
+ ### Caching
351
+
352
+ If you want to boost performance, stretch your API rate limit, or avoid paying
353
+ the hypermedia tax, you can use [Faraday Http Cache][cache].
354
+
355
+ Add the gem to your Gemfile
356
+
357
+ gem 'faraday-http-cache'
122
358
 
123
- @client = Octokit::Client.new(:login => 'USERNAME', :password => 'PASSWORD')
359
+ Next, construct your own Faraday middleware:
360
+
361
+ ```ruby
362
+ stack = Faraday::Builder.new do |builder|
363
+ builder.use Faraday::HttpCache
364
+ builder.use Octokit::Response::RaiseError
365
+ builder.adapter Faraday.default_adapter
366
+ end
367
+ Octokit.middleware = stack
124
368
  ```
125
369
 
370
+ Once configured, the middleware will store responses in cache based on ETag
371
+ fingerprint and serve those back up for future `304` responses for the same
372
+ resource. See the [project README][cache] for advanced usage.
373
+
374
+
375
+ [cache]: https://github.com/plataformatec/faraday-http-cache
376
+ [faraday]: https://github.com/lostisland/faraday
377
+
378
+ ## Hacking on Octokit.rb
379
+
380
+ If you want to hack on Octokit locally, we try to make [bootstrapping the
381
+ project][bootstrapping] as painless as possible. Just clone and run:
382
+
383
+ script/bootstrap
384
+
385
+ This will install project dependencies and get you up and running. If you want
386
+ to run a Ruby console to poke on Octokit, you can crank one up with:
387
+
388
+ script/console
389
+
390
+ Using the scripts in `./scripts` instead of `bundle exec rspec`, `bundle
391
+ console`, etc. ensures your dependencies are up-to-date.
392
+
393
+ ### Running and writing new tests
394
+
395
+ Octokit uses [VCR][] for recording and playing back API fixtures during test
396
+ runs. These fixtures are part of the Git project in the `spec/cassettes`
397
+ folder. For the most part, tests use an authenticated client, using a token
398
+ stored in `ENV['OCTOKIT_TEST_GITHUB_TOKEN']`. If you're not recording new
399
+ cassettes, you don't need to have this set. If you do need to record new
400
+ cassettes, this token can be any GitHub API token because the test suite strips
401
+ the actual token from the cassette output before storing to disk.
402
+
403
+ Since we periodically refresh our cassettes, please keep some points in mind
404
+ when writing new specs.
405
+
406
+ * **Specs should be idempotent**. The HTTP calls made during a spec should be
407
+ able to be run over and over. This means deleting a known resource prior to
408
+ creating it if the name has to be unique.
409
+ * **Specs should be able to be run in random order.** If a spec depends on
410
+ another resource as a fixture, make sure that's created in the scope of the
411
+ spec and not depend on a previous spec to create the data needed.
412
+ * **Do not depend on authenticated user info.** Instead of asserting
413
+ actual values in resources, try to assert the existence of a key or that a
414
+ response is an Array. We're testing the client, not the API.
415
+
416
+ [bootstrapping]: http://wynnnetherland.com/linked/2013012801/bootstrapping-consistency
417
+ [VCR]: https://github.com/vcr/vcr
418
+
126
419
  ## Supported Ruby Versions
127
420
 
128
421
  This library aims to support and is [tested against][travis] the following Ruby
129
422
  implementations:
130
423
 
131
- * Ruby 1.8.7
132
424
  * Ruby 1.9.2
133
425
  * Ruby 1.9.3
134
426
  * Ruby 2.0.0
@@ -146,6 +438,8 @@ implementation, you will be responsible for providing patches in a timely
146
438
  fashion. If critical issues for a particular implementation exist at the time
147
439
  of a major release, support for that Ruby version may be dropped.
148
440
 
441
+ [travis]: https://travis-ci.org/octokit/octokit.rb
442
+
149
443
  ## Versioning
150
444
 
151
445
  This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
@@ -157,38 +451,11 @@ introduced with new major versions. As a result of this policy, you can (and
157
451
  should) specify a dependency on this gem using the [Pessimistic Version
158
452
  Constraint][pvc] with two digits of precision. For example:
159
453
 
160
- spec.add_dependency 'octokit', '~> 1.0'
454
+ spec.add_dependency 'octokit', '~> 2.0'
161
455
 
162
456
  [semver]: http://semver.org/
163
457
  [pvc]: http://docs.rubygems.org/read/chapter/16#page74
164
458
 
165
- ### JSON dependency
166
-
167
- Since JSON is included in 1.9 now, we no longer include it as a hard
168
- dependency. Please require it explicitly if you're running Ruby 1.8
169
-
170
- gem 'json', '~> 1.7'
171
-
172
- ## Contributors
173
-
174
- Octokit was initially created by Wynn Netherland and [Adam
175
- Stacoviak](http://twitter.com/adamstac) but has
176
- turned into a true community effort. Special thanks to the following core
177
- contributors:
178
-
179
- * [Erik Michaels-Ober](http://github.com/sferik)
180
- * [Clint Shryock](http://github.com/ctshryock)
181
- * [Joey Wendt](http://github.com/joeyw)
182
-
183
-
184
- ## Inspiration
185
- Octokit was inspired by [Octopi][] and aims to be a lightweight,
186
- less-ActiveResourcey alternative.
187
-
188
- [octopi]: https://github.com/fcoury/octopi
189
-
190
- ## Copyright
191
- Copyright (c) 2011-2013 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober.
192
- See [LICENSE][] for details.
459
+ ## License
193
460
 
194
- [license]: LICENSE.md
461
+ {include:file:LICENSE.md}
data/Rakefile CHANGED
@@ -8,12 +8,15 @@ task :test => :spec
8
8
  task :default => :spec
9
9
 
10
10
  namespace :doc do
11
- require 'yard'
12
- YARD::Rake::YardocTask.new do |task|
13
- task.files = ['README.md', 'LICENSE.md', 'lib/**/*.rb']
14
- task.options = [
15
- '--output-dir', 'doc/yard',
16
- '--markup', 'markdown',
17
- ]
11
+ begin
12
+ require 'yard'
13
+ YARD::Rake::YardocTask.new do |task|
14
+ task.files = ['README.md', 'LICENSE.md', 'lib/**/*.rb']
15
+ task.options = [
16
+ '--output-dir', 'doc/yard',
17
+ '--markup', 'markdown',
18
+ ]
19
+ end
20
+ rescue LoadError
18
21
  end
19
22
  end
@@ -0,0 +1,14 @@
1
+ module Octokit
2
+
3
+ # Extracts options from method arguments
4
+ # @private
5
+ class Arguments < Array
6
+ attr_reader :options
7
+
8
+ def initialize(args)
9
+ @options = args.last.is_a?(::Hash) ? args.pop : {}
10
+ super(args)
11
+ end
12
+
13
+ end
14
+ end