github_api 0.11.3 → 0.12.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.
- data/README.md +33 -16
- data/Rakefile +3 -3
- data/features/activity/events.feature +7 -7
- data/features/activity/notifications.feature +1 -1
- data/features/activity/starring.feature +2 -2
- data/features/activity/watching.feature +26 -2
- data/features/arguments_parsing.feature +3 -3
- data/features/auto_pagination.feature +7 -7
- data/features/cassettes/activity/events/issue.json +1 -0
- data/features/cassettes/activity/events/network.json +1 -0
- data/features/cassettes/activity/events/org.json +1 -0
- data/features/cassettes/activity/events/performed.json +1 -0
- data/features/cassettes/activity/events/public.json +1 -0
- data/features/cassettes/activity/events/received.json +1 -0
- data/features/cassettes/activity/events/repo.json +1 -0
- data/features/cassettes/activity/notifications/list_user.json +1 -0
- data/features/cassettes/activity/starring/list.json +1 -0
- data/features/cassettes/activity/starring/star.json +1 -0
- data/features/cassettes/activity/starring/starred.json +1 -0
- data/features/cassettes/activity/starring/starring.json +1 -0
- data/features/cassettes/activity/starring/unstar.json +1 -0
- data/features/cassettes/activity/watching/create.json +1 -0
- data/features/cassettes/activity/watching/delete.json +1 -0
- data/features/cassettes/activity/watching/list.json +1 -0
- data/features/cassettes/activity/watching/subscribed.json +1 -0
- data/features/cassettes/activity/watching/unwatch.json +1 -0
- data/features/cassettes/activity/watching/watch.json +1 -0
- data/features/cassettes/activity/watching/watched.json +1 -0
- data/features/cassettes/activity/watching/watching.json +1 -0
- data/features/cassettes/arguments/orgs/get.json +1 -0
- data/features/cassettes/arguments/pulls/get.json +1 -0
- data/features/cassettes/arguments/repo_commits/get.json +1 -0
- data/features/cassettes/auto_pagination/repos/get.json +1 -0
- data/features/cassettes/auto_pagination/repos/global_list.json +1 -0
- data/features/cassettes/auto_pagination/repos/list.json +1 -0
- data/features/cassettes/emojis/list.json +1 -0
- data/features/cassettes/errors/repos/create.json +1 -0
- data/features/cassettes/gists/comments/all.json +1 -0
- data/features/cassettes/gists/comments/first.json +1 -0
- data/features/cassettes/gists/fork.json +1 -0
- data/features/cassettes/gists/gist.json +1 -0
- data/features/cassettes/gists/gists/commits.json +1 -0
- data/features/cassettes/gists/gists/forks.json +1 -0
- data/features/cassettes/gists/gists/public_all.json +1 -0
- data/features/cassettes/gists/gists/starred.json +1 -0
- data/features/cassettes/gists/gists/user_all.json +1 -0
- data/features/cassettes/gists/star.json +1 -0
- data/features/cassettes/gists/starred.json +1 -0
- data/features/cassettes/gists/unstar.json +1 -0
- data/features/cassettes/git_data/commits/get.json +1 -0
- data/features/cassettes/git_data/references/all.json +1 -0
- data/features/cassettes/git_data/references/all_tags.json +1 -0
- data/features/cassettes/git_data/references/one.json +1 -0
- data/features/cassettes/gitignore/get.json +1 -0
- data/features/cassettes/gitignore/get_raw.json +1 -0
- data/features/cassettes/gitignore/list.json +1 -0
- data/features/cassettes/issues/assignees/ckeck.json +1 -0
- data/features/cassettes/issues/assignees/ckeck_not.json +1 -0
- data/features/cassettes/issues/assignees/list.json +1 -0
- data/features/cassettes/issues/comments/create.json +1 -0
- data/features/cassettes/issues/comments/delete.json +1 -0
- data/features/cassettes/issues/comments/edit.json +1 -0
- data/features/cassettes/issues/comments/get.json +1 -0
- data/features/cassettes/issues/comments/list_issue.json +1 -0
- data/features/cassettes/issues/comments/list_repo.json +1 -0
- data/features/cassettes/issues/create.json +1 -0
- data/features/cassettes/issues/edit.json +1 -0
- data/features/cassettes/issues/events/get.json +1 -0
- data/features/cassettes/issues/events/list_issue.json +1 -0
- data/features/cassettes/issues/events/list_repo.json +1 -0
- data/features/cassettes/issues/get.json +1 -0
- data/features/cassettes/issues/labels/add.json +1 -0
- data/features/cassettes/issues/labels/create.json +1 -0
- data/features/cassettes/issues/labels/delete.json +1 -0
- data/features/cassettes/issues/labels/get.json +1 -0
- data/features/cassettes/issues/labels/list_issue.json +1 -0
- data/features/cassettes/issues/labels/list_milestone.json +1 -0
- data/features/cassettes/issues/labels/list_repo.json +1 -0
- data/features/cassettes/issues/labels/remove_all.json +1 -0
- data/features/cassettes/issues/labels/remove_one.json +1 -0
- data/features/cassettes/issues/labels/replace.json +1 -0
- data/features/cassettes/issues/labels/update.json +1 -0
- data/features/cassettes/issues/list/repo.json +1 -0
- data/features/cassettes/issues/list/user.json +1 -0
- data/features/cassettes/issues/milestones/create.json +1 -0
- data/features/cassettes/issues/milestones/delete.json +1 -0
- data/features/cassettes/issues/milestones/get.json +1 -0
- data/features/cassettes/issues/milestones/list.json +1 -0
- data/features/cassettes/issues/milestones/update.json +1 -0
- data/features/cassettes/markdown/render.json +1 -0
- data/features/cassettes/markdown/render_raw.json +1 -0
- data/features/cassettes/media/get_default.json +1 -0
- data/features/cassettes/media/get_full_json.json +1 -0
- data/features/cassettes/media/get_html_json.json +1 -0
- data/features/cassettes/media/get_raw_json.json +1 -0
- data/features/cassettes/media/get_text_json.json +1 -0
- data/features/cassettes/meta/get.json +1 -0
- data/features/cassettes/orgs/get.json +1 -0
- data/features/cassettes/orgs/list/oauth_user.json +1 -0
- data/features/cassettes/orgs/list/user.json +1 -0
- data/features/cassettes/orgs/members/list.json +1 -0
- data/features/cassettes/orgs/members/list_public.json +1 -0
- data/features/cassettes/orgs/members/member_false.json +1 -0
- data/features/cassettes/orgs/members/member_public_false.json +1 -0
- data/features/cassettes/orgs/members/member_public_true.json +1 -0
- data/features/cassettes/pagination/issues/list/first.json +1 -0
- data/features/cassettes/pagination/issues/list/last.json +1 -0
- data/features/cassettes/pagination/issues/list/lastest.json +1 -0
- data/features/cassettes/pagination/issues/list/next.json +1 -0
- data/features/cassettes/pagination/issues/list/prev.json +1 -0
- data/features/cassettes/pagination/repos/commits/list.json +1 -0
- data/features/cassettes/pagination/repos/commits/next.json +1 -0
- data/features/cassettes/pagination/repos/commits/sha.json +1 -0
- data/features/cassettes/pagination/repos/commits/sha/next.json +1 -0
- data/features/cassettes/pagination/repos/diff.json +1 -0
- data/features/cassettes/pagination/repos/diff/next.json +1 -0
- data/features/cassettes/pagination/repos/list.json +1 -0
- data/features/cassettes/pagination/repos/list/next.json +1 -0
- data/features/cassettes/pagination/repos/per_page/each_page.json +1 -0
- data/features/cassettes/pagination/repos/per_page/first.json +1 -0
- data/features/cassettes/pull_requests/comments/list_pull.json +1 -0
- data/features/cassettes/pull_requests/comments/list_repo.json +1 -0
- data/features/cassettes/pull_requests/create.json +1 -0
- data/features/cassettes/pull_requests/get.json +1 -0
- data/features/cassettes/pull_requests/list.json +1 -0
- data/features/cassettes/pull_requests/merge.json +1 -0
- data/features/cassettes/pull_requests/merged.json +1 -0
- data/features/cassettes/ratelimit/get.json +1 -0
- data/features/cassettes/ratelimit/get_remaining.json +1 -0
- data/features/cassettes/ratelimit/get_reset.json +1 -0
- data/features/cassettes/repos/assets/delete.json +1 -0
- data/features/cassettes/repos/assets/edit.json +1 -0
- data/features/cassettes/repos/assets/get.json +1 -0
- data/features/cassettes/repos/assets/list.json +1 -0
- data/features/cassettes/repos/assets/upload.json +1 -0
- data/features/cassettes/repos/branch.json +1 -0
- data/features/cassettes/repos/branch_mutation_one.json +1 -0
- data/features/cassettes/repos/branch_mutation_two.json +1 -0
- data/features/cassettes/repos/branches.json +1 -0
- data/features/cassettes/repos/comments/list.json +1 -0
- data/features/cassettes/repos/commits/compare.json +1 -0
- data/features/cassettes/repos/commits/get.json +1 -0
- data/features/cassettes/repos/commits/list.json +1 -0
- data/features/cassettes/repos/contents/archive.json +1 -0
- data/features/cassettes/repos/contents/create.json +1 -0
- data/features/cassettes/repos/contents/delete.json +1 -0
- data/features/cassettes/repos/contents/get.json +1 -0
- data/features/cassettes/repos/contents/readme.json +1 -0
- data/features/cassettes/repos/contents/update.json +1 -0
- data/features/cassettes/repos/create.json +1 -0
- data/features/cassettes/repos/deployments/create.json +1 -0
- data/features/cassettes/repos/deployments/create_status.json +1 -0
- data/features/cassettes/repos/deployments/list.json +1 -0
- data/features/cassettes/repos/deployments/list_statuses.json +1 -0
- data/features/cassettes/repos/forks/list.json +1 -0
- data/features/cassettes/repos/forks/list_sort.json +1 -0
- data/features/cassettes/repos/get.json +1 -0
- data/features/cassettes/repos/languages.json +1 -0
- data/features/cassettes/repos/list.json +1 -0
- data/features/cassettes/repos/list_org.json +1 -0
- data/features/cassettes/repos/list_org_instance.json +1 -0
- data/features/cassettes/repos/list_repos.json +1 -0
- data/features/cassettes/repos/pages/get.json +1 -0
- data/features/cassettes/repos/pages/list_builds.json +1 -0
- data/features/cassettes/repos/releases/create.json +1 -0
- data/features/cassettes/repos/releases/delete.json +1 -0
- data/features/cassettes/repos/releases/edit.json +1 -0
- data/features/cassettes/repos/releases/get.json +1 -0
- data/features/cassettes/repos/releases/list.json +1 -0
- data/features/cassettes/repos/stats/commits.json +1 -0
- data/features/cassettes/repos/stats/contribs.json +1 -0
- data/features/cassettes/repos/stats/frequency.json +1 -0
- data/features/cassettes/repos/stats/participation.json +1 -0
- data/features/cassettes/repos/stats/punch.json +1 -0
- data/features/cassettes/repos/statuses/list.json +1 -0
- data/features/cassettes/repos/statuses/list_combined.json +1 -0
- data/features/cassettes/repos/tags.json +1 -0
- data/features/cassettes/say/custom.json +1 -0
- data/features/cassettes/say/random.json +1 -0
- data/features/cassettes/search/code.json +1 -0
- data/features/cassettes/search/code_query.json +1 -0
- data/features/cassettes/search/code_unicode.json +1 -0
- data/features/cassettes/search/issues.json +1 -0
- data/features/cassettes/search/legacy/email.json +1 -0
- data/features/cassettes/search/legacy/issues.json +1 -0
- data/features/cassettes/search/legacy/repos.json +1 -0
- data/features/cassettes/search/legacy/users.json +1 -0
- data/features/cassettes/search/legacy/users_keyword.json +1 -0
- data/features/cassettes/search/repos.json +1 -0
- data/features/cassettes/search/users.json +1 -0
- data/features/cassettes/search/users_keyword.json +1 -0
- data/features/cassettes/users/all.json +1 -0
- data/features/cassettes/users/emails/add.json +1 -0
- data/features/cassettes/users/emails/all.json +1 -0
- data/features/cassettes/users/emails/delete.json +1 -0
- data/features/cassettes/users/followers/follow.json +1 -0
- data/features/cassettes/users/followers/following.json +1 -0
- data/features/cassettes/users/followers/following_.json +1 -0
- data/features/cassettes/users/followers/following_another.json +1 -0
- data/features/cassettes/users/followers/list.json +1 -0
- data/features/cassettes/users/followers/unfollow.json +1 -0
- data/features/cassettes/users/get/oauth.json +1 -0
- data/features/cassettes/users/get/user.json +1 -0
- data/features/cassettes/users/keys/create.json +1 -0
- data/features/cassettes/users/keys/delete.json +1 -0
- data/features/cassettes/users/keys/user.json +1 -0
- data/features/cassettes/users/keys/user_all.json +1 -0
- data/features/cassettes/users/keys/user_all.yml +1 -1
- data/features/emojis.feature +1 -1
- data/features/error_codes.feature +1 -1
- data/features/gists.feature +24 -6
- data/features/gists/comments.feature +11 -11
- data/features/git_data/commmits.feature +1 -1
- data/features/git_data/references.feature +7 -7
- data/features/github_api.feature +13 -13
- data/features/gitignore.feature +2 -2
- data/features/issues.feature +1 -1
- data/features/issues/assignees.feature +1 -1
- data/features/issues/comments.feature +12 -12
- data/features/issues/events.feature +4 -4
- data/features/issues/labels.feature +9 -9
- data/features/issues/milestones.feature +7 -7
- data/features/markdown.feature +10 -10
- data/features/media_type.feature +1 -1
- data/features/meta.feature +1 -1
- data/features/orgs.feature +1 -1
- data/features/orgs/members.feature +8 -8
- data/features/pagination.feature +34 -34
- data/features/pull_requests.feature +36 -1
- data/features/pull_requests/comments.feature +4 -4
- data/features/rate_limit.feature +7 -1
- data/features/repos.feature +20 -6
- data/features/repos/assets.feature +2 -2
- data/features/repos/comments.feature +14 -0
- data/features/repos/commits.feature +35 -0
- data/features/repos/contents.feature +11 -11
- data/features/repos/deployments.feature +50 -0
- data/features/repos/forks.feature +2 -2
- data/features/repos/pages.feature +1 -1
- data/features/repos/releases.feature +3 -3
- data/features/repos/statistics.feature +14 -14
- data/features/repos/statuses.feature +14 -1
- data/features/say.feature +43 -43
- data/features/search.feature +3 -3
- data/features/search/legacy.feature +1 -1
- data/features/step_definitions/common_steps.rb +12 -1
- data/features/support/vcr.rb +6 -1
- data/features/users.feature +1 -1
- data/features/users/emails.feature +4 -4
- data/features/users/followers.feature +63 -0
- data/features/users/keys.feature +22 -1
- data/lib/github_api.rb +30 -25
- data/lib/github_api/api.rb +227 -24
- data/lib/github_api/api/actions.rb +5 -7
- data/lib/github_api/api/arguments.rb +248 -0
- data/lib/github_api/api/config.rb +107 -0
- data/lib/github_api/api/config/property.rb +30 -0
- data/lib/github_api/api/config/property_set.rb +118 -0
- data/lib/github_api/api/factory.rb +33 -0
- data/lib/github_api/client.rb +40 -56
- data/lib/github_api/client/activity.rb +25 -0
- data/lib/github_api/client/activity/events.rb +216 -0
- data/lib/github_api/client/activity/notifications.rb +184 -0
- data/lib/github_api/client/activity/starring.rb +128 -0
- data/lib/github_api/client/activity/watching.rb +174 -0
- data/lib/github_api/client/authorizations.rb +143 -0
- data/lib/github_api/client/authorizations/app.rb +98 -0
- data/lib/github_api/client/emojis.rb +17 -0
- data/lib/github_api/client/gists.rb +259 -0
- data/lib/github_api/client/gists/comments.rb +100 -0
- data/lib/github_api/client/git_data.rb +29 -0
- data/lib/github_api/client/git_data/blobs.rb +50 -0
- data/lib/github_api/client/git_data/commits.rb +99 -0
- data/lib/github_api/client/git_data/references.rb +146 -0
- data/lib/github_api/client/git_data/tags.rb +94 -0
- data/lib/github_api/client/git_data/trees.rb +111 -0
- data/lib/github_api/client/gitignore.rb +55 -0
- data/lib/github_api/client/issues.rb +246 -0
- data/lib/github_api/client/issues/assignees.rb +42 -0
- data/lib/github_api/client/issues/comments.rb +144 -0
- data/lib/github_api/client/issues/events.rb +48 -0
- data/lib/github_api/client/issues/labels.rb +187 -0
- data/lib/github_api/client/issues/milestones.rb +144 -0
- data/lib/github_api/client/markdown.rb +60 -0
- data/lib/github_api/client/meta.rb +17 -0
- data/lib/github_api/client/orgs.rb +98 -0
- data/lib/github_api/client/orgs/members.rb +125 -0
- data/lib/github_api/client/orgs/teams.rb +291 -0
- data/lib/github_api/client/pull_requests.rb +205 -0
- data/lib/github_api/client/pull_requests/comments.rb +165 -0
- data/lib/github_api/client/repos.rb +451 -0
- data/lib/github_api/client/repos/collaborators.rb +83 -0
- data/lib/github_api/client/repos/comments.rb +124 -0
- data/lib/github_api/client/repos/commits.rb +78 -0
- data/lib/github_api/client/repos/contents.rb +240 -0
- data/lib/github_api/client/repos/deployments.rb +135 -0
- data/lib/github_api/client/repos/downloads.rb +60 -0
- data/lib/github_api/client/repos/forks.rb +46 -0
- data/lib/github_api/client/repos/hooks.rb +212 -0
- data/lib/github_api/client/repos/keys.rb +81 -0
- data/lib/github_api/client/repos/merging.rb +45 -0
- data/lib/github_api/client/repos/pages.rb +46 -0
- data/lib/github_api/client/repos/pub_sub_hubbub.rb +133 -0
- data/lib/github_api/client/repos/releases.rb +153 -0
- data/lib/github_api/client/repos/releases/assets.rb +134 -0
- data/lib/github_api/client/repos/statistics.rb +87 -0
- data/lib/github_api/client/repos/statuses.rb +89 -0
- data/lib/github_api/client/say.rb +23 -0
- data/lib/github_api/client/scopes.rb +18 -0
- data/lib/github_api/client/search.rb +130 -0
- data/lib/github_api/client/search/legacy.rb +109 -0
- data/lib/github_api/client/users.rb +115 -0
- data/lib/github_api/client/users/emails.rb +62 -0
- data/lib/github_api/client/users/followers.rb +113 -0
- data/lib/github_api/client/users/keys.rb +102 -0
- data/lib/github_api/configuration.rb +25 -95
- data/lib/github_api/connection.rb +13 -15
- data/lib/github_api/normalizer.rb +1 -3
- data/lib/github_api/rate_limit.rb +6 -0
- data/lib/github_api/request.rb +49 -37
- data/lib/github_api/request/basic_auth.rb +1 -1
- data/lib/github_api/request/jsonize.rb +7 -5
- data/lib/github_api/request/oauth2.rb +1 -1
- data/lib/github_api/request/verbs.rb +60 -0
- data/lib/github_api/version.rb +2 -2
- data/spec/fixtures/auths/check.json +36 -0
- data/spec/fixtures/repos/deployment.json +31 -0
- data/spec/fixtures/repos/deployment_status.json +33 -0
- data/spec/fixtures/repos/deployment_statuses.json +68 -0
- data/spec/fixtures/repos/deployments.json +33 -0
- data/spec/github/api/arguments/dsl_spec.rb +10 -0
- data/spec/github/api/arguments/parse_spec.rb +88 -0
- data/spec/github/api/callbacks_spec.rb +59 -0
- data/spec/github/api/namespace_spec.rb +41 -0
- data/spec/github/api/property_spec.rb +100 -0
- data/spec/github/api/set_spec.rb +2 -3
- data/spec/github/api_factory_spec.rb +4 -4
- data/spec/github/api_spec.rb +2 -3
- data/spec/github/client/activity/events/issue_spec.rb +51 -0
- data/spec/github/client/activity/events/network_spec.rb +49 -0
- data/spec/github/client/activity/events/org_spec.rb +50 -0
- data/spec/github/client/activity/events/performed_spec.rb +73 -0
- data/spec/github/client/activity/events/public_spec.rb +44 -0
- data/spec/github/client/activity/events/received_spec.rb +72 -0
- data/spec/github/client/activity/events/repository_spec.rb +53 -0
- data/spec/github/client/activity/events/user_org_spec.rb +53 -0
- data/spec/github/client/activity/notifications/create_spec.rb +44 -0
- data/spec/github/client/activity/notifications/delete_spec.rb +41 -0
- data/spec/github/client/activity/notifications/get_spec.rb +58 -0
- data/spec/github/client/activity/notifications/list_spec.rb +75 -0
- data/spec/github/client/activity/notifications/mark_spec.rb +74 -0
- data/spec/github/client/activity/notifications/subscribed_spec.rb +48 -0
- data/spec/github/client/activity/starring/list_spec.rb +53 -0
- data/spec/github/client/activity/starring/star_spec.rb +36 -0
- data/spec/github/client/activity/starring/starred_spec.rb +53 -0
- data/spec/github/client/activity/starring/starring_spec.rb +38 -0
- data/spec/github/client/activity/starring/unstar_spec.rb +37 -0
- data/spec/github/client/activity/watching/list_spec.rb +47 -0
- data/spec/github/client/activity/watching/unwatch_spec.rb +37 -0
- data/spec/github/client/activity/watching/watch_spec.rb +37 -0
- data/spec/github/client/activity/watching/watched_spec.rb +53 -0
- data/spec/github/client/activity/watching/watching_spec.rb +39 -0
- data/spec/github/client/authorizations/app/check_spec.rb +68 -0
- data/spec/github/client/authorizations/app/create_spec.rb +44 -0
- data/spec/github/client/authorizations/app/delete_spec.rb +59 -0
- data/spec/github/client/authorizations/create_spec.rb +49 -0
- data/spec/github/client/authorizations/delete_spec.rb +38 -0
- data/spec/github/client/authorizations/get_spec.rb +48 -0
- data/spec/github/client/authorizations/list_spec.rb +54 -0
- data/spec/github/client/authorizations/update_spec.rb +49 -0
- data/spec/github/client/gists/comments/create_spec.rb +51 -0
- data/spec/github/client/gists/comments/delete_spec.rb +32 -0
- data/spec/github/client/gists/comments/edit_spec.rb +52 -0
- data/spec/github/client/gists/comments/get_spec.rb +48 -0
- data/spec/github/client/gists/comments/list_spec.rb +51 -0
- data/spec/github/client/gists/comments_spec.rb +11 -0
- data/spec/github/client/gists/create_spec.rb +64 -0
- data/spec/github/client/gists/delete_spec.rb +31 -0
- data/spec/github/client/gists/edit_spec.rb +60 -0
- data/spec/github/client/gists/fork_spec.rb +41 -0
- data/spec/github/client/gists/get_spec.rb +47 -0
- data/spec/github/client/gists/is_starred_spec.rb +44 -0
- data/spec/github/client/gists/list_spec.rb +78 -0
- data/spec/github/client/gists/star_spec.rb +30 -0
- data/spec/github/client/gists/starred_spec.rb +44 -0
- data/spec/github/client/gists/unstar_spec.rb +30 -0
- data/spec/github/client/git_data/blobs/create_spec.rb +64 -0
- data/spec/github/client/git_data/blobs/get_spec.rb +49 -0
- data/spec/github/client/git_data/blobs_spec.rb +9 -0
- data/spec/github/client/git_data/commits/create_spec.rb +77 -0
- data/spec/github/client/git_data/commits/get_spec.rb +50 -0
- data/spec/github/client/git_data/commits_spec.rb +9 -0
- data/spec/github/client/git_data/references/create_spec.rb +67 -0
- data/spec/github/client/git_data/references/delete_spec.rb +39 -0
- data/spec/github/client/git_data/references/get_spec.rb +56 -0
- data/spec/github/client/git_data/references/list_spec.rb +111 -0
- data/spec/github/client/git_data/references/update_spec.rb +62 -0
- data/spec/github/client/git_data/references_spec.rb +11 -0
- data/spec/github/client/git_data/tags/create_spec.rb +63 -0
- data/spec/github/client/git_data/tags/get_spec.rb +48 -0
- data/spec/github/client/git_data/tags_spec.rb +9 -0
- data/spec/github/client/git_data/trees/create_spec.rb +68 -0
- data/spec/github/client/git_data/trees/get_spec.rb +69 -0
- data/spec/github/client/git_data/trees_spec.rb +9 -0
- data/spec/github/client/gitignore/get_spec.rb +53 -0
- data/spec/github/client/gitignore/list_spec.rb +41 -0
- data/spec/github/client/issues/assignees/check_spec.rb +46 -0
- data/spec/github/client/issues/assignees/list_spec.rb +47 -0
- data/spec/github/client/issues/assignees_spec.rb +5 -0
- data/spec/github/client/issues/comments/create_spec.rb +49 -0
- data/spec/github/client/issues/comments/delete_spec.rb +35 -0
- data/spec/github/client/issues/comments/edit_spec.rb +49 -0
- data/spec/github/client/issues/comments/get_spec.rb +48 -0
- data/spec/github/client/issues/comments/list_spec.rb +78 -0
- data/spec/github/client/issues/comments_spec.rb +9 -0
- data/spec/github/client/issues/create_spec.rb +60 -0
- data/spec/github/client/issues/edit_spec.rb +61 -0
- data/spec/github/client/issues/events/get_spec.rb +50 -0
- data/spec/github/client/issues/events/list_spec.rb +85 -0
- data/spec/github/client/issues/events_spec.rb +7 -0
- data/spec/github/client/issues/get_spec.rb +48 -0
- data/spec/github/client/issues/labels/add_spec.rb +50 -0
- data/spec/github/client/issues/labels/create_spec.rb +59 -0
- data/spec/github/client/issues/labels/delete_spec.rb +38 -0
- data/spec/github/client/issues/labels/get_spec.rb +47 -0
- data/spec/github/client/issues/labels/list_spec.rb +102 -0
- data/spec/github/client/issues/labels/remove_spec.rb +57 -0
- data/spec/github/client/issues/labels/replace_spec.rb +48 -0
- data/spec/github/client/issues/labels/update_spec.rb +60 -0
- data/spec/github/client/issues/labels_spec.rb +9 -0
- data/spec/github/client/issues/list_spec.rb +100 -0
- data/spec/github/client/issues/milestones/create_spec.rb +56 -0
- data/spec/github/client/issues/milestones/delete_spec.rb +41 -0
- data/spec/github/client/issues/milestones/get_spec.rb +51 -0
- data/spec/github/client/issues/milestones/list_spec.rb +52 -0
- data/spec/github/client/issues/milestones/update_spec.rb +56 -0
- data/spec/github/client/issues/milestones_spec.rb +11 -0
- data/spec/github/client/orgs/edit_spec.rb +53 -0
- data/spec/github/client/orgs/get_spec.rb +43 -0
- data/spec/github/client/orgs/list_spec.rb +62 -0
- data/spec/github/client/orgs/members/conceal_spec.rb +36 -0
- data/spec/github/client/orgs/members/delete_spec.rb +34 -0
- data/spec/github/client/orgs/members/list_spec.rb +82 -0
- data/spec/github/client/orgs/members/member_spec.rb +66 -0
- data/spec/github/client/orgs/members/publicize_spec.rb +36 -0
- data/spec/github/client/orgs/members_spec.rb +5 -0
- data/spec/github/client/orgs/teams/add_member_spec.rb +40 -0
- data/spec/github/client/orgs/teams/add_repo_spec.rb +39 -0
- data/spec/github/client/orgs/teams/create_spec.rb +58 -0
- data/spec/github/client/orgs/teams/delete_spec.rb +35 -0
- data/spec/github/client/orgs/teams/edit_spec.rb +57 -0
- data/spec/github/client/orgs/teams/get_spec.rb +44 -0
- data/spec/github/client/orgs/teams/list_members_spec.rb +49 -0
- data/spec/github/client/orgs/teams/list_repos_spec.rb +49 -0
- data/spec/github/client/orgs/teams/list_spec.rb +72 -0
- data/spec/github/client/orgs/teams/remove_member_spec.rb +39 -0
- data/spec/github/client/orgs/teams/remove_repo_spec.rb +39 -0
- data/spec/github/client/orgs/teams/team_member_spec.rb +41 -0
- data/spec/github/client/orgs/teams/team_repo_spec.rb +42 -0
- data/spec/github/client/orgs/teams_spec.rb +7 -0
- data/spec/github/client/pull_requests/comments/create_spec.rb +58 -0
- data/spec/github/client/pull_requests/comments/delete_spec.rb +35 -0
- data/spec/github/client/pull_requests/comments/edit_spec.rb +50 -0
- data/spec/github/client/pull_requests/comments/get_spec.rb +51 -0
- data/spec/github/client/pull_requests/comments/list_spec.rb +76 -0
- data/spec/github/client/pull_requests/comments_spec.rb +11 -0
- data/spec/github/client/pull_requests/commits_spec.rb +50 -0
- data/spec/github/client/pull_requests/create_spec.rb +55 -0
- data/spec/github/client/pull_requests/files_spec.rb +50 -0
- data/spec/github/client/pull_requests/get_spec.rb +48 -0
- data/spec/github/client/pull_requests/list_spec.rb +53 -0
- data/spec/github/client/pull_requests/merge_spec.rb +44 -0
- data/spec/github/client/pull_requests/merged_spec.rb +38 -0
- data/spec/github/client/pull_requests/update_spec.rb +55 -0
- data/spec/github/client/repos/assets/delete_spec.rb +39 -0
- data/spec/github/client/repos/assets/edit_spec.rb +40 -0
- data/spec/github/client/repos/assets/get_spec.rb +44 -0
- data/spec/github/client/repos/assets/list_spec.rb +54 -0
- data/spec/github/client/repos/assets/upload_spec.rb +43 -0
- data/spec/github/client/repos/branch_spec.rb +41 -0
- data/spec/github/client/repos/branches_spec.rb +53 -0
- data/spec/github/client/repos/collaborators/add_spec.rb +38 -0
- data/spec/github/client/repos/collaborators/get_spec.rb +49 -0
- data/spec/github/client/repos/collaborators/list_spec.rb +54 -0
- data/spec/github/client/repos/collaborators/remove_spec.rb +38 -0
- data/spec/github/client/repos/collaborators_spec.rb +7 -0
- data/spec/github/client/repos/comments/create_spec.rb +59 -0
- data/spec/github/client/repos/comments/delete_spec.rb +42 -0
- data/spec/github/client/repos/comments/get_spec.rb +51 -0
- data/spec/github/client/repos/comments/list_spec.rb +94 -0
- data/spec/github/client/repos/comments/update_spec.rb +47 -0
- data/spec/github/client/repos/commits/compare_spec.rb +36 -0
- data/spec/github/client/repos/commits/get_spec.rb +49 -0
- data/spec/github/client/repos/commits/list_spec.rb +51 -0
- data/spec/github/client/repos/contents/archive_spec.rb +38 -0
- data/spec/github/client/repos/contents/create_spec.rb +41 -0
- data/spec/github/client/repos/contents/delete_spec.rb +55 -0
- data/spec/github/client/repos/contents/get_spec.rb +35 -0
- data/spec/github/client/repos/contents/readme_spec.rb +30 -0
- data/spec/github/client/repos/contributors_spec.rb +58 -0
- data/spec/github/client/repos/create_spec.rb +77 -0
- data/spec/github/client/repos/delete_spec.rb +37 -0
- data/spec/github/client/repos/deployments/create_spec.rb +54 -0
- data/spec/github/client/repos/deployments/create_status_spec.rb +54 -0
- data/spec/github/client/repos/deployments/list_spec.rb +51 -0
- data/spec/github/client/repos/deployments/statuses_spec.rb +49 -0
- data/spec/github/client/repos/downloads/delete_spec.rb +44 -0
- data/spec/github/client/repos/downloads/get_spec.rb +52 -0
- data/spec/github/client/repos/downloads/list_spec.rb +54 -0
- data/spec/github/client/repos/downloads_spec.rb +13 -0
- data/spec/github/client/repos/edit_spec.rb +59 -0
- data/spec/github/client/repos/forks/create_spec.rb +44 -0
- data/spec/github/client/repos/forks/list_spec.rb +53 -0
- data/spec/github/client/repos/get_spec.rb +50 -0
- data/spec/github/client/repos/hooks/create_spec.rb +67 -0
- data/spec/github/client/repos/hooks/delete_spec.rb +39 -0
- data/spec/github/client/repos/hooks/edit_spec.rb +76 -0
- data/spec/github/client/repos/hooks/get_spec.rb +48 -0
- data/spec/github/client/repos/hooks/list_spec.rb +53 -0
- data/spec/github/client/repos/hooks/ping_spec.rb +39 -0
- data/spec/github/client/repos/hooks/test_spec.rb +39 -0
- data/spec/github/client/repos/hooks_spec.rb +13 -0
- data/spec/github/client/repos/keys/create_spec.rb +49 -0
- data/spec/github/client/repos/keys/delete_spec.rb +39 -0
- data/spec/github/client/repos/keys/get_spec.rb +44 -0
- data/spec/github/client/repos/keys/list_spec.rb +53 -0
- data/spec/github/client/repos/keys_spec.rb +9 -0
- data/spec/github/client/repos/languages_spec.rb +61 -0
- data/spec/github/client/repos/list_spec.rb +120 -0
- data/spec/github/client/repos/merging/merge_spec.rb +59 -0
- data/spec/github/client/repos/pub_sub_hubbub/subscribe_service_spec.rb +26 -0
- data/spec/github/client/repos/pub_sub_hubbub/subscribe_spec.rb +46 -0
- data/spec/github/client/repos/pub_sub_hubbub/unsubscribe_service_spec.rb +20 -0
- data/spec/github/client/repos/pub_sub_hubbub/unsubscribe_spec.rb +58 -0
- data/spec/github/client/repos/releases/create_spec.rb +43 -0
- data/spec/github/client/repos/releases/delete_spec.rb +39 -0
- data/spec/github/client/repos/releases/edit_spec.rb +39 -0
- data/spec/github/client/repos/releases/get_spec.rb +44 -0
- data/spec/github/client/repos/releases/list_spec.rb +53 -0
- data/spec/github/client/repos/statistics/code_frequency_spec.rb +25 -0
- data/spec/github/client/repos/statistics/commit_activity_spec.rb +29 -0
- data/spec/github/client/repos/statistics/contributors_spec.rb +29 -0
- data/spec/github/client/repos/statistics/participation_spec.rb +25 -0
- data/spec/github/client/repos/statistics/punch_card_spec.rb +25 -0
- data/spec/github/client/repos/statuses/create_spec.rb +56 -0
- data/spec/github/client/repos/statuses/list_spec.rb +53 -0
- data/spec/github/client/repos/statuses_spec.rb +11 -0
- data/spec/github/client/repos/tags_spec.rb +59 -0
- data/spec/github/client/repos/teams_spec.rb +59 -0
- data/spec/github/client/scopes/list_spec.rb +33 -0
- data/spec/github/client/search/code_spec.rb +38 -0
- data/spec/github/client/search/issues_spec.rb +38 -0
- data/spec/github/client/search/legacy/email_spec.rb +34 -0
- data/spec/github/client/search/legacy/issues_spec.rb +39 -0
- data/spec/github/client/search/legacy/repos_spec.rb +36 -0
- data/spec/github/client/search/legacy/users_spec.rb +36 -0
- data/spec/github/client/search/repos_spec.rb +38 -0
- data/spec/github/client/search/users_spec.rb +38 -0
- data/spec/github/client/users/emails/add_spec.rb +33 -0
- data/spec/github/client/users/emails/delete_spec.rb +33 -0
- data/spec/github/client/users/emails/list_spec.rb +52 -0
- data/spec/github/client/users/followers/follow_spec.rb +33 -0
- data/spec/github/client/users/followers/following_spec.rb +65 -0
- data/spec/github/client/users/followers/is_following_spec.rb +41 -0
- data/spec/github/client/users/followers/list_spec.rb +62 -0
- data/spec/github/client/users/followers/unfollow_spec.rb +33 -0
- data/spec/github/client/users/get_spec.rb +61 -0
- data/spec/github/client/users/keys/create_spec.rb +51 -0
- data/spec/github/client/users/keys/delete_spec.rb +37 -0
- data/spec/github/client/users/keys/get_spec.rb +50 -0
- data/spec/github/client/users/keys/list_spec.rb +77 -0
- data/spec/github/client/users/keys/update_spec.rb +56 -0
- data/spec/github/client/users/list_spec.rb +45 -0
- data/spec/github/client/users/update_spec.rb +56 -0
- data/spec/github/client_spec.rb +14 -38
- data/spec/github/configuration_spec.rb +22 -27
- data/spec/github/paged_request_spec.rb +1 -1
- data/spec/github/pagination/iterator/number_spec.rb +1 -1
- data/spec/github/pagination/iterator/sha_spec.rb +1 -1
- data/spec/github/request/jsonize_spec.rb +7 -8
- data/spec/github/request/request_spec.rb +3 -1
- data/spec/github/request_spec.rb +11 -5
- data/spec/github/validations/format_spec.rb +1 -1
- data/spec/github_spec.rb +1 -4
- data/spec/integration/activity_spec.rb +5 -5
- data/spec/integration/arguments_spec.rb +11 -17
- data/spec/integration/authorizations_spec.rb +1 -1
- data/spec/integration/gists_spec.rb +2 -2
- data/spec/integration/git_data_spec.rb +6 -6
- data/spec/integration/issues_spec.rb +6 -6
- data/spec/integration/options_spec.rb +7 -6
- data/spec/integration/orgs_spec.rb +6 -4
- data/spec/integration/pull_requests_spec.rb +2 -2
- data/spec/integration/repos_spec.rb +14 -14
- data/spec/integration/search_spec.rb +2 -2
- data/spec/integration/users_spec.rb +4 -4
- data/spec/spec_helper.rb +11 -12
- metadata +544 -602
- data/features/cassettes/activity/events/issue.yml +0 -192
- data/features/cassettes/activity/events/network.yml +0 -134
- data/features/cassettes/activity/events/org.yml +0 -325
- data/features/cassettes/activity/events/performed.yml +0 -362
- data/features/cassettes/activity/events/public.yml +0 -284
- data/features/cassettes/activity/events/received.yml +0 -422
- data/features/cassettes/activity/events/repo.yml +0 -134
- data/features/cassettes/activity/events/user_org.yml +0 -48
- data/features/cassettes/activity/notifications/list_user.yml +0 -54
- data/features/cassettes/activity/starring/list.yml +0 -98
- data/features/cassettes/activity/starring/star.yml +0 -48
- data/features/cassettes/activity/starring/starred.yml +0 -195
- data/features/cassettes/activity/starring/starring.yml +0 -56
- data/features/cassettes/activity/starring/unstar.yml +0 -46
- data/features/cassettes/activity/watching/list.yml +0 -76
- data/features/cassettes/activity/watching/unwatch.yml +0 -46
- data/features/cassettes/activity/watching/watch.yml +0 -48
- data/features/cassettes/activity/watching/watched.yml +0 -166
- data/features/cassettes/activity/watching/watching.yml +0 -56
- data/features/cassettes/arguments/orgs/get.yml +0 -69
- data/features/cassettes/arguments/pulls/get.yml +0 -112
- data/features/cassettes/arguments/repo_commits/get.yml +0 -89
- data/features/cassettes/auto_pagination/repos/get.yml +0 -86
- data/features/cassettes/auto_pagination/repos/global_list.yml +0 -1157
- data/features/cassettes/auto_pagination/repos/list.yml +0 -1235
- data/features/cassettes/emojis/list.yml +0 -258
- data/features/cassettes/errors/repos/create.yml +0 -88
- data/features/cassettes/gists/comments/all.yml +0 -161
- data/features/cassettes/gists/comments/first.yml +0 -86
- data/features/cassettes/gists/fork.yml +0 -78
- data/features/cassettes/gists/gist.yml +0 -105
- data/features/cassettes/gists/gists/public_all.yml +0 -253
- data/features/cassettes/gists/gists/starred.yml +0 -75
- data/features/cassettes/gists/gists/user_all.yml +0 -143
- data/features/cassettes/gists/star.yml +0 -71
- data/features/cassettes/gists/starred.yml +0 -75
- data/features/cassettes/gists/unstar.yml +0 -67
- data/features/cassettes/git_data/commits/get.yml +0 -69
- data/features/cassettes/git_data/references/all.yml +0 -410
- data/features/cassettes/git_data/references/all_tags.yml +0 -172
- data/features/cassettes/git_data/references/one.yml +0 -128
- data/features/cassettes/gitignore/get.yml +0 -60
- data/features/cassettes/gitignore/get_raw.yml +0 -224
- data/features/cassettes/gitignore/list.yml +0 -67
- data/features/cassettes/issues/assignees/ckeck.yml +0 -46
- data/features/cassettes/issues/assignees/ckeck_not.yml +0 -105
- data/features/cassettes/issues/assignees/list.yml +0 -64
- data/features/cassettes/issues/comments/create.yml +0 -55
- data/features/cassettes/issues/comments/delete.yml +0 -46
- data/features/cassettes/issues/comments/edit.yml +0 -53
- data/features/cassettes/issues/comments/get.yml +0 -71
- data/features/cassettes/issues/comments/list_issue.yml +0 -82
- data/features/cassettes/issues/comments/list_repo.yml +0 -266
- data/features/cassettes/issues/create.yml +0 -46
- data/features/cassettes/issues/edit.yml +0 -44
- data/features/cassettes/issues/events/get.yml +0 -139
- data/features/cassettes/issues/events/list_issue.yml +0 -71
- data/features/cassettes/issues/events/list_repo.yml +0 -222
- data/features/cassettes/issues/get.yml +0 -62
- data/features/cassettes/issues/labels/add.yml +0 -52
- data/features/cassettes/issues/labels/create.yml +0 -54
- data/features/cassettes/issues/labels/delete.yml +0 -46
- data/features/cassettes/issues/labels/get.yml +0 -63
- data/features/cassettes/issues/labels/list_issue.yml +0 -64
- data/features/cassettes/issues/labels/list_milestone.yml +0 -65
- data/features/cassettes/issues/labels/list_repo.yml +0 -65
- data/features/cassettes/issues/labels/remove_all.yml +0 -46
- data/features/cassettes/issues/labels/remove_one.yml +0 -46
- data/features/cassettes/issues/labels/replace.yml +0 -52
- data/features/cassettes/issues/labels/update.yml +0 -52
- data/features/cassettes/issues/list/repo.yml +0 -251
- data/features/cassettes/issues/list/user.yml +0 -44
- data/features/cassettes/issues/milestones/create.yml +0 -55
- data/features/cassettes/issues/milestones/delete.yml +0 -46
- data/features/cassettes/issues/milestones/get.yml +0 -175
- data/features/cassettes/issues/milestones/list.yml +0 -54
- data/features/cassettes/issues/milestones/update.yml +0 -53
- data/features/cassettes/markdown/render.yml +0 -46
- data/features/cassettes/markdown/render_raw.yml +0 -46
- data/features/cassettes/media/get_default.yml +0 -84
- data/features/cassettes/media/get_full_json.yml +0 -83
- data/features/cassettes/media/get_html_json.yml +0 -81
- data/features/cassettes/media/get_raw_json.yml +0 -80
- data/features/cassettes/media/get_text_json.yml +0 -80
- data/features/cassettes/meta/get.yml +0 -59
- data/features/cassettes/orgs/get.yml +0 -85
- data/features/cassettes/orgs/list/oauth_user.yml +0 -75
- data/features/cassettes/orgs/list/user.yml +0 -134
- data/features/cassettes/orgs/members/list.yml +0 -139
- data/features/cassettes/orgs/members/list_public.yml +0 -140
- data/features/cassettes/orgs/members/member_false.yml +0 -52
- data/features/cassettes/orgs/members/member_public_false.yml +0 -55
- data/features/cassettes/orgs/members/member_public_true.yml +0 -48
- data/features/cassettes/pagination/issues/list/first.yml +0 -432
- data/features/cassettes/pagination/issues/list/last.yml +0 -297
- data/features/cassettes/pagination/issues/list/next.yml +0 -377
- data/features/cassettes/pagination/issues/list/prev.yml +0 -386
- data/features/cassettes/pagination/repos/commits/list.yml +0 -224
- data/features/cassettes/pagination/repos/commits/next.yml +0 -225
- data/features/cassettes/pagination/repos/commits/sha.yml +0 -181
- data/features/cassettes/pagination/repos/commits/sha/next.yml +0 -205
- data/features/cassettes/pagination/repos/diff.yml +0 -174
- data/features/cassettes/pagination/repos/diff/next.yml +0 -147
- data/features/cassettes/pagination/repos/list.yml +0 -212
- data/features/cassettes/pagination/repos/list/next.yml +0 -184
- data/features/cassettes/pagination/repos/per_page/each_page.yml +0 -497
- data/features/cassettes/pagination/repos/per_page/first.yml +0 -173
- data/features/cassettes/pull_requests/comments/get.yml +0 -159
- data/features/cassettes/pull_requests/comments/list_pull.yml +0 -54
- data/features/cassettes/pull_requests/comments/list_repo.yml +0 -54
- data/features/cassettes/pull_requests/get.yml +0 -120
- data/features/cassettes/pull_requests/list.yml +0 -254
- data/features/cassettes/ratelimit/get.yml +0 -64
- data/features/cassettes/ratelimit/get_remaining.yml +0 -64
- data/features/cassettes/repos/assets/delete.yml +0 -52
- data/features/cassettes/repos/assets/edit.yml +0 -65
- data/features/cassettes/repos/assets/get.yml +0 -74
- data/features/cassettes/repos/assets/list.yml +0 -73
- data/features/cassettes/repos/assets/upload.yml +0 -66
- data/features/cassettes/repos/branch.yml +0 -61
- data/features/cassettes/repos/branches.yml +0 -83
- data/features/cassettes/repos/contents/archive.yml +0 -54
- data/features/cassettes/repos/contents/create.yml +0 -60
- data/features/cassettes/repos/contents/delete.yml +0 -59
- data/features/cassettes/repos/contents/get.yml +0 -226
- data/features/cassettes/repos/contents/readme.yml +0 -271
- data/features/cassettes/repos/contents/update.yml +0 -62
- data/features/cassettes/repos/create.yml +0 -46
- data/features/cassettes/repos/forks/list.yml +0 -314
- data/features/cassettes/repos/forks/list_sort.yml +0 -318
- data/features/cassettes/repos/get.yml +0 -89
- data/features/cassettes/repos/languages.yml +0 -75
- data/features/cassettes/repos/list.yml +0 -123
- data/features/cassettes/repos/list_org.yml +0 -167
- data/features/cassettes/repos/list_org_instance.yml +0 -300
- data/features/cassettes/repos/list_repos.yml +0 -801
- data/features/cassettes/repos/pages/get.yml +0 -71
- data/features/cassettes/repos/pages/list_builds.yml +0 -63
- data/features/cassettes/repos/pages/list_latest_builds.yml +0 -62
- data/features/cassettes/repos/releases/create.yml +0 -64
- data/features/cassettes/repos/releases/delete.yml +0 -52
- data/features/cassettes/repos/releases/edit.yml +0 -63
- data/features/cassettes/repos/releases/get.yml +0 -78
- data/features/cassettes/repos/releases/list.yml +0 -81
- data/features/cassettes/repos/stats/commits.yml +0 -80
- data/features/cassettes/repos/stats/contribs.yml +0 -221
- data/features/cassettes/repos/stats/frequency.yml +0 -54
- data/features/cassettes/repos/stats/participation.yml +0 -68
- data/features/cassettes/repos/stats/punch.yml +0 -76
- data/features/cassettes/repos/statuses/create.yml +0 -52
- data/features/cassettes/repos/statuses/list.yml +0 -64
- data/features/cassettes/repos/tags.yml +0 -102
- data/features/cassettes/repos/teams.yml +0 -48
- data/features/cassettes/say/custom.yml +0 -60
- data/features/cassettes/say/random.yml +0 -60
- data/features/cassettes/search/code.yml +0 -252
- data/features/cassettes/search/code_query.yml +0 -203
- data/features/cassettes/search/code_unicode.yml +0 -93
- data/features/cassettes/search/issues.yml +0 -626
- data/features/cassettes/search/legacy/email.yml +0 -72
- data/features/cassettes/search/legacy/issues.yml +0 -119
- data/features/cassettes/search/legacy/repos.yml +0 -394
- data/features/cassettes/search/legacy/users.yml +0 -72
- data/features/cassettes/search/legacy/users_keyword.yml +0 -63
- data/features/cassettes/search/repos.yml +0 -407
- data/features/cassettes/search/users.yml +0 -72
- data/features/cassettes/search/users_keyword.yml +0 -65
- data/features/cassettes/users/all.yml +0 -256
- data/features/cassettes/users/emails/add.yml +0 -75
- data/features/cassettes/users/emails/all.yml +0 -75
- data/features/cassettes/users/emails/delete.yml +0 -40
- data/lib/github_api/activity.rb +0 -33
- data/lib/github_api/activity/events.rb +0 -206
- data/lib/github_api/activity/notifications.rb +0 -157
- data/lib/github_api/activity/starring.rb +0 -94
- data/lib/github_api/activity/watching.rb +0 -92
- data/lib/github_api/api_factory.rb +0 -31
- data/lib/github_api/arguments.rb +0 -166
- data/lib/github_api/authorizations.rb +0 -140
- data/lib/github_api/authorizations/app.rb +0 -77
- data/lib/github_api/compatibility.rb +0 -23
- data/lib/github_api/emojis.rb +0 -20
- data/lib/github_api/gists.rb +0 -205
- data/lib/github_api/gists/comments.rb +0 -87
- data/lib/github_api/git_data.rb +0 -39
- data/lib/github_api/git_data/blobs.rb +0 -46
- data/lib/github_api/git_data/commits.rb +0 -83
- data/lib/github_api/git_data/references.rb +0 -133
- data/lib/github_api/git_data/tags.rb +0 -78
- data/lib/github_api/git_data/trees.rb +0 -92
- data/lib/github_api/gitignore.rb +0 -50
- data/lib/github_api/issues.rb +0 -238
- data/lib/github_api/issues/assignees.rb +0 -44
- data/lib/github_api/issues/comments.rb +0 -115
- data/lib/github_api/issues/events.rb +0 -47
- data/lib/github_api/issues/labels.rb +0 -167
- data/lib/github_api/issues/milestones.rb +0 -125
- data/lib/github_api/markdown.rb +0 -60
- data/lib/github_api/meta.rb +0 -19
- data/lib/github_api/orgs.rb +0 -94
- data/lib/github_api/orgs/members.rb +0 -108
- data/lib/github_api/orgs/teams.rb +0 -243
- data/lib/github_api/pull_requests.rb +0 -192
- data/lib/github_api/pull_requests/comments.rb +0 -144
- data/lib/github_api/repos.rb +0 -449
- data/lib/github_api/repos/collaborators.rb +0 -73
- data/lib/github_api/repos/comments.rb +0 -117
- data/lib/github_api/repos/commits.rb +0 -71
- data/lib/github_api/repos/contents.rb +0 -188
- data/lib/github_api/repos/deployments.rb +0 -8
- data/lib/github_api/repos/downloads.rb +0 -112
- data/lib/github_api/repos/forks.rb +0 -42
- data/lib/github_api/repos/hooks.rb +0 -154
- data/lib/github_api/repos/keys.rb +0 -96
- data/lib/github_api/repos/merging.rb +0 -42
- data/lib/github_api/repos/pages.rb +0 -49
- data/lib/github_api/repos/pub_sub_hubbub.rb +0 -117
- data/lib/github_api/repos/releases.rb +0 -144
- data/lib/github_api/repos/releases/assets.rb +0 -126
- data/lib/github_api/repos/statistics.rb +0 -94
- data/lib/github_api/repos/statuses.rb +0 -63
- data/lib/github_api/s3_uploader.rb +0 -57
- data/lib/github_api/say.rb +0 -23
- data/lib/github_api/scopes.rb +0 -20
- data/lib/github_api/search.rb +0 -125
- data/lib/github_api/search/legacy.rb +0 -94
- data/lib/github_api/users.rb +0 -112
- data/lib/github_api/users/emails.rb +0 -58
- data/lib/github_api/users/followers.rb +0 -99
- data/lib/github_api/users/keys.rb +0 -92
- data/spec/github/activity/events/issue_spec.rb +0 -51
- data/spec/github/activity/events/network_spec.rb +0 -49
- data/spec/github/activity/events/org_spec.rb +0 -50
- data/spec/github/activity/events/performed_spec.rb +0 -73
- data/spec/github/activity/events/public_spec.rb +0 -44
- data/spec/github/activity/events/received_spec.rb +0 -72
- data/spec/github/activity/events/repository_spec.rb +0 -53
- data/spec/github/activity/events/user_org_spec.rb +0 -53
- data/spec/github/activity/notifications/create_spec.rb +0 -44
- data/spec/github/activity/notifications/delete_spec.rb +0 -41
- data/spec/github/activity/notifications/get_spec.rb +0 -58
- data/spec/github/activity/notifications/list_spec.rb +0 -75
- data/spec/github/activity/notifications/mark_spec.rb +0 -74
- data/spec/github/activity/notifications/subscribed_spec.rb +0 -48
- data/spec/github/activity/starring/list_spec.rb +0 -53
- data/spec/github/activity/starring/star_spec.rb +0 -36
- data/spec/github/activity/starring/starred_spec.rb +0 -53
- data/spec/github/activity/starring/starring_spec.rb +0 -38
- data/spec/github/activity/starring/unstar_spec.rb +0 -37
- data/spec/github/activity/watching/list_spec.rb +0 -47
- data/spec/github/activity/watching/unwatch_spec.rb +0 -37
- data/spec/github/activity/watching/watch_spec.rb +0 -37
- data/spec/github/activity/watching/watched_spec.rb +0 -53
- data/spec/github/activity/watching/watching_spec.rb +0 -39
- data/spec/github/arguments/parse_spec.rb +0 -68
- data/spec/github/authorizations/app/create_spec.rb +0 -44
- data/spec/github/authorizations/app/delete_spec.rb +0 -59
- data/spec/github/authorizations/create_spec.rb +0 -49
- data/spec/github/authorizations/delete_spec.rb +0 -40
- data/spec/github/authorizations/get_spec.rb +0 -49
- data/spec/github/authorizations/list_spec.rb +0 -55
- data/spec/github/authorizations/update_spec.rb +0 -50
- data/spec/github/gists/comments/create_spec.rb +0 -51
- data/spec/github/gists/comments/delete_spec.rb +0 -32
- data/spec/github/gists/comments/edit_spec.rb +0 -52
- data/spec/github/gists/comments/get_spec.rb +0 -48
- data/spec/github/gists/comments/list_spec.rb +0 -51
- data/spec/github/gists/comments_spec.rb +0 -11
- data/spec/github/gists/create_spec.rb +0 -64
- data/spec/github/gists/delete_spec.rb +0 -31
- data/spec/github/gists/edit_spec.rb +0 -60
- data/spec/github/gists/fork_spec.rb +0 -41
- data/spec/github/gists/get_spec.rb +0 -47
- data/spec/github/gists/is_starred_spec.rb +0 -44
- data/spec/github/gists/list_spec.rb +0 -78
- data/spec/github/gists/star_spec.rb +0 -30
- data/spec/github/gists/starred_spec.rb +0 -44
- data/spec/github/gists/unstar_spec.rb +0 -30
- data/spec/github/git_data/blobs/create_spec.rb +0 -64
- data/spec/github/git_data/blobs/get_spec.rb +0 -49
- data/spec/github/git_data/blobs_spec.rb +0 -9
- data/spec/github/git_data/commits/create_spec.rb +0 -77
- data/spec/github/git_data/commits/get_spec.rb +0 -50
- data/spec/github/git_data/commits_spec.rb +0 -9
- data/spec/github/git_data/references/create_spec.rb +0 -67
- data/spec/github/git_data/references/delete_spec.rb +0 -40
- data/spec/github/git_data/references/get_spec.rb +0 -56
- data/spec/github/git_data/references/list_spec.rb +0 -111
- data/spec/github/git_data/references/update_spec.rb +0 -62
- data/spec/github/git_data/references_spec.rb +0 -11
- data/spec/github/git_data/tags/create_spec.rb +0 -63
- data/spec/github/git_data/tags/get_spec.rb +0 -48
- data/spec/github/git_data/tags_spec.rb +0 -9
- data/spec/github/git_data/trees/create_spec.rb +0 -68
- data/spec/github/git_data/trees/get_spec.rb +0 -69
- data/spec/github/git_data/trees_spec.rb +0 -9
- data/spec/github/gitignore/get_spec.rb +0 -54
- data/spec/github/gitignore/list_spec.rb +0 -42
- data/spec/github/issues/assignees/check_spec.rb +0 -46
- data/spec/github/issues/assignees/list_spec.rb +0 -47
- data/spec/github/issues/assignees_spec.rb +0 -5
- data/spec/github/issues/comments/create_spec.rb +0 -50
- data/spec/github/issues/comments/delete_spec.rb +0 -36
- data/spec/github/issues/comments/edit_spec.rb +0 -50
- data/spec/github/issues/comments/get_spec.rb +0 -49
- data/spec/github/issues/comments/list_spec.rb +0 -79
- data/spec/github/issues/comments_spec.rb +0 -9
- data/spec/github/issues/create_spec.rb +0 -60
- data/spec/github/issues/edit_spec.rb +0 -61
- data/spec/github/issues/events/get_spec.rb +0 -51
- data/spec/github/issues/events/list_spec.rb +0 -86
- data/spec/github/issues/events_spec.rb +0 -7
- data/spec/github/issues/get_spec.rb +0 -49
- data/spec/github/issues/labels/add_spec.rb +0 -50
- data/spec/github/issues/labels/create_spec.rb +0 -59
- data/spec/github/issues/labels/delete_spec.rb +0 -39
- data/spec/github/issues/labels/get_spec.rb +0 -47
- data/spec/github/issues/labels/list_spec.rb +0 -102
- data/spec/github/issues/labels/remove_spec.rb +0 -58
- data/spec/github/issues/labels/replace_spec.rb +0 -49
- data/spec/github/issues/labels/update_spec.rb +0 -61
- data/spec/github/issues/labels_spec.rb +0 -7
- data/spec/github/issues/list_spec.rb +0 -100
- data/spec/github/issues/milestones/create_spec.rb +0 -56
- data/spec/github/issues/milestones/delete_spec.rb +0 -42
- data/spec/github/issues/milestones/get_spec.rb +0 -51
- data/spec/github/issues/milestones/list_spec.rb +0 -52
- data/spec/github/issues/milestones/update_spec.rb +0 -57
- data/spec/github/issues/milestones_spec.rb +0 -11
- data/spec/github/orgs/edit_spec.rb +0 -54
- data/spec/github/orgs/get_spec.rb +0 -44
- data/spec/github/orgs/list_spec.rb +0 -63
- data/spec/github/orgs/members/conceal_spec.rb +0 -37
- data/spec/github/orgs/members/delete_spec.rb +0 -35
- data/spec/github/orgs/members/list_spec.rb +0 -82
- data/spec/github/orgs/members/member_spec.rb +0 -67
- data/spec/github/orgs/members/publicize_spec.rb +0 -37
- data/spec/github/orgs/members_spec.rb +0 -5
- data/spec/github/orgs/teams/add_member_spec.rb +0 -40
- data/spec/github/orgs/teams/add_repo_spec.rb +0 -39
- data/spec/github/orgs/teams/create_spec.rb +0 -58
- data/spec/github/orgs/teams/delete_spec.rb +0 -36
- data/spec/github/orgs/teams/edit_spec.rb +0 -57
- data/spec/github/orgs/teams/get_spec.rb +0 -45
- data/spec/github/orgs/teams/list_members_spec.rb +0 -49
- data/spec/github/orgs/teams/list_repos_spec.rb +0 -49
- data/spec/github/orgs/teams/list_spec.rb +0 -49
- data/spec/github/orgs/teams/remove_member_spec.rb +0 -40
- data/spec/github/orgs/teams/remove_repo_spec.rb +0 -40
- data/spec/github/orgs/teams/team_member_spec.rb +0 -42
- data/spec/github/orgs/teams/team_repo_spec.rb +0 -43
- data/spec/github/orgs/teams_spec.rb +0 -7
- data/spec/github/pull_requests/comments/create_spec.rb +0 -59
- data/spec/github/pull_requests/comments/delete_spec.rb +0 -35
- data/spec/github/pull_requests/comments/edit_spec.rb +0 -51
- data/spec/github/pull_requests/comments/get_spec.rb +0 -52
- data/spec/github/pull_requests/comments/list_spec.rb +0 -76
- data/spec/github/pull_requests/comments_spec.rb +0 -11
- data/spec/github/pull_requests/commits_spec.rb +0 -51
- data/spec/github/pull_requests/create_spec.rb +0 -56
- data/spec/github/pull_requests/files_spec.rb +0 -51
- data/spec/github/pull_requests/get_spec.rb +0 -49
- data/spec/github/pull_requests/list_spec.rb +0 -54
- data/spec/github/pull_requests/merge_spec.rb +0 -44
- data/spec/github/pull_requests/merged_spec.rb +0 -39
- data/spec/github/pull_requests/update_spec.rb +0 -55
- data/spec/github/repos/assets/delete_spec.rb +0 -40
- data/spec/github/repos/assets/edit_spec.rb +0 -40
- data/spec/github/repos/assets/get_spec.rb +0 -45
- data/spec/github/repos/assets/list_spec.rb +0 -55
- data/spec/github/repos/assets/upload_spec.rb +0 -44
- data/spec/github/repos/branch_spec.rb +0 -42
- data/spec/github/repos/branches_spec.rb +0 -54
- data/spec/github/repos/collaborators/add_spec.rb +0 -39
- data/spec/github/repos/collaborators/get_spec.rb +0 -49
- data/spec/github/repos/collaborators/list_spec.rb +0 -55
- data/spec/github/repos/collaborators/remove_spec.rb +0 -39
- data/spec/github/repos/collaborators_spec.rb +0 -7
- data/spec/github/repos/comments/create_spec.rb +0 -59
- data/spec/github/repos/comments/delete_spec.rb +0 -43
- data/spec/github/repos/comments/get_spec.rb +0 -52
- data/spec/github/repos/comments/list_spec.rb +0 -96
- data/spec/github/repos/comments/update_spec.rb +0 -48
- data/spec/github/repos/commits/compare_spec.rb +0 -37
- data/spec/github/repos/commits/get_spec.rb +0 -50
- data/spec/github/repos/commits/list_spec.rb +0 -52
- data/spec/github/repos/contents/archive_spec.rb +0 -38
- data/spec/github/repos/contents/create_spec.rb +0 -41
- data/spec/github/repos/contents/delete_spec.rb +0 -55
- data/spec/github/repos/contents/get_spec.rb +0 -35
- data/spec/github/repos/contents/readme_spec.rb +0 -30
- data/spec/github/repos/contributors_spec.rb +0 -59
- data/spec/github/repos/create_spec.rb +0 -77
- data/spec/github/repos/delete_spec.rb +0 -38
- data/spec/github/repos/downloads/create_spec.rb +0 -64
- data/spec/github/repos/downloads/delete_spec.rb +0 -45
- data/spec/github/repos/downloads/get_spec.rb +0 -53
- data/spec/github/repos/downloads/list_spec.rb +0 -55
- data/spec/github/repos/downloads/upload_spec.rb +0 -32
- data/spec/github/repos/downloads_spec.rb +0 -13
- data/spec/github/repos/edit_spec.rb +0 -60
- data/spec/github/repos/forks/create_spec.rb +0 -45
- data/spec/github/repos/forks/list_spec.rb +0 -54
- data/spec/github/repos/get_spec.rb +0 -51
- data/spec/github/repos/hooks/create_spec.rb +0 -68
- data/spec/github/repos/hooks/delete_spec.rb +0 -40
- data/spec/github/repos/hooks/edit_spec.rb +0 -77
- data/spec/github/repos/hooks/get_spec.rb +0 -49
- data/spec/github/repos/hooks/list_spec.rb +0 -54
- data/spec/github/repos/hooks/test_spec.rb +0 -40
- data/spec/github/repos/hooks_spec.rb +0 -13
- data/spec/github/repos/keys/create_spec.rb +0 -50
- data/spec/github/repos/keys/delete_spec.rb +0 -40
- data/spec/github/repos/keys/edit_spec.rb +0 -42
- data/spec/github/repos/keys/get_spec.rb +0 -45
- data/spec/github/repos/keys/list_spec.rb +0 -54
- data/spec/github/repos/keys_spec.rb +0 -9
- data/spec/github/repos/languages_spec.rb +0 -61
- data/spec/github/repos/list_spec.rb +0 -120
- data/spec/github/repos/merging/merge_spec.rb +0 -58
- data/spec/github/repos/pub_sub_hubbub/subscribe_service_spec.rb +0 -27
- data/spec/github/repos/pub_sub_hubbub/subscribe_spec.rb +0 -47
- data/spec/github/repos/pub_sub_hubbub/unsubscribe_service_spec.rb +0 -21
- data/spec/github/repos/pub_sub_hubbub/unsubscribe_spec.rb +0 -58
- data/spec/github/repos/releases/create_spec.rb +0 -44
- data/spec/github/repos/releases/delete_spec.rb +0 -40
- data/spec/github/repos/releases/edit_spec.rb +0 -40
- data/spec/github/repos/releases/get_spec.rb +0 -45
- data/spec/github/repos/releases/list_spec.rb +0 -54
- data/spec/github/repos/statistics/code_frequency_spec.rb +0 -25
- data/spec/github/repos/statistics/commit_activity_spec.rb +0 -29
- data/spec/github/repos/statistics/contributors_spec.rb +0 -29
- data/spec/github/repos/statistics/participation_spec.rb +0 -25
- data/spec/github/repos/statistics/punch_card_spec.rb +0 -25
- data/spec/github/repos/statuses/create_spec.rb +0 -56
- data/spec/github/repos/statuses/list_spec.rb +0 -53
- data/spec/github/repos/statuses_spec.rb +0 -11
- data/spec/github/repos/tags_spec.rb +0 -59
- data/spec/github/repos/teams_spec.rb +0 -59
- data/spec/github/s3_uploader_spec.rb +0 -51
- data/spec/github/scopes/list_spec.rb +0 -33
- data/spec/github/search/code_spec.rb +0 -38
- data/spec/github/search/issues_spec.rb +0 -38
- data/spec/github/search/legacy/email_spec.rb +0 -34
- data/spec/github/search/legacy/issues_spec.rb +0 -39
- data/spec/github/search/legacy/repos_spec.rb +0 -36
- data/spec/github/search/legacy/users_spec.rb +0 -36
- data/spec/github/search/repos_spec.rb +0 -38
- data/spec/github/search/users_spec.rb +0 -38
- data/spec/github/users/emails/add_spec.rb +0 -33
- data/spec/github/users/emails/delete_spec.rb +0 -33
- data/spec/github/users/emails/list_spec.rb +0 -52
- data/spec/github/users/followers/follow_spec.rb +0 -33
- data/spec/github/users/followers/following_spec.rb +0 -65
- data/spec/github/users/followers/is_following_spec.rb +0 -41
- data/spec/github/users/followers/list_spec.rb +0 -62
- data/spec/github/users/followers/unfollow_spec.rb +0 -33
- data/spec/github/users/get_spec.rb +0 -61
- data/spec/github/users/keys/create_spec.rb +0 -51
- data/spec/github/users/keys/delete_spec.rb +0 -37
- data/spec/github/users/keys/get_spec.rb +0 -50
- data/spec/github/users/keys/list_spec.rb +0 -78
- data/spec/github/users/keys/update_spec.rb +0 -56
- data/spec/github/users/list_spec.rb +0 -45
- data/spec/github/users/update_spec.rb +0 -56
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
module Github
|
|
4
|
-
class PullRequests < API
|
|
5
|
-
|
|
6
|
-
Github::require_all 'github_api/pull_requests',
|
|
7
|
-
'comments'
|
|
8
|
-
|
|
9
|
-
VALID_REQUEST_PARAM_NAMES = %w[
|
|
10
|
-
title
|
|
11
|
-
body
|
|
12
|
-
base
|
|
13
|
-
head
|
|
14
|
-
state
|
|
15
|
-
issue
|
|
16
|
-
commit_message
|
|
17
|
-
mime_type
|
|
18
|
-
resource
|
|
19
|
-
].freeze
|
|
20
|
-
|
|
21
|
-
VALID_REQUEST_PARAM_VALUES = {
|
|
22
|
-
'state' => %w[ open closed ]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
# Access to PullRequests::Comments API
|
|
26
|
-
def comments(options={}, &block)
|
|
27
|
-
@comments ||= ApiFactory.new('PullRequests::Comments', current_options.merge(options), &block)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# List pull requests
|
|
31
|
-
#
|
|
32
|
-
# = Examples
|
|
33
|
-
# github = Github.new :user => 'user-name', :repo => 'repo-name'
|
|
34
|
-
# github.pull_requests.list
|
|
35
|
-
# github.pull_requests.list { |req| ... }
|
|
36
|
-
#
|
|
37
|
-
# pulls = Github::PullRequests.new
|
|
38
|
-
# pulls.pull_requests.list 'user-name', 'repo-name'
|
|
39
|
-
#
|
|
40
|
-
def list(*args)
|
|
41
|
-
arguments(args, :required => [:user, :repo]) do
|
|
42
|
-
sift VALID_REQUEST_PARAM_NAMES
|
|
43
|
-
assert_values VALID_REQUEST_PARAM_VALUES
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
response = get_request("/repos/#{user}/#{repo}/pulls", arguments.params)
|
|
47
|
-
return response unless block_given?
|
|
48
|
-
response.each { |el| yield el }
|
|
49
|
-
end
|
|
50
|
-
alias :all :list
|
|
51
|
-
|
|
52
|
-
# Get a single pull request
|
|
53
|
-
#
|
|
54
|
-
# = Examples
|
|
55
|
-
# github = Github.new
|
|
56
|
-
# github.pull_requests.get 'user-name', 'repo-name', 'number'
|
|
57
|
-
#
|
|
58
|
-
# pulls = Github::PullRequests.new
|
|
59
|
-
# pulls.get 'user-name', 'repo-name', 'number'
|
|
60
|
-
#
|
|
61
|
-
def get(*args)
|
|
62
|
-
arguments(args, :required => [:user, :repo, :number])
|
|
63
|
-
|
|
64
|
-
get_request("/repos/#{user}/#{repo}/pulls/#{number}", arguments.params)
|
|
65
|
-
end
|
|
66
|
-
alias :find :get
|
|
67
|
-
|
|
68
|
-
# Create a pull request
|
|
69
|
-
#
|
|
70
|
-
# = Inputs
|
|
71
|
-
# * <tt>:title</tt> - Required string
|
|
72
|
-
# * <tt>:body</tt> - Optional string
|
|
73
|
-
# * <tt>:base</tt> - Required string - The branch you want your changes pulled into.
|
|
74
|
-
# * <tt>:head</tt> - Required string - The branch where your changes are implemented.
|
|
75
|
-
# note: head and base can be either a sha or a branch name.
|
|
76
|
-
# Typically you would namespace head with a user like this: username:branch.
|
|
77
|
-
# = Alternative Input
|
|
78
|
-
# You can also create a Pull Request from an existing Issue by passing
|
|
79
|
-
# an Issue number instead of <tt>title</tt> and <tt>body</tt>.
|
|
80
|
-
# * <tt>issue</tt> - Required number - Issue number in this repository to turn into a Pull Request.
|
|
81
|
-
#
|
|
82
|
-
# = Examples
|
|
83
|
-
# github = Github.new :oauth_token => '...'
|
|
84
|
-
# github.pull_requests.create 'user-name', 'repo-name',
|
|
85
|
-
# "title" => "Amazing new feature",
|
|
86
|
-
# "body" => "Please pull this in!",
|
|
87
|
-
# "head" => "octocat:new-feature",
|
|
88
|
-
# "base" => "master"
|
|
89
|
-
#
|
|
90
|
-
# alternatively
|
|
91
|
-
#
|
|
92
|
-
# github.pull_requests.create 'user-name', 'repo-name',
|
|
93
|
-
# "issue" => "5",
|
|
94
|
-
# "head" => "octocat:new-feature",
|
|
95
|
-
# "base" => "master"
|
|
96
|
-
#
|
|
97
|
-
def create(*args)
|
|
98
|
-
arguments(args, :required => [:user, :repo]) do
|
|
99
|
-
sift VALID_REQUEST_PARAM_NAMES
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
post_request("/repos/#{user}/#{repo}/pulls", arguments.params)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
# Update a pull request
|
|
106
|
-
#
|
|
107
|
-
# = Inputs
|
|
108
|
-
# * <tt>:title</tt> - Optional string
|
|
109
|
-
# * <tt>:body</tt> - Optional string
|
|
110
|
-
# * <tt>:state</tt> - Optional string - State of this Pull Request. Valid values are <tt>open</tt> and <tt>closed</tt>.
|
|
111
|
-
#
|
|
112
|
-
# = Examples
|
|
113
|
-
# github = Github.new :oauth_token => '...'
|
|
114
|
-
# github.pull_requests.update 'user-name', 'repo-name', 'number'
|
|
115
|
-
# "title" => "Amazing new title",
|
|
116
|
-
# "body" => "Update body",
|
|
117
|
-
# "state" => "open",
|
|
118
|
-
#
|
|
119
|
-
def update(*args)
|
|
120
|
-
arguments(args, :required => [:user, :repo, :number]) do
|
|
121
|
-
sift VALID_REQUEST_PARAM_NAMES
|
|
122
|
-
assert_values VALID_REQUEST_PARAM_VALUES
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
patch_request("/repos/#{user}/#{repo}/pulls/#{number}", arguments.params)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# List commits on a pull request
|
|
129
|
-
#
|
|
130
|
-
# = Examples
|
|
131
|
-
# github = Github.new
|
|
132
|
-
# github.pull_requests.commits 'user-name', 'repo-name', 'number'
|
|
133
|
-
#
|
|
134
|
-
def commits(*args)
|
|
135
|
-
arguments(args, :required => [:user, :repo, :number])
|
|
136
|
-
|
|
137
|
-
response = get_request("/repos/#{user}/#{repo}/pulls/#{number}/commits",
|
|
138
|
-
arguments.params)
|
|
139
|
-
return response unless block_given?
|
|
140
|
-
response.each { |el| yield el }
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# List pull requests files
|
|
144
|
-
#
|
|
145
|
-
# = Examples
|
|
146
|
-
# github = Github.new
|
|
147
|
-
# github.pull_requests.files 'user-name', 'repo-name', 'number'
|
|
148
|
-
#
|
|
149
|
-
def files(*args)
|
|
150
|
-
arguments(args, :required => [:user, :repo, :number])
|
|
151
|
-
|
|
152
|
-
response = get_request("/repos/#{user}/#{repo}/pulls/#{number}/files",
|
|
153
|
-
arguments.params)
|
|
154
|
-
return response unless block_given?
|
|
155
|
-
response.each { |el| yield el }
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
# Check if pull request has been merged
|
|
159
|
-
#
|
|
160
|
-
# = Examples
|
|
161
|
-
# github = Github.new
|
|
162
|
-
# github.pull_requests.merged? 'user-name', 'repo-name', 'number'
|
|
163
|
-
#
|
|
164
|
-
def merged?(*args)
|
|
165
|
-
arguments(args, :required => [:user, :repo, :number])
|
|
166
|
-
|
|
167
|
-
get_request("/repos/#{user}/#{repo}/pulls/#{number}/merge", arguments.params)
|
|
168
|
-
true
|
|
169
|
-
rescue Github::Error::NotFound
|
|
170
|
-
false
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# Merge a pull request(Merge Button)
|
|
174
|
-
#
|
|
175
|
-
# = Inputs
|
|
176
|
-
# <tt>:commit_message</tt> - Optional string -
|
|
177
|
-
# The message that will be used for the merge commit
|
|
178
|
-
#
|
|
179
|
-
# = Examples
|
|
180
|
-
# github = Github.new
|
|
181
|
-
# github.pull_requests.merge 'user-name', 'repo-name', 'number'
|
|
182
|
-
#
|
|
183
|
-
def merge(*args)
|
|
184
|
-
arguments(args, :required => [:user, :repo, :number]) do
|
|
185
|
-
sift VALID_REQUEST_PARAM_NAMES
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
put_request("/repos/#{user}/#{repo}/pulls/#{number}/merge", arguments.params)
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
end # PullRequests
|
|
192
|
-
end # Github
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
module Github
|
|
4
|
-
class PullRequests::Comments < API
|
|
5
|
-
|
|
6
|
-
VALID_REQUEST_COM_PARAM_NAMES = %w[
|
|
7
|
-
body
|
|
8
|
-
commit_id
|
|
9
|
-
path
|
|
10
|
-
position
|
|
11
|
-
in_reply_to
|
|
12
|
-
mime_type
|
|
13
|
-
resource
|
|
14
|
-
].freeze
|
|
15
|
-
|
|
16
|
-
# List comments on a pull request
|
|
17
|
-
#
|
|
18
|
-
# = Examples
|
|
19
|
-
# github = Github.new
|
|
20
|
-
# github.pull_requests.comments.list 'user-name', 'repo-name', request_id: 'id'
|
|
21
|
-
#
|
|
22
|
-
# List comments in a repository
|
|
23
|
-
#
|
|
24
|
-
# By default, Review Comments are ordered by ascending ID.
|
|
25
|
-
#
|
|
26
|
-
# = Parameters
|
|
27
|
-
#
|
|
28
|
-
# * <tt>:sort</tt> - Optional string, <tt>created</tt> or <tt>updated</tt>
|
|
29
|
-
# * <tt>:direction</tt> - Optional string, <tt>asc</tt> or <tt>desc</tt>.
|
|
30
|
-
# Ignored with sort parameter.
|
|
31
|
-
# * <tt>:since</tt> - Optional string of a timestamp in ISO 8601
|
|
32
|
-
# format: YYYY-MM-DDTHH:MM:SSZ
|
|
33
|
-
# = Examples
|
|
34
|
-
# github = Github.new
|
|
35
|
-
# github.pull_requests.comments.list 'user-name', 'repo-name'
|
|
36
|
-
# github.pull_requests.comments.list 'user-name', 'repo-name' { |comm| ... }
|
|
37
|
-
#
|
|
38
|
-
def list(*args)
|
|
39
|
-
arguments(args, :required => [:user, :repo])
|
|
40
|
-
params = arguments.params
|
|
41
|
-
|
|
42
|
-
response = if (request_id = params.delete('request_id'))
|
|
43
|
-
get_request("/repos/#{user}/#{repo}/pulls/#{request_id}/comments", params)
|
|
44
|
-
else
|
|
45
|
-
get_request("/repos/#{user}/#{repo}/pulls/comments", params)
|
|
46
|
-
end
|
|
47
|
-
return response unless block_given?
|
|
48
|
-
response.each { |el| yield el }
|
|
49
|
-
end
|
|
50
|
-
alias :all :list
|
|
51
|
-
|
|
52
|
-
# Get a single comment for pull requests
|
|
53
|
-
# = Examples
|
|
54
|
-
# github = Github.new
|
|
55
|
-
# github.pull_requests.comments.get 'user-name', 'repo-name', 'comment-id'
|
|
56
|
-
#
|
|
57
|
-
def get(*args)
|
|
58
|
-
arguments(args, :required => [:user, :repo, :comment_id])
|
|
59
|
-
|
|
60
|
-
get_request("/repos/#{user}/#{repo}/pulls/comments/#{comment_id}", arguments.params)
|
|
61
|
-
end
|
|
62
|
-
alias :find :get
|
|
63
|
-
|
|
64
|
-
# Create a pull request comment
|
|
65
|
-
#
|
|
66
|
-
# = Inputs
|
|
67
|
-
# * <tt>:body</tt> - Required string
|
|
68
|
-
# * <tt>:commit_id</tt> - Required string - sha of the commit to comment on.
|
|
69
|
-
# * <tt>:path</tt> - Required string - Relative path of the file to comment on.
|
|
70
|
-
# * <tt>:position</tt> - Required number - Line index in the diff to comment on
|
|
71
|
-
#
|
|
72
|
-
# = Examples
|
|
73
|
-
# github = Github.new
|
|
74
|
-
# github.pull_requests.comments.create 'user-name','repo-name','request-id',
|
|
75
|
-
# "body" => "Nice change",
|
|
76
|
-
# "commit_id" => "6dcb09b5b57875f334f61aebed695e2e4193db5e",
|
|
77
|
-
# "path" => "file1.txt",
|
|
78
|
-
# "position" => 4
|
|
79
|
-
#
|
|
80
|
-
# = Alternative Inputs
|
|
81
|
-
# Instead of passing commit_id, path, and position you can reply to
|
|
82
|
-
# an existing Pull Request Comment like this
|
|
83
|
-
# * <tt>:body</tt> - Required string
|
|
84
|
-
# * <tt>:in_reply_to</tt> - Required number - comment id to reply to.
|
|
85
|
-
#
|
|
86
|
-
# = Examples
|
|
87
|
-
# github = Github.new
|
|
88
|
-
# github.pull_requests.comments.create 'user-name','repo-name','request-id',
|
|
89
|
-
# "body" => "Nice change",
|
|
90
|
-
# "in_reply_to" => 4
|
|
91
|
-
#
|
|
92
|
-
def create(*args)
|
|
93
|
-
arguments(args, :required => [:user, :repo, :request_id]) do
|
|
94
|
-
sift VALID_REQUEST_COM_PARAM_NAMES
|
|
95
|
-
end
|
|
96
|
-
# _validate_reply_to(params)
|
|
97
|
-
|
|
98
|
-
post_request("/repos/#{user}/#{repo}/pulls/#{request_id}/comments", arguments.params)
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
# Edit a pull request comment
|
|
102
|
-
#
|
|
103
|
-
# = Inputs
|
|
104
|
-
# * <tt>:body</tt> - Required string
|
|
105
|
-
#
|
|
106
|
-
# = Examples
|
|
107
|
-
# github = Github.new
|
|
108
|
-
# github.pull_requests.comments.edit 'user-name', 'repo-name','comment-id',
|
|
109
|
-
# "body" => "Nice change"
|
|
110
|
-
#
|
|
111
|
-
def edit(*args)
|
|
112
|
-
arguments(args, :required => [:user, :repo, :comment_id]) do
|
|
113
|
-
sift VALID_REQUEST_COM_PARAM_NAMES
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
patch_request("/repos/#{user}/#{repo}/pulls/comments/#{comment_id}", arguments.params)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# Delete a pull request comment
|
|
120
|
-
#
|
|
121
|
-
# = Examples
|
|
122
|
-
# github = Github.new
|
|
123
|
-
# github.pull_requests.comments.delete 'user-name', 'repo-name','comment-id'
|
|
124
|
-
#
|
|
125
|
-
def delete(*args)
|
|
126
|
-
arguments(args, :required => [:user, :repo, :comment_id])
|
|
127
|
-
|
|
128
|
-
delete_request("/repos/#{user}/#{repo}/pulls/comments/#{comment_id}", arguments.params)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
private
|
|
132
|
-
|
|
133
|
-
# To let user know that the params supplied are wrong before request is made
|
|
134
|
-
def _validate_reply_to(params)
|
|
135
|
-
if params['in_reply_to'] && !assert_required_keys(%w[ body in_reply_to ], params)
|
|
136
|
-
raise ArgumentError, "Required params are: #{%w[ body in_reply_to].join(',')}"
|
|
137
|
-
|
|
138
|
-
elsif !assert_required_keys(VALID_REQUEST_COM_PARAM_NAMES - %w[ in_reply_to ], params)
|
|
139
|
-
raise ArgumentError, "Required params are: #{VALID_REQUEST_COM_PARAM_NAMES.join(', ')}"
|
|
140
|
-
end
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
end # PullRequests::Comments
|
|
144
|
-
end # Github
|
data/lib/github_api/repos.rb
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
module Github
|
|
4
|
-
class Repos < API
|
|
5
|
-
|
|
6
|
-
# Load all the modules after initializing Repos to avoid superclass mismatch
|
|
7
|
-
Github::require_all 'github_api/repos',
|
|
8
|
-
'collaborators',
|
|
9
|
-
'comments',
|
|
10
|
-
'commits',
|
|
11
|
-
'contents',
|
|
12
|
-
'downloads',
|
|
13
|
-
'forks',
|
|
14
|
-
'hooks',
|
|
15
|
-
'keys',
|
|
16
|
-
'merging',
|
|
17
|
-
'pages',
|
|
18
|
-
'pub_sub_hubbub',
|
|
19
|
-
'releases',
|
|
20
|
-
'statistics',
|
|
21
|
-
'statuses'
|
|
22
|
-
|
|
23
|
-
DEFAULT_REPO_OPTIONS = {
|
|
24
|
-
"homepage" => "https://github.com",
|
|
25
|
-
"private" => false,
|
|
26
|
-
"has_issues" => true,
|
|
27
|
-
"has_wiki" => true,
|
|
28
|
-
"has_downloads" => true
|
|
29
|
-
}.freeze
|
|
30
|
-
|
|
31
|
-
REQUIRED_REPO_OPTIONS = %w[ name ]
|
|
32
|
-
|
|
33
|
-
VALID_REPO_OPTIONS = %w[
|
|
34
|
-
name
|
|
35
|
-
description
|
|
36
|
-
homepage
|
|
37
|
-
private
|
|
38
|
-
has_issues
|
|
39
|
-
has_wiki
|
|
40
|
-
has_downloads
|
|
41
|
-
team_id
|
|
42
|
-
auto_init
|
|
43
|
-
gitignore_template
|
|
44
|
-
default_branch
|
|
45
|
-
].freeze
|
|
46
|
-
|
|
47
|
-
VALID_REPO_TYPES = %w[ all public private member ].freeze
|
|
48
|
-
|
|
49
|
-
# Access to Repos::Collaborators API
|
|
50
|
-
def collaborators(options={}, &block)
|
|
51
|
-
@collaborators ||= ApiFactory.new('Repos::Collaborators', current_options.merge(options), &block)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Access to Repos::Comments API
|
|
55
|
-
def comments(options={}, &block)
|
|
56
|
-
@comments ||= ApiFactory.new('Repos::Comments', current_options.merge(options), &block)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# Access to Repos::Commits API
|
|
60
|
-
def commits(options={}, &block)
|
|
61
|
-
@commits ||= ApiFactory.new('Repos::Commits', current_options.merge(options), &block)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Access to Repos::Contents API
|
|
65
|
-
def contents(options={}, &block)
|
|
66
|
-
@contents ||= ApiFactory.new('Repos::Contents', current_options.merge(options), &block)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
# Access to Repos::Downloads API
|
|
70
|
-
def downloads(options={}, &block)
|
|
71
|
-
@downloads ||= ApiFactory.new('Repos::Downloads', current_options.merge(options), &block)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# Access to Repos::Forks API
|
|
75
|
-
def forks(options={}, &block)
|
|
76
|
-
@forks ||= ApiFactory.new('Repos::Forks', current_options.merge(options), &block)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Access to Repos::Hooks API
|
|
80
|
-
def hooks(options={}, &block)
|
|
81
|
-
@hooks ||= ApiFactory.new('Repos::Hooks', current_options.merge(options), &block)
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
# Access to Repos::Keys API
|
|
85
|
-
def keys(options={}, &block)
|
|
86
|
-
@keys ||= ApiFactory.new('Repos::Keys', current_options.merge(options), &block)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# Access to Repos::Merging API
|
|
90
|
-
def merging(options={}, &block)
|
|
91
|
-
@merging ||= ApiFactory.new('Repos::Merging', current_options.merge(options), &block)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
# Access to Repos::Pages API
|
|
95
|
-
def pages(options={}, &block)
|
|
96
|
-
@pages ||= ApiFactory.new('Repos::Pages', current_options.merge(options), &block)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Access to Repos::PubSubHubbub API
|
|
100
|
-
def pubsubhubbub(options={}, &block)
|
|
101
|
-
@pubsubhubbub ||= ApiFactory.new('Repos::PubSubHubbub', current_options.merge(options), &block)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
# Access to Repos::Releases API
|
|
105
|
-
def releases(options={}, &block)
|
|
106
|
-
@releases ||= ApiFactory.new('Repos::Releases', current_options.merge(options), &block)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Access to Repos::Statistics API
|
|
110
|
-
def stats(options={}, &block)
|
|
111
|
-
@stats ||= ApiFactory.new('Repos::Statistics', current_options.merge(options), &block)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# Access to Repos::Statuses API
|
|
115
|
-
def statuses(options={}, &block)
|
|
116
|
-
@statuses ||= ApiFactory.new('Repos::Statuses', current_options.merge(options), &block)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# List repositories for the authenticated user
|
|
120
|
-
#
|
|
121
|
-
# = Examples
|
|
122
|
-
# github = Github.new :oauth_token => '...'
|
|
123
|
-
# github.repos.list
|
|
124
|
-
# github.repos.list { |repo| ... }
|
|
125
|
-
#
|
|
126
|
-
# List all repositories
|
|
127
|
-
#
|
|
128
|
-
# This provides a dump of every repository, in the order that they were created.
|
|
129
|
-
# = Parameters
|
|
130
|
-
# * <tt>:since</tt> - the integer ID of the last Repository that you've seen.
|
|
131
|
-
#
|
|
132
|
-
# = Examples
|
|
133
|
-
# github = Github.new
|
|
134
|
-
# github.repos.list :every
|
|
135
|
-
# github.repos.list :every { |repo| ... }
|
|
136
|
-
#
|
|
137
|
-
# List public repositories for the specified user.
|
|
138
|
-
#
|
|
139
|
-
# = Examples
|
|
140
|
-
# github = Github.new
|
|
141
|
-
# github.repos.list user: 'user-name'
|
|
142
|
-
# github.repos.list user: 'user-name', { |repo| ... }
|
|
143
|
-
#
|
|
144
|
-
# List repositories for the specified organisation.
|
|
145
|
-
#
|
|
146
|
-
# = Examples
|
|
147
|
-
# github = Github.new
|
|
148
|
-
# github.repos.list org: 'org-name'
|
|
149
|
-
# github.repos.list org: 'org-name', { |repo| ... }
|
|
150
|
-
#
|
|
151
|
-
def list(*args)
|
|
152
|
-
arguments(args) do
|
|
153
|
-
sift %w[ user org type sort direction since ]
|
|
154
|
-
end
|
|
155
|
-
params = arguments.params
|
|
156
|
-
|
|
157
|
-
response = if (user_name = params.delete('user') || user)
|
|
158
|
-
get_request("/users/#{user_name}/repos", params)
|
|
159
|
-
elsif (org_name = params.delete('org') || org)
|
|
160
|
-
get_request("/orgs/#{org_name}/repos", params)
|
|
161
|
-
elsif args.map(&:to_s).include?('every')
|
|
162
|
-
get_request('/repositories', params)
|
|
163
|
-
else
|
|
164
|
-
# For authenticated user
|
|
165
|
-
get_request('/user/repos', params)
|
|
166
|
-
end
|
|
167
|
-
return response unless block_given?
|
|
168
|
-
response.each { |el| yield el }
|
|
169
|
-
end
|
|
170
|
-
alias :all :list
|
|
171
|
-
|
|
172
|
-
# Get a repository
|
|
173
|
-
#
|
|
174
|
-
# = Examples
|
|
175
|
-
# github = Github.new
|
|
176
|
-
# github.repos.get 'user-name', 'repo-name'
|
|
177
|
-
# github.repos.get user: 'user-name', repo: 'repo-name'
|
|
178
|
-
# github.repos(user: 'user-name', repo: 'repo-name').get
|
|
179
|
-
#
|
|
180
|
-
def get(*args)
|
|
181
|
-
arguments(args, :required => [:user, :repo])
|
|
182
|
-
params = arguments.params
|
|
183
|
-
|
|
184
|
-
get_request("/repos/#{user}/#{repo}", params)
|
|
185
|
-
end
|
|
186
|
-
alias :find :get
|
|
187
|
-
|
|
188
|
-
# Create a new repository for the autheticated user.
|
|
189
|
-
#
|
|
190
|
-
# = Parameters
|
|
191
|
-
# <tt>:name</tt> - Required string
|
|
192
|
-
# <tt>:description</tt> - Optional string
|
|
193
|
-
# <tt>:homepage</tt> - Optional string
|
|
194
|
-
# <tt>:private</tt> - Optional boolean - <tt>true</tt> to create a private
|
|
195
|
-
# repository, <tt>false</tt> to create a public one.
|
|
196
|
-
# <tt>:has_issues</tt> - Optional boolean - <tt>true</tt> to enable issues
|
|
197
|
-
# for this repository, <tt>false</tt> to disable them
|
|
198
|
-
# <tt>:has_wiki</tt> - Optional boolean - <tt>true</tt> to enable the wiki
|
|
199
|
-
# for this repository, <tt>false</tt> to disable it.
|
|
200
|
-
# Default is <tt>true</tt>
|
|
201
|
-
# <tt>:has_downloads</tt> - Optional boolean - <tt>true</tt> to enable
|
|
202
|
-
# downloads for this repository
|
|
203
|
-
# <tt>:org</tt> Optional string - The organisation in which this repository
|
|
204
|
-
# will be created
|
|
205
|
-
# <tt>:team_id</tt> Optional number - The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization
|
|
206
|
-
# <tt>:auto_init</tt> Optional boolean - true to create an initial commit with empty README. Default is false.
|
|
207
|
-
# <tt>:gitignore_template</tt> Optional string - Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, “Haskell” Ignored if auto_init parameter is not provided.
|
|
208
|
-
#
|
|
209
|
-
# = Examples
|
|
210
|
-
# github = Github.new
|
|
211
|
-
# github.repos.create "name": 'repo-name'
|
|
212
|
-
# "description": "This is your first repo",
|
|
213
|
-
# "homepage": "https://github.com",
|
|
214
|
-
# "private": false,
|
|
215
|
-
# "has_issues": true,
|
|
216
|
-
# "has_wiki": true,
|
|
217
|
-
# "has_downloads": true
|
|
218
|
-
#
|
|
219
|
-
# Create a new repository in this organisation. The authenticated user
|
|
220
|
-
# must be a member of this organisation
|
|
221
|
-
#
|
|
222
|
-
# Examples:
|
|
223
|
-
# github = Github.new :oauth_token => '...'
|
|
224
|
-
# github.repos.create :name => 'repo-name', :org => 'organisation-name'
|
|
225
|
-
#
|
|
226
|
-
def create(*args)
|
|
227
|
-
arguments(args) do
|
|
228
|
-
sift VALID_REPO_OPTIONS + %w[ org ]
|
|
229
|
-
assert_required %w[ name ]
|
|
230
|
-
end
|
|
231
|
-
params = arguments.params
|
|
232
|
-
|
|
233
|
-
# Requires authenticated user
|
|
234
|
-
if (org = params.delete('org') || org)
|
|
235
|
-
post_request("/orgs/#{org}/repos", params.merge_default(DEFAULT_REPO_OPTIONS))
|
|
236
|
-
else
|
|
237
|
-
post_request('/user/repos', params.merge_default(DEFAULT_REPO_OPTIONS))
|
|
238
|
-
end
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
# Delete a repository
|
|
242
|
-
#
|
|
243
|
-
# Deleting a repository requires admin access.
|
|
244
|
-
# If OAuth is used, the delete_repo scope is required.
|
|
245
|
-
#
|
|
246
|
-
# = Examples
|
|
247
|
-
# github = Github.new :oauth_token => '...'
|
|
248
|
-
# github.repos.delete 'user-name', 'repo-name'
|
|
249
|
-
#
|
|
250
|
-
def delete(*args)
|
|
251
|
-
arguments(args, :required => [:user, :repo])
|
|
252
|
-
params = arguments.params
|
|
253
|
-
|
|
254
|
-
delete_request("/repos/#{user}/#{repo}", params)
|
|
255
|
-
end
|
|
256
|
-
alias :remove :delete
|
|
257
|
-
|
|
258
|
-
# List contributors
|
|
259
|
-
#
|
|
260
|
-
# = Parameters
|
|
261
|
-
# <tt>:anon</tt> - Optional flag. Set to 1 or true to include anonymous contributors.
|
|
262
|
-
#
|
|
263
|
-
# = Examples
|
|
264
|
-
#
|
|
265
|
-
# github = Github.new
|
|
266
|
-
# github.repos.contributors 'user-name','repo-name'
|
|
267
|
-
# github.repos.contributors 'user-name','repo-name' { |cont| ... }
|
|
268
|
-
#
|
|
269
|
-
def contributors(*args)
|
|
270
|
-
arguments(args, :required => [:user, :repo]) do
|
|
271
|
-
sift %w[ anon ]
|
|
272
|
-
end
|
|
273
|
-
params = arguments.params
|
|
274
|
-
|
|
275
|
-
response = get_request("/repos/#{user}/#{repo}/contributors", params)
|
|
276
|
-
return response unless block_given?
|
|
277
|
-
response.each { |el| yield el }
|
|
278
|
-
end
|
|
279
|
-
alias :list_contributors :contributors
|
|
280
|
-
alias :contribs :contributors
|
|
281
|
-
|
|
282
|
-
# Edit a repository
|
|
283
|
-
#
|
|
284
|
-
# = Parameters
|
|
285
|
-
# * <tt>:name</tt> Required string
|
|
286
|
-
# * <tt>:description</tt> Optional string
|
|
287
|
-
# * <tt>:homepage</tt> Optional string
|
|
288
|
-
# <tt>:private</tt> - Optional boolean - <tt>false</tt> to create public reps, <tt>false</tt> to create a private one
|
|
289
|
-
# * <tt>:has_issues</tt> Optional boolean - <tt>true</tt> to enable issues for this repository, <tt>false</tt> to disable them
|
|
290
|
-
# * <tt>:has_wiki</tt> Optional boolean - <tt>true</tt> to enable the wiki for this repository, <tt>false</tt> to disable it. Default is <tt>true</tt>
|
|
291
|
-
# * <tt>:has_downloads</tt> Optional boolean - <tt>true</tt> to enable downloads for this repository
|
|
292
|
-
# * <tt>:default_branch</tt> Optional string - Update the default branch for this repository.
|
|
293
|
-
#
|
|
294
|
-
# = Examples
|
|
295
|
-
#
|
|
296
|
-
# github = Github.new
|
|
297
|
-
# github.repos.edit 'user-name', 'repo-name',
|
|
298
|
-
# :name => 'hello-world',
|
|
299
|
-
# :description => 'This is your first repo',
|
|
300
|
-
# :homepage => "https://github.com",
|
|
301
|
-
# :public => true, :has_issues => true
|
|
302
|
-
#
|
|
303
|
-
def edit(*args)
|
|
304
|
-
arguments(args, :required => [:user, :repo]) do
|
|
305
|
-
sift VALID_REPO_OPTIONS
|
|
306
|
-
assert_required %w[ name ]
|
|
307
|
-
end
|
|
308
|
-
params = arguments.params
|
|
309
|
-
|
|
310
|
-
patch_request("/repos/#{user}/#{repo}", params.merge_default(DEFAULT_REPO_OPTIONS))
|
|
311
|
-
end
|
|
312
|
-
|
|
313
|
-
# Delete a repository
|
|
314
|
-
#
|
|
315
|
-
# Deleting a repository requires admin access.
|
|
316
|
-
# If OAuth is used, the delete_repo scope is required.
|
|
317
|
-
#
|
|
318
|
-
# = Examples
|
|
319
|
-
# github = Github.new :oauth_token => '...'
|
|
320
|
-
# github.repos.delete 'user-name', 'repo-name'
|
|
321
|
-
#
|
|
322
|
-
def delete(*args)
|
|
323
|
-
arguments(args, :required => [:user, :repo])
|
|
324
|
-
params = arguments.params
|
|
325
|
-
|
|
326
|
-
delete_request("/repos/#{user}/#{repo}", params)
|
|
327
|
-
end
|
|
328
|
-
alias :remove :delete
|
|
329
|
-
|
|
330
|
-
# List branches
|
|
331
|
-
#
|
|
332
|
-
# = Examples
|
|
333
|
-
#
|
|
334
|
-
# github = Github.new
|
|
335
|
-
# github.repos.branches 'user-name', 'repo-name'
|
|
336
|
-
# github.repos(user: 'user-name', repo: 'repo-name').branches
|
|
337
|
-
#
|
|
338
|
-
# repos = Github::Repos.new
|
|
339
|
-
# repos.branches 'user-name', 'repo-name'
|
|
340
|
-
#
|
|
341
|
-
# def branches(user_name, repo_name, params={})
|
|
342
|
-
def branches(*args)
|
|
343
|
-
arguments(args, :required => [:user, :repo])
|
|
344
|
-
|
|
345
|
-
response = get_request("/repos/#{user}/#{repo}/branches", arguments.params)
|
|
346
|
-
return response unless block_given?
|
|
347
|
-
response.each { |el| yield el }
|
|
348
|
-
end
|
|
349
|
-
alias :list_branches :branches
|
|
350
|
-
|
|
351
|
-
# Get branch
|
|
352
|
-
#
|
|
353
|
-
# = Examples
|
|
354
|
-
#
|
|
355
|
-
# github = Github.new
|
|
356
|
-
# github.repos.branch 'user-name', 'repo-name', 'branch-name'
|
|
357
|
-
# github.repos.branch user: 'user-name', repo: 'repo-name', branch: 'branch-name'
|
|
358
|
-
# github.repos(user: 'user-name', repo: 'repo-name', branch: 'branch-name').branch
|
|
359
|
-
#
|
|
360
|
-
def branch(*args)
|
|
361
|
-
arguments(args, :required => [:user, :repo, :branch])
|
|
362
|
-
params = arguments.params
|
|
363
|
-
|
|
364
|
-
get_request("/repos/#{user}/#{repo}/branches/#{branch}", params)
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
# List contributors
|
|
368
|
-
#
|
|
369
|
-
# = Parameters
|
|
370
|
-
# <tt>:anon</tt> - Optional flag. Set to 1 or true to include anonymous contributors.
|
|
371
|
-
#
|
|
372
|
-
# = Examples
|
|
373
|
-
#
|
|
374
|
-
# github = Github.new
|
|
375
|
-
# github.repos.contributors 'user-name','repo-name'
|
|
376
|
-
# github.repos.contributors 'user-name','repo-name' { |cont| ... }
|
|
377
|
-
#
|
|
378
|
-
def contributors(*args)
|
|
379
|
-
arguments(args, :required => [:user, :repo]) do
|
|
380
|
-
sift ['anon']
|
|
381
|
-
end
|
|
382
|
-
params = arguments.params
|
|
383
|
-
|
|
384
|
-
response = get_request("/repos/#{user}/#{repo}/contributors", params)
|
|
385
|
-
return response unless block_given?
|
|
386
|
-
response.each { |el| yield el }
|
|
387
|
-
end
|
|
388
|
-
alias :list_contributors :contributors
|
|
389
|
-
alias :contribs :contributors
|
|
390
|
-
|
|
391
|
-
# List languages
|
|
392
|
-
#
|
|
393
|
-
# = Examples
|
|
394
|
-
# github = Github.new
|
|
395
|
-
# github.repos.languages 'user-name', 'repo-name'
|
|
396
|
-
# github.repos.languages 'user-name', 'repo-name' { |lang| ... }
|
|
397
|
-
#
|
|
398
|
-
def languages(*args)
|
|
399
|
-
arguments(args, :required => [:user, :repo])
|
|
400
|
-
params = arguments.params
|
|
401
|
-
|
|
402
|
-
response = get_request("/repos/#{user}/#{repo}/languages", params)
|
|
403
|
-
return response unless block_given?
|
|
404
|
-
response.each { |el| yield el }
|
|
405
|
-
end
|
|
406
|
-
alias :list_languages :languages
|
|
407
|
-
|
|
408
|
-
# List tags
|
|
409
|
-
#
|
|
410
|
-
# = Examples
|
|
411
|
-
# github = Github.new
|
|
412
|
-
# github.repos.tags 'user-name', 'repo-name'
|
|
413
|
-
# github.repos.tags 'user-name', 'repo-name' { |tag| ... }
|
|
414
|
-
#
|
|
415
|
-
def tags(*args)
|
|
416
|
-
arguments(args, :required => [:user, :repo])
|
|
417
|
-
params = arguments.params
|
|
418
|
-
|
|
419
|
-
response = get_request("/repos/#{user}/#{repo}/tags", params)
|
|
420
|
-
return response unless block_given?
|
|
421
|
-
response.each { |el| yield el }
|
|
422
|
-
end
|
|
423
|
-
alias :list_tags :tags
|
|
424
|
-
alias :repo_tags :tags
|
|
425
|
-
alias :repository_tags :tags
|
|
426
|
-
|
|
427
|
-
# List teams
|
|
428
|
-
#
|
|
429
|
-
# == Examples
|
|
430
|
-
# github = Github.new
|
|
431
|
-
# github.repos.teams 'user-name', 'repo-name'
|
|
432
|
-
# github.repos.teams 'user-name', 'repo-name' { |team| ... }
|
|
433
|
-
#
|
|
434
|
-
# github.repos(user: 'user-name, repo: 'repo-name').teams
|
|
435
|
-
#
|
|
436
|
-
def teams(*args)
|
|
437
|
-
arguments(args, :required => [:user, :repo])
|
|
438
|
-
params = arguments.params
|
|
439
|
-
|
|
440
|
-
response = get_request("/repos/#{user}/#{repo}/teams", params)
|
|
441
|
-
return response unless block_given?
|
|
442
|
-
response.each { |el| yield el }
|
|
443
|
-
end
|
|
444
|
-
alias :list_teams :teams
|
|
445
|
-
alias :repo_teams :teams
|
|
446
|
-
alias :repository_teams :teams
|
|
447
|
-
|
|
448
|
-
end # Repos
|
|
449
|
-
end # Github
|