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.
- data/Rakefile +10 -7
- data/lib/octokit.rb +22 -15
- data/lib/octokit/arguments.rb +14 -0
- data/lib/octokit/authentication.rb +48 -25
- data/lib/octokit/client.rb +245 -44
- data/lib/octokit/client/authorizations.rb +36 -10
- data/lib/octokit/client/commit_comments.rb +96 -0
- data/lib/octokit/client/commits.rb +152 -94
- data/lib/octokit/client/contents.rb +32 -24
- data/lib/octokit/client/downloads.rb +11 -7
- data/lib/octokit/client/emojis.rb +3 -1
- data/lib/octokit/client/events.rb +62 -18
- data/lib/octokit/client/gists.rb +27 -26
- data/lib/octokit/client/gitignore.rb +7 -3
- data/lib/octokit/client/issues.rb +43 -71
- data/lib/octokit/client/labels.rb +24 -20
- data/lib/octokit/client/legacy_search.rb +78 -0
- data/lib/octokit/client/markdown.rb +6 -1
- data/lib/octokit/client/meta.rb +21 -0
- data/lib/octokit/client/milestones.rb +13 -9
- data/lib/octokit/client/notifications.rb +24 -64
- data/lib/octokit/client/objects.rb +17 -12
- data/lib/octokit/client/organizations.rb +43 -52
- data/lib/octokit/client/pub_sub_hubbub.rb +68 -8
- data/lib/octokit/client/{pulls.rb → pull_requests.rb} +65 -41
- data/lib/octokit/client/rate_limit.rb +42 -8
- data/lib/octokit/client/refs.rb +16 -10
- data/lib/octokit/client/repositories.rb +73 -124
- data/lib/octokit/client/say.rb +7 -1
- data/lib/octokit/client/service_status.rb +39 -0
- data/lib/octokit/client/stats.rb +12 -6
- data/lib/octokit/client/statuses.rb +8 -29
- data/lib/octokit/client/users.rb +56 -75
- data/lib/octokit/configurable.rb +117 -0
- data/lib/octokit/default.rb +140 -0
- data/lib/octokit/error.rb +6 -5
- data/lib/octokit/gist.rb +11 -0
- data/lib/octokit/rate_limit.rb +22 -0
- data/lib/octokit/repo_arguments.rb +19 -0
- data/lib/octokit/repository.rb +11 -4
- data/lib/octokit/response/raise_error.rb +35 -0
- data/lib/octokit/version.rb +5 -1
- data/octokit.gemspec +4 -9
- data/spec/cassettes/Octokit_Client/_get/handles_query_params.json +1 -0
- data/spec/cassettes/Octokit_Client/_head/handles_query_params.json +1 -0
- data/spec/cassettes/Octokit_Client/_last_response/caches_the_last_agent_response.json +1 -0
- data/spec/cassettes/Octokit_Client/authentication/when_token_authenticated/fetches_and_memoizes_login.json +1 -0
- data/spec/cassettes/Octokit_Client/auto_pagination/fetches_all_the_pages.json +1 -0
- data/spec/cassettes/Octokit_Client/error_handling/raises_on_404.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_authorization/returns_a_single_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_authorizations/lists_existing_authorizations.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_a_new_authorization_with_options.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_an_API_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_a_one-off_token.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_the_current_token.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_update_authorization/updates_and_existing_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comment/returns_a_single_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comments/returns_a_list_of_comments_for_a_specific_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_create_commit_comment/creates_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_delete_commit_comment/deletes_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_list_commit_comments/returns_a_list_of_all_commit_comments.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_update_commit_comment/updates_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commit/returns_a_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/returns_all_commits.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/returns_all_commits_until_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/returns_all_commits_until_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/returns_all_commits_on_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/returns_all_commits_since_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_compare/returns_a_comparison.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_create_commit/creates_a_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_merge/merges_a_branch_into_another.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_archive_link/returns_the_headers_of_the_request.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_contents/returns_the_contents_of_a_file.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_File_object.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_file_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_delete_contents/deletes_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_readme/returns_the_default_readme.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_update_contents/updates_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/_download/gets_a_single_download.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/_downloads/lists_available_downloads.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/creates_a_download_resource.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/posts_to_an_S3_url.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_delete_download/deletes_a_download.json +1 -0
- data/spec/cassettes/Octokit_Client_Emojis/_emojis/returns_all_github_emojis.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_issue_event/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_issue_events/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_organization_events/returns_all_events_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_organization_public_events/returns_an_organization_s_public_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_public_events/returns_all_public_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_received_events/returns_all_user_received_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_received_public_events/returns_public_user_received_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repo_issue_events/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repository_events/returns_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repository_network_events/returns_events_for_a_repository_s_network.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_user_events/returns_all_user_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_user_public_events/returns_public_events_performed_by_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gist/returns_the_gist_by_ID.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/with_username_passed/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/without_a_username_passed/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_public_gists/returns_public_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist/creates_a_new_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist_comment/creates_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist/deletes_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist_comment/deletes_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_edit_gist/edit_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_fork_gist/forks_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comment/returns_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comments/returns_the_list_of_gist_comments.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_not_starred.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_starred.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gists/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_star_gist/stars_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_starred_gists/returns_the_user_s_starred_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_unstar_gist/unstars_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_update_gist_comment/updates_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_template/returns_the_ruby_gitignore_template.json +1 -0
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_templates/returns_all_gitignore_templates.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_delimited_labels.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_labels_array.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_issue_comment/returns_a_single_comment_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_issue_comments/returns_comments_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_dashboard_issues_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_issues_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_org_issues/returns_issues_for_the_organization_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_repository_issues_comments/returns_comments_for_all_issues_in_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_user_issues/returns_issues_for_the_authenticated_user_for_owned_and_member_repos.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_add_comment/adds_a_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_close_issue/closes_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_a_full_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_reopen_issue/reopens_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_update_issue/updates_an_issue.json +1 -0
- 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
- 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
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_a_color.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_default_color.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_delete_label_/deletes_a_label_from_the_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_label/returns_a_single_label.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_labels/returns_labels.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_lables_for_milestone/returns_all_labels_for_a_repository.json +1 -0
- 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
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_labels_for_issue/returns_all_labels_for_a_given_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_all_labels/removes_all_labels_from_the_specified_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_label/removes_a_label_from_the_specified_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_replace_all_labels/replaces_all_labels_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_label/_update_label/updates_a_label_with_a_new_color.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_issues/returns_matching_issues.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_repos/returns_matching_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_users/returns_matching_username.json +1 -0
- data/spec/cassettes/Octokit_Client_Markdown/_markdown/renders_markdown.json +1 -0
- data/spec/cassettes/Octokit_Client_Meta/_github_meta/returns_meta_information_about_github.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/_list_milestones/lists_milestones_belonging_to_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_create_milestone/creates_a_milestone.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_delete_milestone/deletes_a_milestone_from_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_milestone/gets_a_single_milestone_belonging_to_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_update_milestone/updates_a_milestone.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_mark_notifications_as_read/returns_true_when_notifications_are_marked_as_read.json +1 -0
- 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
- data/spec/cassettes/Octokit_Client_Notifications/_notifications/lists_the_notifications_for_the_current_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_repository_notifications/lists_all_notifications_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_delete_thread_subscription/returns_true_with_successful_thread_deletion.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_mark_thread_as_read/marks_a_thread_as_read.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_notifications/returns_notifications_for_a_specific_thread.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_subscription/returns_a_thread_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_update_thread_subscription/updates_a_thread_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_blob/returns_a_blob.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_blob/creates_a_blob.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_tag/creates_a_tag.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_tree/creates_a_tree.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tag/returns_a_tag.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree_recursively.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization/returns_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_member_/checks_organization_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_members/returns_all_public_members_of_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_public_member_/checks_publicized_org_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_repositories/returns_all_public_repositories_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_teams/returns_all_teams_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_update_organization/updates_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_member/adds_a_team_member.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_repository/adds_a_team_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_create_team/creates_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_delete_team/deletes_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_publicize_membership/publicizes_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_member/removes_a_team_member.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_repository/removes_a_team_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team/returns_a_team.json +1 -0
- 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
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_members/returns_team_members.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_repositories/returns_team_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_unpublicize_membership/unpublicizes_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_update_team/updates_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/raises_an_error_when_topic_is_not_recognized.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/subscribes_to_pull_events.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe_service_hook/subscribes_to_pull_events_on_specified_topic.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_unsubscribe/unsubscribes_from_pull_events.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/unsubscribe_service_hook/unsubscribes_to_stop_receiving_events_on_specified_topic.json +1 -0
- 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
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comment/returns_a_comment_on_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comments/returns_the_comments_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_commits/returns_the_commits_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_files/lists_files_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests/returns_all_pull_requests.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests_comments/returns_all_comments_on_all_pull_requests.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_close_pull_request/closes_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_create_pull_request/creates_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_merge_pull_request/merges_the_pull_request.json +1 -0
- 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
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_request/returns_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json +1 -0
- 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
- 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
- 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
- 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
- data/spec/cassettes/Octokit_Client_Refs/_ref/returns_a_tags_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_refs.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_tag_refs.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_create_ref/creates_a_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_delete_ref/deletes_an_existing_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_update_ref/updates_a_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_all_repositories/returns_all_repositories_on_github.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_assignees/lists_all_the_available_assignees_owner_collaborators_.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_repository_s_branches.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_single_branch.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_check_assignee/checks_to_see_if_a_particular_user_is_an_assignee_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_collaborators/returns_a_repository_s_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors_excluding_anonymous.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_create_repository/creates_a_repository_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_delete_subscription/returns_true_when_repo_subscription_deleted.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_fork/forks_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_languages/returns_a_repository_s_languages.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_network/returns_a_repository_s_network.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_a_user_s_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_authenticated_user_s_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository/returns_the_matching_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_false_if_the_repository_doesn_t_exist.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_true_if_the_repository_exists.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_star/stars_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_stargazers/returns_all_repository_stargazers.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_subscribers/lists_all_the_users_watching_the_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_subscription/returns_a_repository_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_tags/returns_a_repository_s_tags.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_unstar/unstars_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_unwatch/unwatches_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_update_subscription/updates_a_repository_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_watch/watches_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_watchers/returns_all_repository_watchers.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_add_collaborator/adds_a_repository_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_create_repository/creates_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_delete_repository/deletes_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_deploy_keys/returns_a_repository_s_deploy_keys.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_hooks/returns_a_repository_s_hooks.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_remove_collaborator/removes_a_repository_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_repository_teams/returns_all_repository_teams.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_update_repository/updates_the_matching_repository.json +1 -0
- 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
- 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
- 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
- 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
- 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
- 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
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat.json +1 -0
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat_with_custom_text.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_code_frequency_stats/returns_the_code_frequency_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_commit_activity_stats/returns_the_commit_activity_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_contributors_stats/returns_contributors_and_their_contribution_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_participation_stats/returns_the_owner_and_contributor_participation_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_punch_card_stats/returns_commit_count_by_hour_punch_card_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Statuses/_create_status/creates_status.json +1 -0
- data/spec/cassettes/Octokit_Client_Statuses/_statuses/lists_commit_statuses.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_add_email/adds_an_email_address.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_all_users/returns_all_GitHub_users.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_emails/returns_email_addresses.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_follow/follows_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_followers_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_the_authenticated_user_s_followers.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_following/returns_following_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_following/returns_the_authenticated_user_s_following.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_the_authenticated_user_follows_another.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_keys/returns_public_keys_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_remove_email/removes_an_email_address.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_a_user_watches_for_notifications.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_the_authenticated_user_watches_for_notifications.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_unfollow/unfollows_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_update_user/updates_a_user_profile.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user/returns_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user/returns_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user_keys/returns_public_keys_for_another_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_validate_credentials/validates_username_and_password.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_add_key/adds_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_key/returns_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_remove_key/removes_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_update_key/updates_a_public_key.json +1 -0
- data/spec/cassettes/delete_authorization.json +1 -0
- data/spec/cassettes/rate_limit.json +1 -0
- data/spec/cassettes/root.json +1 -0
- data/spec/fixtures/user.json +29 -18
- data/spec/fixtures/{user_token.json → web_flow_token.json} +0 -0
- data/spec/helper.rb +49 -22
- data/spec/octokit/client/authorizations_spec.rb +69 -80
- data/spec/octokit/client/commit_comments_spec.rb +62 -0
- data/spec/octokit/client/commits_spec.rb +93 -226
- data/spec/octokit/client/contents_spec.rb +64 -119
- data/spec/octokit/client/downloads_spec.rb +34 -38
- data/spec/octokit/client/emojis_spec.rb +5 -11
- data/spec/octokit/client/events_spec.rb +67 -51
- data/spec/octokit/client/gists_spec.rb +148 -142
- data/spec/octokit/client/gitignore_spec.rb +11 -14
- data/spec/octokit/client/issues_spec.rb +129 -161
- data/spec/octokit/client/labels_spec.rb +81 -114
- data/spec/octokit/client/legacy_search_spec.rb +42 -0
- data/spec/octokit/client/markdown_spec.rb +9 -12
- data/spec/octokit/client/meta_spec.rb +14 -0
- data/spec/octokit/client/milestones_spec.rb +40 -48
- data/spec/octokit/client/notifications_spec.rb +57 -113
- data/spec/octokit/client/objects_spec.rb +36 -74
- data/spec/octokit/client/organizations_spec.rb +140 -262
- data/spec/octokit/client/pub_sub_hubbub_spec.rb +58 -49
- data/spec/octokit/client/pull_requests_spec.rb +186 -0
- data/spec/octokit/client/rate_limit_spec.rb +40 -0
- data/spec/octokit/client/refs_spec.rb +47 -56
- data/spec/octokit/client/repositories_spec.rb +301 -438
- data/spec/octokit/client/say_spec.rb +8 -22
- data/spec/octokit/client/service_status_spec.rb +37 -0
- data/spec/octokit/client/stats_spec.rb +82 -32
- data/spec/octokit/client/statuses_spec.rb +11 -51
- data/spec/octokit/client/users_spec.rb +144 -348
- data/spec/octokit/client_spec.rb +345 -195
- data/spec/octokit/rate_limit_spec.rb +25 -0
- data/spec/octokit_spec.rb +31 -15
- metadata +585 -387
- data/lib/faraday/response/raise_octokit_error.rb +0 -25
- data/lib/octokit/client/github.rb +0 -19
- data/lib/octokit/client/pub_sub_hubbub/service_hooks.rb +0 -37
- data/lib/octokit/configuration.rb +0 -77
- data/lib/octokit/connection.rb +0 -53
- data/lib/octokit/request.rb +0 -110
- data/spec/faraday/response_spec.rb +0 -63
- data/spec/fixtures/all_repositories.json +0 -122
- data/spec/fixtures/all_users.json +0 -34
- data/spec/fixtures/authorization.json +0 -16
- data/spec/fixtures/authorizations.json +0 -66
- data/spec/fixtures/blob.json +0 -7
- data/spec/fixtures/blob_create.json +0 -3
- data/spec/fixtures/branches.json +0 -16
- data/spec/fixtures/code_frequency_stats.json +0 -897
- data/spec/fixtures/collaborators.json +0 -62
- data/spec/fixtures/comment.json +0 -14
- data/spec/fixtures/comments.json +0 -44
- data/spec/fixtures/commit.json +0 -50
- data/spec/fixtures/commit_activity_stats.json +0 -678
- data/spec/fixtures/commit_comment.json +0 -19
- data/spec/fixtures/commit_comment_create.json +0 -19
- data/spec/fixtures/commit_comment_update.json +0 -19
- data/spec/fixtures/commit_comments.json +0 -78
- data/spec/fixtures/commit_create.json +0 -25
- data/spec/fixtures/commits.json +0 -1414
- data/spec/fixtures/compare.json +0 -98
- data/spec/fixtures/contents.json +0 -14
- data/spec/fixtures/contributor_stats.json +0 -2196
- data/spec/fixtures/contributors.json +0 -891
- data/spec/fixtures/create_content.json +0 -44
- data/spec/fixtures/delete_content.json +0 -30
- data/spec/fixtures/download.json +0 -11
- data/spec/fixtures/download_create.json +0 -21
- data/spec/fixtures/downloads.json +0 -35
- data/spec/fixtures/emails.json +0 -4
- data/spec/fixtures/emojis.json +0 -500
- data/spec/fixtures/followers.json +0 -212
- data/spec/fixtures/following.json +0 -209
- data/spec/fixtures/forks.json +0 -872
- data/spec/fixtures/gist.json +0 -51
- data/spec/fixtures/gist_comment.json +0 -19
- data/spec/fixtures/gist_comment_create.json +0 -19
- data/spec/fixtures/gist_comment_update.json +0 -19
- data/spec/fixtures/gist_comments.json +0 -40
- data/spec/fixtures/gists.json +0 -548
- data/spec/fixtures/github_meta.json +0 -9
- data/spec/fixtures/github_status.json +0 -4
- data/spec/fixtures/github_status_last_message.json +0 -5
- data/spec/fixtures/github_status_messages.json +0 -12
- data/spec/fixtures/gitignore_template_ruby.json +0 -4
- data/spec/fixtures/gitignore_templates.json +0 -78
- data/spec/fixtures/hook.json +0 -18
- data/spec/fixtures/hooks.json +0 -70
- data/spec/fixtures/issue.json +0 -35
- data/spec/fixtures/issue_closed.json +0 -35
- data/spec/fixtures/issue_event.json +0 -42
- data/spec/fixtures/issue_events.json +0 -72
- data/spec/fixtures/issue_full.json +0 -38
- data/spec/fixtures/issues.json +0 -1562
- data/spec/fixtures/label.json +0 -5
- data/spec/fixtures/labels.json +0 -17
- data/spec/fixtures/languages.json +0 -5
- data/spec/fixtures/legacy/issues.json +0 -49
- data/spec/fixtures/legacy/repositories.json +0 -173
- data/spec/fixtures/legacy/users.json +0 -24
- data/spec/fixtures/list_commit_comments.json +0 -572
- data/spec/fixtures/markdown_gfm +0 -1
- data/spec/fixtures/merge.json +0 -47
- data/spec/fixtures/milestone.json +0 -11
- data/spec/fixtures/milestones.json +0 -28
- data/spec/fixtures/not_found.json +0 -3
- data/spec/fixtures/notification_thread.json +0 -32
- data/spec/fixtures/notifications.json +0 -32
- data/spec/fixtures/org_issues.json +0 -710
- data/spec/fixtures/organization-repositories.json +0 -4292
- data/spec/fixtures/organization-repository.json +0 -42
- data/spec/fixtures/organization.json +0 -18
- data/spec/fixtures/organization_events.json +0 -61
- data/spec/fixtures/organization_members.json +0 -576
- data/spec/fixtures/organization_public_events.json +0 -61
- data/spec/fixtures/organization_team_members.json +0 -16
- data/spec/fixtures/organization_team_repos.json +0 -62
- data/spec/fixtures/organizations.json +0 -44
- data/spec/fixtures/participation_stats.json +0 -110
- data/spec/fixtures/public_events.json +0 -1104
- data/spec/fixtures/public_gists.json +0 -968
- data/spec/fixtures/public_key.json +0 -5
- data/spec/fixtures/public_key_update.json +0 -5
- data/spec/fixtures/public_keys.json +0 -7
- data/spec/fixtures/pull_created.json +0 -138
- data/spec/fixtures/pull_request.json +0 -138
- data/spec/fixtures/pull_request_comment.json +0 -35
- data/spec/fixtures/pull_request_comment_create.json +0 -35
- data/spec/fixtures/pull_request_comment_reply.json +0 -35
- data/spec/fixtures/pull_request_comment_update.json +0 -35
- data/spec/fixtures/pull_request_comments.json +0 -35
- data/spec/fixtures/pull_request_commits.json +0 -45
- data/spec/fixtures/pull_request_files.json +0 -35
- data/spec/fixtures/pull_request_merged.json +0 -5
- data/spec/fixtures/pull_requests.json +0 -187
- data/spec/fixtures/pull_requests_comments.json +0 -82
- data/spec/fixtures/pull_update.json +0 -138
- data/spec/fixtures/punch_card_stats.json +0 -842
- data/spec/fixtures/readme.json +0 -14
- data/spec/fixtures/ref.json +0 -9
- data/spec/fixtures/ref_create.json +0 -29
- data/spec/fixtures/ref_update.json +0 -11
- data/spec/fixtures/refs.json +0 -38
- data/spec/fixtures/refs_tags.json +0 -29
- data/spec/fixtures/repo_assignees.json +0 -30
- data/spec/fixtures/repo_events.json +0 -1652
- data/spec/fixtures/repo_issues_events.json +0 -128
- data/spec/fixtures/repositories.json +0 -872
- data/spec/fixtures/repository.json +0 -34
- data/spec/fixtures/repository_issues_comments.json +0 -52
- data/spec/fixtures/repository_network_events.json +0 -155
- data/spec/fixtures/repository_notifications.json +0 -32
- data/spec/fixtures/say.txt +0 -22
- data/spec/fixtures/say_custom.txt +0 -22
- data/spec/fixtures/stargazers.json +0 -212
- data/spec/fixtures/starred.json +0 -1114
- data/spec/fixtures/starred_gists.json +0 -30
- data/spec/fixtures/status.json +0 -16
- data/spec/fixtures/statuses.json +0 -34
- data/spec/fixtures/subscribers.json +0 -9
- data/spec/fixtures/subscription.json +0 -8
- data/spec/fixtures/subscription_update.json +0 -8
- data/spec/fixtures/subscriptions.json +0 -39
- data/spec/fixtures/tag.json +0 -16
- data/spec/fixtures/tag_create.json +0 -16
- data/spec/fixtures/tags.json +0 -173
- data/spec/fixtures/team.json +0 -8
- data/spec/fixtures/teams.json +0 -12
- data/spec/fixtures/thread_subscription.json +0 -8
- data/spec/fixtures/thread_subscription_update.json +0 -8
- data/spec/fixtures/tree.json +0 -112
- data/spec/fixtures/tree_create.json +0 -14
- data/spec/fixtures/update_content.json +0 -44
- data/spec/fixtures/user_events.json +0 -101
- data/spec/fixtures/user_issues.json +0 -710
- data/spec/fixtures/user_performed_public_events.json +0 -78
- data/spec/fixtures/user_public_events.json +0 -78
- data/spec/fixtures/validation_failed.json +0 -11
- data/spec/fixtures/watched.json +0 -1022
- data/spec/fixtures/watchers.json +0 -182
- data/spec/octokit/client/github_spec.rb +0 -19
- data/spec/octokit/client/issue_events_spec.rb +0 -30
- data/spec/octokit/client/pub_sub_hubbub/service_hooks_spec.rb +0 -48
- data/spec/octokit/client/pulls_spec.rb +0 -210
@@ -1,17 +1,22 @@
|
|
1
1
|
module Octokit
|
2
2
|
class Client
|
3
|
-
|
3
|
+
|
4
|
+
# Methods for the Pull Requests API
|
5
|
+
#
|
6
|
+
# @see http://developer.github.com/v3/pulls/
|
7
|
+
module PullRequests
|
4
8
|
# List pull requests for a repository
|
5
9
|
#
|
6
10
|
# @see http://developer.github.com/v3/pulls/#list-pull-requests
|
7
11
|
# @param repo [String, Hash, Repository] A GitHub repository
|
8
12
|
# @param options [Hash] Method options
|
9
13
|
# @option options [String] :state `open` or `closed`. Default is `open`.
|
10
|
-
# @return [Array<
|
14
|
+
# @return [Array<Sawyer::Resource>] Array of pulls
|
11
15
|
# @example
|
12
16
|
# Octokit.pull_requests('rails/rails')
|
13
|
-
def pull_requests(repo, state=
|
14
|
-
|
17
|
+
def pull_requests(repo, state = nil, options={})
|
18
|
+
options[:state] = state if state
|
19
|
+
get "repos/#{Repository.new(repo)}/pulls", options
|
15
20
|
end
|
16
21
|
alias :pulls :pull_requests
|
17
22
|
|
@@ -20,9 +25,9 @@ module Octokit
|
|
20
25
|
# @see http://developer.github.com/v3/pulls/#get-a-single-pull-request
|
21
26
|
# @param repo [String, Hash, Repository] A GitHub repository
|
22
27
|
# @param number [Integer] Number of the pull request to fetch
|
23
|
-
# @return [
|
28
|
+
# @return [Sawyer::Resource] Pull request info
|
24
29
|
def pull_request(repo, number, options={})
|
25
|
-
get
|
30
|
+
get "repos/#{Repository.new(repo)}/pulls/#{number}", options
|
26
31
|
end
|
27
32
|
alias :pull :pull_request
|
28
33
|
|
@@ -37,7 +42,7 @@ module Octokit
|
|
37
42
|
# @param head [String] The branch (or git ref) where your changes are implemented.
|
38
43
|
# @param title [String] Title for the pull request
|
39
44
|
# @param body [String] The body for the pull request. Supports GFM.
|
40
|
-
# @return [
|
45
|
+
# @return [Sawyer::Resource] The newly created pull request
|
41
46
|
def create_pull_request(repo, base, head, title, body, options={})
|
42
47
|
pull = {
|
43
48
|
:base => base,
|
@@ -45,7 +50,7 @@ module Octokit
|
|
45
50
|
:title => title,
|
46
51
|
:body => body,
|
47
52
|
}
|
48
|
-
post
|
53
|
+
post "repos/#{Repository.new(repo)}/pulls", options.merge(pull)
|
49
54
|
end
|
50
55
|
|
51
56
|
# Create a pull request from existing issue
|
@@ -58,24 +63,31 @@ module Octokit
|
|
58
63
|
# a merge to a base of another repo.
|
59
64
|
# @param head [String] The branch (or git ref) where your changes are implemented.
|
60
65
|
# @param issue [Integer] Number of Issue on which to base this pull request
|
61
|
-
# @return [
|
66
|
+
# @return [Sawyer::Resource] The newly created pull request
|
62
67
|
def create_pull_request_for_issue(repo, base, head, issue, options={})
|
63
68
|
pull = {
|
64
69
|
:base => base,
|
65
70
|
:head => head,
|
66
71
|
:issue => issue
|
67
72
|
}
|
68
|
-
post
|
73
|
+
post "repos/#{Repository.new(repo)}/pulls", options.merge(pull)
|
69
74
|
end
|
70
75
|
|
71
76
|
# Update a pull request
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
77
|
+
# @overload update_pull_request(repo, id, title=nil, body=nil, state=nil, options={})
|
78
|
+
# @deprecated
|
79
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
80
|
+
# @param number [Integer] Number of pull request to update.
|
81
|
+
# @param title [String] Title for the pull request.
|
82
|
+
# @param body [String] Body content for pull request. Supports GFM.
|
83
|
+
# @param state [String] State of the pull request. `open` or `closed`.
|
84
|
+
# @overload update_pull_request(repo, id, options={})
|
85
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
86
|
+
# @param number [Integer] Number of pull request to update.
|
87
|
+
# @option options [String] :title Title for the pull request.
|
88
|
+
# @option options [String] :body Body for the pull request.
|
89
|
+
# @option options [String] :state State for the pull request.
|
90
|
+
# @return [Sawyer::Resource] Hash representing updated pull request.
|
79
91
|
# @see http://developer.github.com/v3/pulls/#update-a-pull-request
|
80
92
|
# @example
|
81
93
|
# @client.update_pull_request('pengwynn/octokit', 67, 'new title', 'updated body', 'closed')
|
@@ -83,25 +95,37 @@ module Octokit
|
|
83
95
|
# @client.update_pull_request('pengwynn/octokit', 67, nil, nil, 'open')
|
84
96
|
# @example Empty body by passing empty string
|
85
97
|
# @client.update_pull_request('pengwynn/octokit', 67, nil, '')
|
86
|
-
def update_pull_request(
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
patch
|
98
|
+
def update_pull_request(*args)
|
99
|
+
arguments = Octokit::Arguments.new(args)
|
100
|
+
repo = arguments.shift
|
101
|
+
number = arguments.shift
|
102
|
+
title = arguments.shift
|
103
|
+
body = arguments.shift
|
104
|
+
state = arguments.shift
|
105
|
+
patch "repos/#{Repository.new repo}/pulls/#{number}", arguments.options
|
94
106
|
end
|
95
107
|
|
108
|
+
# Close a pull request
|
109
|
+
#
|
110
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
111
|
+
# @param number [Integer] Number of pull request to update.
|
112
|
+
# @return [Sawyer::Resource] Hash representing updated pull request.
|
113
|
+
# @see http://developer.github.com/v3/pulls/#update-a-pull-request
|
114
|
+
# @example
|
115
|
+
# @client.close_pull_request('pengwynn/octokit', 67)
|
116
|
+
def close_pull_request(repo, number, options={})
|
117
|
+
options.merge! :state => 'closed'
|
118
|
+
update_pull_request(repo, number, options)
|
119
|
+
end
|
96
120
|
|
97
121
|
# List commits on a pull request
|
98
122
|
#
|
99
123
|
# @see http://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
|
100
124
|
# @param repo [String, Hash, Repository] A GitHub repository
|
101
125
|
# @param number [Integer] Number of pull request
|
102
|
-
# @return [Array<
|
126
|
+
# @return [Array<Sawyer::Resource>] List of commits
|
103
127
|
def pull_request_commits(repo, number, options={})
|
104
|
-
get
|
128
|
+
get "repos/#{Repository.new(repo)}/pulls/#{number}/commits", options
|
105
129
|
end
|
106
130
|
alias :pull_commits :pull_request_commits
|
107
131
|
|
@@ -141,10 +165,10 @@ module Octokit
|
|
141
165
|
# @see http://developer.github.com/v3/pulls/#list-comments-on-a-pull-request
|
142
166
|
# @param repo [String, Hash, Repository] A GitHub repository
|
143
167
|
# @param number [Integer] Number of pull request
|
144
|
-
# @return [Array<
|
168
|
+
# @return [Array<Sawyer::Resource>] List of comments
|
145
169
|
def pull_request_comments(repo, number, options={})
|
146
170
|
# return the comments for a pull request
|
147
|
-
get
|
171
|
+
get "repos/#{Repository.new(repo)}/pulls/#{number}/comments", options
|
148
172
|
end
|
149
173
|
alias :pull_comments :pull_request_comments
|
150
174
|
alias :review_comments :pull_request_comments
|
@@ -153,12 +177,12 @@ module Octokit
|
|
153
177
|
#
|
154
178
|
# @param repo [String, Hash, Repository] A GitHub repository
|
155
179
|
# @param comment_id [Integer] Id of comment to get
|
156
|
-
# @return [
|
180
|
+
# @return [Sawyer::Resource] Hash representing the comment
|
157
181
|
# @see http://developer.github.com/v3/pulls/comments/#get-a-single-comment
|
158
182
|
# @example
|
159
183
|
# @client.pull_request_comment("pengwynn/octkit", 1903950)
|
160
184
|
def pull_request_comment(repo, comment_id, options={})
|
161
|
-
get
|
185
|
+
get "repos/#{Repository.new repo}/pulls/comments/#{comment_id}", options
|
162
186
|
end
|
163
187
|
alias :pull_comment :pull_request_comment
|
164
188
|
alias :review_comment :pull_request_comment
|
@@ -171,7 +195,7 @@ module Octokit
|
|
171
195
|
# @param commit_id [String] Sha of the commit to comment on.
|
172
196
|
# @param path [String] Relative path of the file to comment on.
|
173
197
|
# @param position [Integer] Line index in the diff to comment on.
|
174
|
-
# @return [
|
198
|
+
# @return [Sawyer::Resource] Hash representing the new comment
|
175
199
|
# @see http://developer.github.com/v3/pulls/comments/#create-a-comment
|
176
200
|
# @example
|
177
201
|
# @client.create_pull_request_comment("pengwynn/octokit", 163, ":shipit:",
|
@@ -183,7 +207,7 @@ module Octokit
|
|
183
207
|
:path => path,
|
184
208
|
:position => position
|
185
209
|
})
|
186
|
-
post
|
210
|
+
post "repos/#{Repository.new repo}/pulls/#{pull_id}/comments", options
|
187
211
|
end
|
188
212
|
alias :create_pull_comment :create_pull_request_comment
|
189
213
|
alias :create_view_comment :create_pull_request_comment
|
@@ -194,7 +218,7 @@ module Octokit
|
|
194
218
|
# @param pull_id [Integer] Pull request id
|
195
219
|
# @param body [String] Comment contents
|
196
220
|
# @param comment_id [Integer] Comment id to reply to
|
197
|
-
# @return [
|
221
|
+
# @return [Sawyer::Resource] Hash representing new comment
|
198
222
|
# @see http://developer.github.com/v3/pulls/comments/#create-a-comment
|
199
223
|
# @example
|
200
224
|
# @client.create_pull_request_comment_reply("pengwynn/octokit", 1903950, "done.")
|
@@ -203,7 +227,7 @@ module Octokit
|
|
203
227
|
:body => body,
|
204
228
|
:in_reply_to => comment_id
|
205
229
|
})
|
206
|
-
post
|
230
|
+
post "repos/#{Repository.new repo}/pulls/#{pull_id}/comments", options
|
207
231
|
end
|
208
232
|
alias :create_pull_reply :create_pull_request_comment_reply
|
209
233
|
alias :create_review_reply :create_pull_request_comment_reply
|
@@ -213,7 +237,7 @@ module Octokit
|
|
213
237
|
# @param repo [String, Hash, Repository] A GitHub repository
|
214
238
|
# @param comment_id [Integer] Id of the comment to update
|
215
239
|
# @param body [String] Updated comment content
|
216
|
-
# @return [
|
240
|
+
# @return [Sawyer::Resource] Hash representing the updated comment
|
217
241
|
# @see http://developer.github.com/v3/pulls/comments/#edit-a-comment
|
218
242
|
# @example
|
219
243
|
# @client.update_pull_request_comment("pengwynn/octokit", 1903950, ":shipit:")
|
@@ -242,9 +266,9 @@ module Octokit
|
|
242
266
|
# @see http://developer.github.com/v3/pulls/#list-files-on-a-pull-request
|
243
267
|
# @param repo [String, Hash, Repository] A GitHub repository
|
244
268
|
# @param number [Integer] Number of pull request
|
245
|
-
# @return [Array<
|
269
|
+
# @return [Array<Sawyer::Resource>] List of files
|
246
270
|
def pull_request_files(repo, number, options={})
|
247
|
-
get
|
271
|
+
get "repos/#{Repository.new(repo)}/pulls/#{number}/files", options
|
248
272
|
end
|
249
273
|
alias :pull_files :pull_request_files
|
250
274
|
|
@@ -254,9 +278,9 @@ module Octokit
|
|
254
278
|
# @param repo [String, Hash, Repository] A GitHub repository
|
255
279
|
# @param number [Integer] Number of pull request
|
256
280
|
# @param commit_message [String] Optional commit message for the merge commit
|
257
|
-
# @return [Array<
|
281
|
+
# @return [Array<Sawyer::Resource>] Merge commit info if successful
|
258
282
|
def merge_pull_request(repo, number, commit_message='', options={})
|
259
|
-
put
|
283
|
+
put "repos/#{Repository.new(repo)}/pulls/#{number}/merge", options.merge({:commit_message => commit_message})
|
260
284
|
end
|
261
285
|
|
262
286
|
# Check pull request merge status
|
@@ -266,7 +290,7 @@ module Octokit
|
|
266
290
|
# @param number [Integer] Number of pull request
|
267
291
|
# @return [Boolean] True if the pull request has been merged
|
268
292
|
def pull_merged?(repo, number, options={})
|
269
|
-
boolean_from_response
|
293
|
+
boolean_from_response :get, "repos/#{Repository.new(repo)}/pulls/#{number}/merge", options
|
270
294
|
end
|
271
295
|
alias :pull_request_merged? :pull_merged?
|
272
296
|
|
@@ -1,18 +1,52 @@
|
|
1
1
|
module Octokit
|
2
2
|
class Client
|
3
|
+
|
4
|
+
# Methods for API rate limiting info
|
5
|
+
#
|
6
|
+
# @see http://developer.github.com/v3/#rate-limiting
|
3
7
|
module RateLimit
|
4
8
|
|
5
|
-
|
6
|
-
|
7
|
-
|
9
|
+
# Get rate limit info from last response if available
|
10
|
+
# or make a new request to fetch rate limit
|
11
|
+
#
|
12
|
+
# @see http://developer.github.com/v3/#rate-limiting
|
13
|
+
# @return [Octokit::RateLimit] Rate limit info
|
14
|
+
def rate_limit(options={})
|
15
|
+
return rate_limit! if last_response.nil?
|
16
|
+
|
17
|
+
Octokit::RateLimit.from_response(last_response)
|
18
|
+
end
|
19
|
+
alias ratelimit rate_limit
|
20
|
+
|
21
|
+
# Get number of rate limted requests remaining
|
22
|
+
#
|
23
|
+
# @see http://developer.github.com/v3/#rate-limiting
|
24
|
+
# @return [Fixnum] Number of requests remaining in this period
|
25
|
+
def rate_limit_remaining(options={})
|
26
|
+
puts "Deprecated: Please use .rate_limit.remaining"
|
27
|
+
rate_limit.remaining
|
28
|
+
end
|
29
|
+
alias ratelimit_remaining rate_limit_remaining
|
30
|
+
|
31
|
+
# Refresh rate limit info by making a new request
|
32
|
+
#
|
33
|
+
# @see http://developer.github.com/v3/#rate-limiting
|
34
|
+
# @return [Octokit::RateLimit] Rate limit info
|
35
|
+
def rate_limit!(options={})
|
36
|
+
get "rate_limit"
|
37
|
+
Octokit::RateLimit.from_response(last_response)
|
8
38
|
end
|
9
|
-
alias rate_limit
|
39
|
+
alias ratelimit! rate_limit!
|
10
40
|
|
11
|
-
|
12
|
-
|
13
|
-
|
41
|
+
# Refresh rate limit info and get number of rate limted requests remaining
|
42
|
+
#
|
43
|
+
# @see http://developer.github.com/v3/#rate-limiting
|
44
|
+
# @return [Fixnum] Number of requests remaining in this period
|
45
|
+
def rate_limit_remaining!(options={})
|
46
|
+
puts "Deprecated: Please use .rate_limit!.remaining"
|
47
|
+
rate_limit!.remaining
|
14
48
|
end
|
15
|
-
alias rate_limit_remaining
|
49
|
+
alias ratelimit_remaining! rate_limit_remaining!
|
16
50
|
|
17
51
|
end
|
18
52
|
end
|
data/lib/octokit/client/refs.rb
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
module Octokit
|
2
2
|
class Client
|
3
|
+
|
4
|
+
# Methods for References for Git Data API
|
5
|
+
#
|
6
|
+
# @see http://developer.github.com/v3/git/refs/
|
3
7
|
module Refs
|
4
8
|
|
5
9
|
# List all refs for a given user and repo
|
6
10
|
#
|
7
11
|
# @param repo [String, Repository, Hash] A GitHub repository
|
8
12
|
# @param namespace [String] The ref namespace, e.g. <tt>tag</tt> or <tt>heads</tt>
|
9
|
-
# @return [Array] A list of references matching the repo and the namespace
|
13
|
+
# @return [Array<Sawyer::Resource>] A list of references matching the repo and the namespace
|
10
14
|
# @see http://developer.github.com/v3/git/refs/
|
11
15
|
# @example Fetch all refs for sferik/rails_admin
|
12
16
|
# Octokit.refs("sferik/rails_admin")
|
13
|
-
def refs(repo, namespace=
|
14
|
-
|
17
|
+
def refs(repo, namespace = nil, options={})
|
18
|
+
path = "repos/#{Repository.new(repo)}/git/refs"
|
19
|
+
path += "/#{namespace}" unless namespace.nil?
|
20
|
+
get path, options
|
15
21
|
end
|
16
22
|
alias :list_refs :refs
|
17
23
|
alias :references :refs
|
@@ -21,12 +27,12 @@ module Octokit
|
|
21
27
|
#
|
22
28
|
# @param repo [String, Repository, Hash] A GitHub repository
|
23
29
|
# @param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
|
24
|
-
# @return [
|
30
|
+
# @return [Sawyer::Resource] The reference matching the given repo and the ref id
|
25
31
|
# @see http://developer.github.com/v3/git/refs/
|
26
32
|
# @example Fetch tags/v0.0.3 for sferik/rails_admin
|
27
33
|
# Octokit.ref("sferik/rails_admin","tags/v0.0.3")
|
28
34
|
def ref(repo, ref, options={})
|
29
|
-
get
|
35
|
+
get "repos/#{Repository.new(repo)}/git/refs/#{ref}", options
|
30
36
|
end
|
31
37
|
alias :reference :ref
|
32
38
|
|
@@ -35,7 +41,7 @@ module Octokit
|
|
35
41
|
# @param repo [String, Repository, Hash] A GitHub repository
|
36
42
|
# @param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
|
37
43
|
# @param sha [String] A SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
|
38
|
-
# @return [Array] The list of references, already containing the new one
|
44
|
+
# @return [Array<Sawyer::Resource>] The list of references, already containing the new one
|
39
45
|
# @see http://developer.github.com/v3/git/refs/
|
40
46
|
# @example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132
|
41
47
|
# Octokit.create_ref("octocat/Hello-World","heads/master", "827efc6d56897b048c772eb4087f854f46256132")
|
@@ -44,7 +50,7 @@ module Octokit
|
|
44
50
|
:ref => "refs/#{ref}",
|
45
51
|
:sha => sha
|
46
52
|
}
|
47
|
-
post
|
53
|
+
post "repos/#{Repository.new(repo)}/git/refs", options.merge(parameters)
|
48
54
|
end
|
49
55
|
alias :create_reference :create_ref
|
50
56
|
|
@@ -54,7 +60,7 @@ module Octokit
|
|
54
60
|
# @param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
|
55
61
|
# @param sha [String] A SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
|
56
62
|
# @param force [Boolean] A flag indicating one wants to force the update to make sure the update is a fast-forward update.
|
57
|
-
# @return [Array] The list of references updated
|
63
|
+
# @return [Array<Sawyer::Resource>] The list of references updated
|
58
64
|
# @see http://developer.github.com/v3/git/refs/
|
59
65
|
# @example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
|
60
66
|
# Octokit.update_ref("octocat/Hello-World","heads/sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd")
|
@@ -63,7 +69,7 @@ module Octokit
|
|
63
69
|
:sha => sha,
|
64
70
|
:force => force
|
65
71
|
}
|
66
|
-
patch
|
72
|
+
patch "repos/#{Repository.new(repo)}/git/refs/#{ref}", options.merge(parameters)
|
67
73
|
end
|
68
74
|
alias :update_reference :update_ref
|
69
75
|
|
@@ -76,7 +82,7 @@ module Octokit
|
|
76
82
|
# @example Delete tags/v0.0.3 for sferik/rails_admin
|
77
83
|
# Octokit.delete_ref("sferik/rails_admin","tags/v0.0.3")
|
78
84
|
def delete_ref(repo, ref, options={})
|
79
|
-
boolean_from_response
|
85
|
+
boolean_from_response :delete, "repos/#{Repository.new(repo)}/git/refs/#{ref}", options
|
80
86
|
end
|
81
87
|
alias :delete_reference :delete_ref
|
82
88
|
|
@@ -1,16 +1,11 @@
|
|
1
1
|
module Octokit
|
2
2
|
class Client
|
3
|
+
|
4
|
+
# Methods for the Repositories API
|
5
|
+
#
|
6
|
+
# @see http://developer.github.com/v3/repos/
|
3
7
|
module Repositories
|
4
8
|
|
5
|
-
# Legacy repository search
|
6
|
-
#
|
7
|
-
# @see http://developer.github.com/v3/search/#search-repositories
|
8
|
-
# @param q [String] Search keyword
|
9
|
-
# @return [Array<Hashie::Mash>] List of repositories found
|
10
|
-
def search_repositories(q, options={})
|
11
|
-
get("legacy/repos/search/#{q}", options)['repositories']
|
12
|
-
end
|
13
|
-
alias :search_repos :search_repositories
|
14
9
|
|
15
10
|
# Check if a repository exists
|
16
11
|
#
|
@@ -27,7 +22,7 @@ module Octokit
|
|
27
22
|
#
|
28
23
|
# @see http://developer.github.com/v3/repos/#get
|
29
24
|
# @param repo [String, Hash, Repository] A GitHub repository
|
30
|
-
# @return [
|
25
|
+
# @return [Sawyer::Resource] Repository information
|
31
26
|
def repository(repo, options={})
|
32
27
|
get "repos/#{Repository.new repo}", options
|
33
28
|
end
|
@@ -46,9 +41,11 @@ module Octokit
|
|
46
41
|
# @option options [String] :has_wiki `true` enables wiki for this repo, `false` disables wiki.
|
47
42
|
# @option options [String] :has_downloads `true` enables downloads for this repo, `false` disables downloads.
|
48
43
|
# @option options [String] :default_branch Update the default branch for this repository.
|
49
|
-
# @return [
|
44
|
+
# @return [Sawyer::Resource] Repository information
|
50
45
|
def edit_repository(repo, options={})
|
51
|
-
|
46
|
+
repo = Repository.new(repo)
|
47
|
+
options[:name] ||= repo.name
|
48
|
+
patch "repos/#{repo}", options
|
52
49
|
end
|
53
50
|
alias :edit :edit_repository
|
54
51
|
alias :update_repository :edit_repository
|
@@ -61,12 +58,12 @@ module Octokit
|
|
61
58
|
#
|
62
59
|
# @see http://developer.github.com/v3/repos/#list-your-repositories
|
63
60
|
# @param username [String] Optional username for which to list repos
|
64
|
-
# @return [Array<
|
61
|
+
# @return [Array<Sawyer::Resource>] List of repositories
|
65
62
|
def repositories(username=nil, options={})
|
66
63
|
if username.nil?
|
67
|
-
|
64
|
+
paginate 'user/repos', options
|
68
65
|
else
|
69
|
-
|
66
|
+
paginate "users/#{username}/repos", options
|
70
67
|
end
|
71
68
|
end
|
72
69
|
alias :list_repositories :repositories
|
@@ -83,10 +80,9 @@ module Octokit
|
|
83
80
|
# @param options [Hash] Optional options
|
84
81
|
# @option options [Integer] :since The integer ID of the last Repository
|
85
82
|
# that you’ve seen.
|
86
|
-
#
|
87
|
-
# @return [Array] List of repositories.
|
83
|
+
# @return [Array<Sawyer::Resource>] List of repositories.
|
88
84
|
def all_repositories(options={})
|
89
|
-
|
85
|
+
paginate 'repositories', options
|
90
86
|
end
|
91
87
|
|
92
88
|
# Star a repository
|
@@ -95,7 +91,7 @@ module Octokit
|
|
95
91
|
# @return [Boolean] `true` if successfully starred
|
96
92
|
# @see http://developer.github.com/v3/activity/starring/#star-a-repository
|
97
93
|
def star(repo, options={})
|
98
|
-
boolean_from_response
|
94
|
+
boolean_from_response :put, "user/starred/#{Repository.new repo}", options
|
99
95
|
end
|
100
96
|
|
101
97
|
# Unstar a repository
|
@@ -104,7 +100,7 @@ module Octokit
|
|
104
100
|
# @return [Boolean] `true` if successfully unstarred
|
105
101
|
# @see http://developer.github.com/v3/activity/starring/#unstar-a-repository
|
106
102
|
def unstar(repo, options={})
|
107
|
-
boolean_from_response
|
103
|
+
boolean_from_response :delete, "user/starred/#{Repository.new repo}", options
|
108
104
|
end
|
109
105
|
|
110
106
|
# Watch a repository
|
@@ -114,7 +110,7 @@ module Octokit
|
|
114
110
|
# @deprecated Use #star instead
|
115
111
|
# @see http://developer.github.com/v3/activity/watching/#watch-a-repository-legacy
|
116
112
|
def watch(repo, options={})
|
117
|
-
boolean_from_response
|
113
|
+
boolean_from_response :put, "user/watched/#{Repository.new repo}", options
|
118
114
|
end
|
119
115
|
|
120
116
|
# Unwatch a repository
|
@@ -124,13 +120,13 @@ module Octokit
|
|
124
120
|
# @deprecated Use #unstar instead
|
125
121
|
# @see http://developer.github.com/v3/activity/watching/#stop-watching-a-repository-legacy
|
126
122
|
def unwatch(repo, options={})
|
127
|
-
boolean_from_response
|
123
|
+
boolean_from_response :delete, "user/watched/#{Repository.new repo}", options
|
128
124
|
end
|
129
125
|
|
130
126
|
# Fork a repository
|
131
127
|
#
|
132
128
|
# @param repo [String, Hash, Repository] A GitHub repository
|
133
|
-
# @return [
|
129
|
+
# @return [Sawyer::Resource] Repository info for the new fork
|
134
130
|
# @see http://developer.github.com/v3/repos/forks/#create-a-fork
|
135
131
|
def fork(repo, options={})
|
136
132
|
post "repos/#{Repository.new repo}/forks", options
|
@@ -149,7 +145,7 @@ module Octokit
|
|
149
145
|
# @option options [Integer] :team_id The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.
|
150
146
|
# @option options [Boolean] :auto_init `true` to create an initial commit with empty README. Default is `false`.
|
151
147
|
# @option options [String] :gitignore_template Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided.
|
152
|
-
# @return [
|
148
|
+
# @return [Sawyer::Resource] Repository info for the new repository
|
153
149
|
# @see http://developer.github.com/v3/repos/#create
|
154
150
|
def create_repository(name, options={})
|
155
151
|
organization = options.delete :organization
|
@@ -172,14 +168,14 @@ module Octokit
|
|
172
168
|
# @param repo [String, Hash, Repository] A GitHub repository
|
173
169
|
# @return [Boolean] `true` if repository was deleted
|
174
170
|
def delete_repository(repo, options={})
|
175
|
-
boolean_from_response
|
171
|
+
boolean_from_response :delete, "repos/#{Repository.new repo}", options
|
176
172
|
end
|
177
173
|
alias :delete_repo :delete_repository
|
178
174
|
|
179
175
|
# Hide a public repository
|
180
176
|
#
|
181
177
|
# @param repo [String, Hash, Repository] A GitHub repository
|
182
|
-
# @return [
|
178
|
+
# @return [Sawyer::Resource] Updated repository info
|
183
179
|
def set_private(repo, options={})
|
184
180
|
# GitHub Api for setting private updated to use private attr, rather than public
|
185
181
|
update_repository repo, options.merge({ :private => true })
|
@@ -188,7 +184,7 @@ module Octokit
|
|
188
184
|
# Unhide a private repository
|
189
185
|
#
|
190
186
|
# @param repo [String, Hash, Repository] A GitHub repository
|
191
|
-
# @return [
|
187
|
+
# @return [Sawyer::Resource] Updated repository info
|
192
188
|
def set_public(repo, options={})
|
193
189
|
# GitHub Api for setting private updated to use private attr, rather than public
|
194
190
|
update_repository repo, options.merge({ :private => false })
|
@@ -197,17 +193,16 @@ module Octokit
|
|
197
193
|
# Get deploy keys on a repo
|
198
194
|
#
|
199
195
|
# Requires authenticated client.
|
200
|
-
#
|
196
|
+
#
|
201
197
|
# @param repo [String, Hash, Repository] A GitHub repository
|
202
|
-
# @return [Array<
|
203
|
-
# @see Octokit::Client
|
198
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing deploy keys.
|
204
199
|
# @see http://developer.github.com/v3/repos/keys/#get
|
205
200
|
# @example
|
206
201
|
# @client.deploy_keys('pengwynn/octokit')
|
207
202
|
# @example
|
208
203
|
# @client.list_deploy_keys('pengwynn/octokit')
|
209
204
|
def deploy_keys(repo, options={})
|
210
|
-
|
205
|
+
paginate "repos/#{Repository.new repo}/keys", options
|
211
206
|
end
|
212
207
|
alias :list_deploy_keys :deploy_keys
|
213
208
|
|
@@ -218,8 +213,7 @@ module Octokit
|
|
218
213
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
219
214
|
# @param title [String] Title reference for the deploy key.
|
220
215
|
# @param key [String] Public key.
|
221
|
-
# @return [
|
222
|
-
# @see Octokit::Client
|
216
|
+
# @return [Sawyer::Resource] Hash representing newly added key.
|
223
217
|
# @see http://developer.github.com/v3/repos/keys/#create
|
224
218
|
# @example
|
225
219
|
# @client.add_deploy_key('pengwynn/octokit', 'Staging server', 'ssh-rsa AAA...')
|
@@ -234,12 +228,11 @@ module Octokit
|
|
234
228
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
235
229
|
# @param id [Integer] Id of the deploy key to remove.
|
236
230
|
# @return [Boolean] True if key removed, false otherwise.
|
237
|
-
# @see Octokit::Client
|
238
231
|
# @see http://developer.github.com/v3/repos/keys/#delete
|
239
232
|
# @example
|
240
233
|
# @client.remove_deploy_key('pengwynn/octokit', 100000)
|
241
234
|
def remove_deploy_key(repo, id, options={})
|
242
|
-
boolean_from_response
|
235
|
+
boolean_from_response :delete, "repos/#{Repository.new repo}/keys/#{id}", options
|
243
236
|
end
|
244
237
|
|
245
238
|
# List collaborators
|
@@ -247,8 +240,7 @@ module Octokit
|
|
247
240
|
# Requires authenticated client for private repos.
|
248
241
|
#
|
249
242
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
250
|
-
# @return [Array<
|
251
|
-
# @see Octokit::Client
|
243
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing collaborating users.
|
252
244
|
# @see http://developer.github.com/v3/repos/collaborators/#list
|
253
245
|
# @example
|
254
246
|
# Octokit.collaborators('pengwynn/octokit')
|
@@ -257,7 +249,7 @@ module Octokit
|
|
257
249
|
# @example
|
258
250
|
# @client.collabs('pengwynn/octokit')
|
259
251
|
def collaborators(repo, options={})
|
260
|
-
|
252
|
+
paginate "repos/#{Repository.new repo}/collaborators", options
|
261
253
|
end
|
262
254
|
alias :collabs :collaborators
|
263
255
|
|
@@ -268,14 +260,13 @@ module Octokit
|
|
268
260
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
269
261
|
# @param collaborator [String] Collaborator GitHub username to add.
|
270
262
|
# @return [Boolean] True if collaborator added, false otherwise.
|
271
|
-
# @see Octokit::Client
|
272
263
|
# @see http://developer.github.com/v3/repos/collaborators/#add-collaborator
|
273
264
|
# @example
|
274
265
|
# @client.add_collaborator('pengwynn/octokit', 'holman')
|
275
266
|
# @example
|
276
267
|
# @client.add_collab('pengwynn/octokit', 'holman')
|
277
268
|
def add_collaborator(repo, collaborator, options={})
|
278
|
-
boolean_from_response
|
269
|
+
boolean_from_response :put, "repos/#{Repository.new repo}/collaborators/#{collaborator}", options
|
279
270
|
end
|
280
271
|
alias :add_collab :add_collaborator
|
281
272
|
|
@@ -286,14 +277,13 @@ module Octokit
|
|
286
277
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
287
278
|
# @param collaborator [String] Collaborator GitHub username to remove.
|
288
279
|
# @return [Boolean] True if collaborator removed, false otherwise.
|
289
|
-
# @see Octokit::Client
|
290
280
|
# @see http://developer.github.com/v3/repos/collaborators/#remove-collaborator
|
291
281
|
# @example
|
292
282
|
# @client.remove_collaborator('pengwynn/octokit', 'holman')
|
293
283
|
# @example
|
294
284
|
# @client.remove_collab('pengwynn/octokit', 'holman')
|
295
285
|
def remove_collaborator(repo, collaborator, options={})
|
296
|
-
boolean_from_response
|
286
|
+
boolean_from_response :delete, "repos/#{Repository.new repo}/collaborators/#{collaborator}", options
|
297
287
|
end
|
298
288
|
alias :remove_collab :remove_collaborator
|
299
289
|
|
@@ -302,8 +292,7 @@ module Octokit
|
|
302
292
|
# Requires authenticated client that is an owner or collaborator of the repo.
|
303
293
|
#
|
304
294
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
305
|
-
# @return [Array<
|
306
|
-
# @see Octokit::Client
|
295
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing teams.
|
307
296
|
# @see http://developer.github.com/v3/repos/#list-teams
|
308
297
|
# @example
|
309
298
|
# @client.repository_teams('octokit/pengwynn')
|
@@ -312,7 +301,7 @@ module Octokit
|
|
312
301
|
# @example
|
313
302
|
# @client.teams('octokit/pengwynn')
|
314
303
|
def repository_teams(repo, options={})
|
315
|
-
|
304
|
+
paginate "repos/#{Repository.new repo}/teams", options
|
316
305
|
end
|
317
306
|
alias :repo_teams :repository_teams
|
318
307
|
alias :teams :repository_teams
|
@@ -323,17 +312,17 @@ module Octokit
|
|
323
312
|
#
|
324
313
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
325
314
|
# @param anon [Boolean] Set true to include annonymous contributors.
|
326
|
-
# @return [Array<
|
327
|
-
# @see Octokit::Client
|
315
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
328
316
|
# @see http://developer.github.com/v3/repos/#list-contributors
|
329
317
|
# @example
|
330
318
|
# Octokit.contributors('pengwynn/octokit', true)
|
331
319
|
# @example
|
332
320
|
# Octokit.contribs('pengwynn/octokit')
|
333
321
|
# @example
|
334
|
-
# @client.contribs('pengwynn/octokit')
|
335
|
-
def contributors(repo, anon=
|
336
|
-
|
322
|
+
# @client.contribs('pengwynn/octokit')
|
323
|
+
def contributors(repo, anon = nil, options={})
|
324
|
+
options[:anon] = 1 if anon.to_s[/1|true/]
|
325
|
+
paginate "repos/#{Repository.new repo}/contributors", options
|
337
326
|
end
|
338
327
|
alias :contribs :contributors
|
339
328
|
|
@@ -342,34 +331,31 @@ module Octokit
|
|
342
331
|
# Requires authenticated client for private repos.
|
343
332
|
#
|
344
333
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
345
|
-
# @return [Array<
|
346
|
-
# @see Octokit::Client
|
334
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
347
335
|
# @see http://developer.github.com/v3/repos/starring/#list-stargazers
|
348
336
|
# @example
|
349
337
|
# Octokit.stargazers('pengwynn/octokit')
|
350
338
|
# @example
|
351
339
|
# @client.stargazers('pengwynn/octokit')
|
352
340
|
def stargazers(repo, options={})
|
353
|
-
|
341
|
+
paginate "repos/#{Repository.new repo}/stargazers", options
|
354
342
|
end
|
355
343
|
|
356
|
-
# @deprecated Use #stargazers instead
|
344
|
+
# @deprecated Use {#stargazers} instead
|
357
345
|
#
|
358
|
-
# List watchers of repo.
|
346
|
+
# List watchers of repo.
|
359
347
|
#
|
360
348
|
# Requires authenticated client for private repos.
|
361
349
|
#
|
362
350
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
363
|
-
# @return [Array<
|
364
|
-
# @see Octokit::Client::Repositories#stargazers
|
365
|
-
# @see Octokit::Client
|
351
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
366
352
|
# @see http://developer.github.com/v3/repos/watching/#list-watchers
|
367
353
|
# @example
|
368
354
|
# Octokit.watchers('pengwynn/octokit')
|
369
355
|
# @example
|
370
356
|
# @client.watchers('pengwynn/octokit')
|
371
357
|
def watchers(repo, options={})
|
372
|
-
|
358
|
+
paginate "repos/#{Repository.new repo}/watchers", options
|
373
359
|
end
|
374
360
|
|
375
361
|
# List forks
|
@@ -377,8 +363,7 @@ module Octokit
|
|
377
363
|
# Requires authenticated client for private repos.
|
378
364
|
#
|
379
365
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
380
|
-
# @return [Array<
|
381
|
-
# @see Octokit::Client
|
366
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing repos.
|
382
367
|
# @see http://developer.github.com/v3/repos/forks/#list-forks
|
383
368
|
# @example
|
384
369
|
# Octokit.forks('pengwynn/octokit')
|
@@ -387,7 +372,7 @@ module Octokit
|
|
387
372
|
# @example
|
388
373
|
# @client.forks('pengwynn/octokit')
|
389
374
|
def forks(repo, options={})
|
390
|
-
|
375
|
+
paginate "repos/#{Repository.new repo}/forks", options
|
391
376
|
end
|
392
377
|
alias :network :forks
|
393
378
|
|
@@ -396,15 +381,14 @@ module Octokit
|
|
396
381
|
# Requires authenticated client for private repos.
|
397
382
|
#
|
398
383
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
399
|
-
# @return [Array<
|
400
|
-
# @see Octokit::Client
|
384
|
+
# @return [Array<Sawyer::Resource>] Array of Hashes representing languages.
|
401
385
|
# @see http://developer.github.com/v3/repos/#list-languages
|
402
386
|
# @example
|
403
387
|
# Octokit.langauges('pengwynn/octokit')
|
404
388
|
# @example
|
405
389
|
# @client.languages('pengwynn/octokit')
|
406
390
|
def languages(repo, options={})
|
407
|
-
|
391
|
+
paginate "repos/#{Repository.new repo}/languages", options
|
408
392
|
end
|
409
393
|
|
410
394
|
# List tags
|
@@ -412,15 +396,14 @@ module Octokit
|
|
412
396
|
# Requires authenticated client for private repos.
|
413
397
|
#
|
414
398
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
415
|
-
# @return [Array<
|
416
|
-
# @see Octokit::Client
|
399
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing tags.
|
417
400
|
# @see http://developer.github.com/v3/repos/#list-tags
|
418
401
|
# @example
|
419
402
|
# Octokit.tags('pengwynn/octokit')
|
420
403
|
# @example
|
421
404
|
# @client.tags('pengwynn/octokit')
|
422
405
|
def tags(repo, options={})
|
423
|
-
|
406
|
+
paginate "repos/#{Repository.new repo}/tags", options
|
424
407
|
end
|
425
408
|
|
426
409
|
# List branches
|
@@ -428,22 +411,21 @@ module Octokit
|
|
428
411
|
# Requires authenticated client for private repos.
|
429
412
|
#
|
430
413
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
431
|
-
# @return [Array<
|
432
|
-
# @see Octokit::Client
|
414
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing branches.
|
433
415
|
# @see http://developer.github.com/v3/repos/#list-branches
|
434
416
|
# @example
|
435
417
|
# Octokit.branches('pengwynn/octokit')
|
436
418
|
# @example
|
437
419
|
# @client.branches('pengwynn/octokit')
|
438
420
|
def branches(repo, options={})
|
439
|
-
|
421
|
+
paginate "repos/#{Repository.new repo}/branches", options
|
440
422
|
end
|
441
423
|
|
442
424
|
# Get a single branch from a repository
|
443
425
|
#
|
444
426
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
445
427
|
# @param branch [String] Branch name
|
446
|
-
# @return [
|
428
|
+
# @return [Sawyer::Resource] The branch requested, if it exists
|
447
429
|
# @see http://developer.github.com/v3/repos/#get-branch
|
448
430
|
# @example Get branch 'master` from pengwynn/octokit
|
449
431
|
# Octokit.branch("pengwynn/octokit", "master")
|
@@ -457,13 +439,12 @@ module Octokit
|
|
457
439
|
# Requires authenticated client.
|
458
440
|
#
|
459
441
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
460
|
-
# @return [Array<
|
461
|
-
# @see Octokit::Client
|
442
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing hooks.
|
462
443
|
# @see http://developer.github.com/v3/repos/hooks/#list
|
463
444
|
# @example
|
464
445
|
# @client.hooks('pengwynn/octokit')
|
465
446
|
def hooks(repo, options={})
|
466
|
-
|
447
|
+
paginate "repos/#{Repository.new repo}/hooks", options
|
467
448
|
end
|
468
449
|
|
469
450
|
# Get single hook
|
@@ -472,8 +453,7 @@ module Octokit
|
|
472
453
|
#
|
473
454
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
474
455
|
# @param id [Integer] Id of the hook to get.
|
475
|
-
# @return [
|
476
|
-
# @see Octokit::Client
|
456
|
+
# @return [Sawyer::Resource] Hash representing hook.
|
477
457
|
# @see http://developer.github.com/v3/repos/hooks/#get-single-hook
|
478
458
|
# @example
|
479
459
|
# @client.hook('pengwynn/octokit', 100000)
|
@@ -495,8 +475,7 @@ module Octokit
|
|
495
475
|
# events the hook is triggered for.
|
496
476
|
# @option options [Boolean] :active Determines whether the hook is
|
497
477
|
# actually triggered on pushes.
|
498
|
-
# @return [
|
499
|
-
# @see Octokit::Client
|
478
|
+
# @return [Sawyer::Resource] Hook info for the new hook
|
500
479
|
# @see https://api.github.com/hooks
|
501
480
|
# @see https://github.com/github/github-services
|
502
481
|
# @see http://developer.github.com/v3/repos/hooks/#create-a-hook
|
@@ -529,7 +508,7 @@ module Octokit
|
|
529
508
|
# @param config [Hash] A Hash containing key/value pairs to provide
|
530
509
|
# settings for this hook. These settings vary between the services and
|
531
510
|
# are defined in the {https://github.com/github/github-services github-services} repo.
|
532
|
-
# @option options [Array<String>] :events ('["push"]') Determines what
|
511
|
+
# @option options [Array<String>] :events ('["push"]') Determines what
|
533
512
|
# events the hook is triggered for.
|
534
513
|
# @option options [Array<String>] :add_events Determines a list of events
|
535
514
|
# to be added to the list of events that the Hook triggers for.
|
@@ -537,8 +516,7 @@ module Octokit
|
|
537
516
|
# to be removed from the list of events that the Hook triggers for.
|
538
517
|
# @option options [Boolean] :active Determines whether the hook is
|
539
518
|
# actually triggered on pushes.
|
540
|
-
# @return [
|
541
|
-
# @see Octokit::Client
|
519
|
+
# @return [Sawyer::Resource] Hook info for the updated hook
|
542
520
|
# @see https://api.github.com/hooks
|
543
521
|
# @see https://github.com/github/github-services
|
544
522
|
# @see http://developer.github.com/v3/repos/hooks/#edit-a-hook
|
@@ -568,12 +546,11 @@ module Octokit
|
|
568
546
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
569
547
|
# @param id [Integer] Id of the hook to remove.
|
570
548
|
# @return [Boolean] True if hook removed, false otherwise.
|
571
|
-
# @see Octokit::Client
|
572
549
|
# @see http://developer.github.com/v3/repos/hooks/#delete-a-hook
|
573
550
|
# @example
|
574
551
|
# @client.remove_hook('pengwynn/octokit', 1000000)
|
575
552
|
def remove_hook(repo, id, options={})
|
576
|
-
boolean_from_response
|
553
|
+
boolean_from_response :delete, "repos/#{Repository.new repo}/hooks/#{id}", options
|
577
554
|
end
|
578
555
|
|
579
556
|
# Test hook
|
@@ -582,35 +559,20 @@ module Octokit
|
|
582
559
|
#
|
583
560
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
584
561
|
# @param id [Integer] Id of the hook to test.
|
585
|
-
# @return [
|
586
|
-
# @see Octokit::Client
|
562
|
+
# @return [Boolean] Success
|
587
563
|
# @see http://developer.github.com/v3/repos/hooks/#test-a-hook
|
588
564
|
# @example
|
589
565
|
# @client.test_hook('pengwynn/octokit', 1000000)
|
590
566
|
def test_hook(repo, id, options={})
|
591
|
-
boolean_from_response
|
567
|
+
boolean_from_response :post, "repos/#{Repository.new repo}/hooks/#{id}/tests", options
|
592
568
|
end
|
593
569
|
|
594
|
-
# Get all Issue Events for a given Repository
|
595
|
-
#
|
596
|
-
# @param repo [String, Repository, Hash] A GitHub repository
|
597
|
-
#
|
598
|
-
# @return [Array] Array of all Issue Events for this Repository
|
599
|
-
# @see http://developer.github.com/v3/issues/events/#list-events-for-a-repository
|
600
|
-
# @example Get all Issue Events for Octokit
|
601
|
-
# Octokit.repository_issue_events("pengwynn/octokit")
|
602
|
-
def repository_issue_events(repo, options={})
|
603
|
-
get "repos/#{Repository.new repo}/issues/events", options
|
604
|
-
end
|
605
|
-
alias :repo_issue_events :repository_issue_events
|
606
|
-
|
607
570
|
# List users available for assigning to issues.
|
608
571
|
#
|
609
572
|
# Requires authenticated client for private repos.
|
610
573
|
#
|
611
574
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
612
|
-
# @return [Array<
|
613
|
-
# @see Octokit::Client
|
575
|
+
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
614
576
|
# @see http://developer.github.com/v3/issues/assignees/#list-assignees
|
615
577
|
# @example
|
616
578
|
# Octokit.repository_assignees('pengwynn/octokit')
|
@@ -619,7 +581,7 @@ module Octokit
|
|
619
581
|
# @example
|
620
582
|
# @client.repository_assignees('pengwynn/octokit')
|
621
583
|
def repository_assignees(repo, options={})
|
622
|
-
|
584
|
+
paginate "repos/#{Repository.new repo}/assignees", options
|
623
585
|
end
|
624
586
|
alias :repo_assignees :repository_assignees
|
625
587
|
|
@@ -628,40 +590,33 @@ module Octokit
|
|
628
590
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
629
591
|
# @param assignee [String] User login to check
|
630
592
|
# @return [Boolean] True if assignable on project, false otherwise.
|
631
|
-
# @see Octokit::Client
|
632
593
|
# @see http://developer.github.com/v3/issues/assignees/#check-assignee
|
633
594
|
# @example
|
634
595
|
# Octokit.check_assignee('pengwynn/octokit', 'andrew')
|
635
596
|
def check_assignee(repo, assignee, options={})
|
636
|
-
boolean_from_response
|
597
|
+
boolean_from_response :get, "repos/#{Repository.new repo}/assignees/#{assignee}", options
|
637
598
|
end
|
638
599
|
|
639
600
|
# List watchers subscribing to notifications for a repo
|
640
601
|
#
|
641
602
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
642
|
-
#
|
643
|
-
# @return [Array] Array of users watching.
|
644
|
-
#
|
603
|
+
# @return [Array<Sawyer::Resource>] Array of users watching.
|
645
604
|
# @see http://developer.github.com/v3/activity/watching/#list-watchers
|
646
|
-
#
|
647
605
|
# @example
|
648
606
|
# @client.subscribers("pengwynn/octokit")
|
649
607
|
def subscribers(repo, options={})
|
650
|
-
|
608
|
+
paginate "repos/#{Repository.new repo}/subscribers", options
|
651
609
|
end
|
652
610
|
|
653
611
|
# Get a repository subscription
|
654
612
|
#
|
655
613
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
656
|
-
#
|
657
|
-
# @return [Hashie::Mash] Repository subscription.
|
658
|
-
#
|
614
|
+
# @return [Sawyer::Resource] Repository subscription.
|
659
615
|
# @see http://developer.github.com/v3/activity/watching/#get-a-repository-subscription
|
660
|
-
#
|
661
616
|
# @example
|
662
617
|
# @client.subscription("pengwynn/octokit")
|
663
618
|
def subscription(repo, options={})
|
664
|
-
get
|
619
|
+
get "repos/#{Repository.new repo}/subscription", options
|
665
620
|
end
|
666
621
|
|
667
622
|
# Update repository subscription
|
@@ -671,32 +626,26 @@ module Octokit
|
|
671
626
|
#
|
672
627
|
# @option options [Boolean] :subscribed Determines if notifications
|
673
628
|
# should be received from this repository.
|
674
|
-
#
|
675
629
|
# @option options [Boolean] :ignored Deterimines if all notifications
|
676
630
|
# should be blocked from this repository.
|
677
|
-
#
|
678
|
-
# @return [Hashie::Mash] Updated repository subscription.
|
679
|
-
#
|
631
|
+
# @return [Sawyer::Resource] Updated repository subscription.
|
680
632
|
# @see http://developer.github.com/v3/activity/watching/#set-a-repository-subscription
|
681
|
-
#
|
682
633
|
# @example Subscribe to notifications for a repository
|
683
634
|
# @client.update_subscription("pengwynn/octokit", {subscribed: true})
|
684
635
|
def update_subscription(repo, options={})
|
685
|
-
put
|
636
|
+
put "repos/#{Repository.new repo}/subscription", options
|
686
637
|
end
|
687
638
|
|
688
639
|
# Delete a repository subscription
|
689
640
|
#
|
690
641
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
691
|
-
#
|
692
642
|
# @return [Boolean] True if subscription deleted, false otherwise.
|
693
|
-
#
|
694
643
|
# @see http://developer.github.com/v3/activity/watching/#delete-a-repository-subscription
|
695
644
|
#
|
696
645
|
# @example
|
697
646
|
# @client.delete_subscription("pengwynn/octokit")
|
698
647
|
def delete_subscription(repo, options={})
|
699
|
-
boolean_from_response
|
648
|
+
boolean_from_response :delete, "repos/#{Repository.new repo}/subscription", options
|
700
649
|
end
|
701
650
|
|
702
651
|
end
|