octokit 4.14.0 → 4.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +15 -12
- data/README.md +11 -4
- data/lib/octokit/client.rb +2 -0
- data/lib/octokit/client/apps.rb +13 -0
- data/lib/octokit/client/commit_pulls.rb +20 -0
- data/lib/octokit/client/issues.rb +7 -2
- data/lib/octokit/client/organizations.rb +14 -0
- data/lib/octokit/client/pull_requests.rb +1 -1
- data/lib/octokit/client/refs.rb +1 -1
- data/lib/octokit/client/repositories.rb +24 -0
- data/lib/octokit/client/repository_invitations.rb +1 -1
- data/lib/octokit/client/reviews.rb +18 -0
- data/lib/octokit/error.rb +18 -0
- data/lib/octokit/middleware/follow_redirects.rb +1 -1
- data/lib/octokit/preview.rb +5 -1
- data/lib/octokit/version.rb +1 -1
- data/octokit.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acde45338bbfff0aac4a04d4e9867b5345f1b1123e58fdc80d0c69d01a1f0877
|
4
|
+
data.tar.gz: 65324c811d6edbfb510ef41a2ffbe54cc3197d64cfc018e1997858e8d59a5e20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc30ba3288f921516c9aa78f27389c91840522aedb97e3a0c1fb21d672b69586d7096b12affc25a7cd859906da8fe6376a9b5244ca667a5977aad400ec65eff0
|
7
|
+
data.tar.gz: cdd80e10b58cfa64d2ed18d0376c762ce478b6efddb41e1581f529c3c1d265a0fb67c337398a7e9beee307045b6468732d7d11db2b5b54797734dac917e6029b
|
data/CONTRIBUTING.md
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
## Submitting a Pull Request
|
2
2
|
|
3
|
-
0.
|
3
|
+
0. Read our [Code of Conduct](CODE_OF_CONDUCT.md).
|
4
|
+
1. Check out Hacking on Octokit in the README guide for
|
4
5
|
bootstrapping the project for local development.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
2. [Fork the repository.][fork]
|
7
|
+
3. [Create a topic branch.][branch]
|
8
|
+
4. Add specs for your unimplemented feature or bug fix.
|
9
|
+
5. Run `script/test`. If your specs pass, return to step 3.
|
10
|
+
6. Implement your feature or bug fix.
|
11
|
+
7. Run `script/test`. If your specs fail, return to step 5.
|
12
|
+
8. Run `open coverage/index.html`. If your changes are not completely covered
|
12
13
|
by your tests, return to step 4.
|
13
|
-
|
14
|
-
|
14
|
+
9. Add documentation for your feature or bug fix.
|
15
|
+
10. Run `bundle exec rake doc:yard`. If your changes are not 100% documented, go
|
15
16
|
back to step 8.
|
16
|
-
|
17
|
+
11. Add, commit, and push your changes. For documentation-only fixes, please
|
17
18
|
add "[ci skip]" to your commit message to avoid needless CI builds.
|
18
|
-
|
19
|
+
12. [Submit a pull request.][pr]
|
20
|
+
|
21
|
+
Please abide by
|
19
22
|
|
20
23
|
[fork]: https://help.github.com/articles/fork-a-repo
|
21
24
|
[branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
|
data/README.md
CHANGED
@@ -41,7 +41,8 @@ Upgrading? Check the [Upgrade Guide](#upgrading-guide) before bumping to a new
|
|
41
41
|
1. [Debugging](#debugging)
|
42
42
|
2. [Caching](#caching)
|
43
43
|
14. [Hacking on Octokit.rb](#hacking-on-octokitrb)
|
44
|
-
1. [
|
44
|
+
1. [Code of Conduction](#code_of_conduct)
|
45
|
+
2. [Running and writing new tests](#running-and-writing-new-tests)
|
45
46
|
15. [Supported Ruby Versions](#supported-ruby-versions)
|
46
47
|
16. [Versioning](#versioning)
|
47
48
|
17. [Making Repeating Requests](#making-repeating-requests)
|
@@ -63,7 +64,7 @@ client.readme 'al3x/sovereign', :accept => 'application/vnd.github.html'
|
|
63
64
|
```
|
64
65
|
|
65
66
|
[wrappers]: http://wynnnetherland.com/journal/what-makes-a-good-api-wrapper
|
66
|
-
[github-api]:
|
67
|
+
[github-api]: https://developer.github.com/v3/
|
67
68
|
|
68
69
|
## Quick start
|
69
70
|
|
@@ -289,7 +290,7 @@ link relations](#hypermedia-agent).
|
|
289
290
|
|
290
291
|
```ruby
|
291
292
|
issues = client.issues 'rails/rails'
|
292
|
-
issues.concat client.last_response.rels[:next].
|
293
|
+
issues.concat client.get(client.last_response.rels[:next].href)
|
293
294
|
```
|
294
295
|
|
295
296
|
### Auto pagination
|
@@ -653,6 +654,12 @@ to run a Ruby console to poke on Octokit, you can crank one up with:
|
|
653
654
|
Using the scripts in `./scripts` instead of `bundle exec rspec`, `bundle
|
654
655
|
console`, etc. ensures your dependencies are up-to-date.
|
655
656
|
|
657
|
+
### Code of Conduct
|
658
|
+
|
659
|
+
We want both the Octokit.rb and larger Octokit communities to be an open
|
660
|
+
and welcoming environments. Please read and follow both in spirit and
|
661
|
+
letter [Code of Conduct](CODE_OF_CONDUCT.md).
|
662
|
+
|
656
663
|
### Running and writing new tests
|
657
664
|
|
658
665
|
Octokit uses [VCR][] for recording and playing back API fixtures during test
|
@@ -752,7 +759,7 @@ The changes made between versions can be seen on the [project releases page][rel
|
|
752
759
|
[releases]: https://github.com/octokit/octokit.rb/releases
|
753
760
|
|
754
761
|
## Making Repeating Requests
|
755
|
-
In most cases it would be best to use a [webhooks](https://developer.github.com/webhooks/), but sometimes webhooks don't provide all of the information needed. In those cases where one might need to poll for progress or retry a request on failure, we designed [Octopoller](https://github.com/octokit/octopoller.rb). Octopoller is a micro gem perfect for making repeating requests.
|
762
|
+
In most cases it would be best to use a [webhooks](https://developer.github.com/webhooks/), but sometimes webhooks don't provide all of the information needed. In those cases where one might need to poll for progress or retry a request on failure, we designed [Octopoller](https://github.com/octokit/octopoller.rb). Octopoller is a micro gem perfect for making repeating requests.
|
756
763
|
|
757
764
|
```ruby
|
758
765
|
Octopoller.poll(timeout: 15.seconds) do
|
data/lib/octokit/client.rb
CHANGED
@@ -15,6 +15,7 @@ require 'octokit/client/authorizations'
|
|
15
15
|
require 'octokit/client/checks'
|
16
16
|
require 'octokit/client/commits'
|
17
17
|
require 'octokit/client/commit_comments'
|
18
|
+
require 'octokit/client/commit_pulls'
|
18
19
|
require 'octokit/client/community_profile'
|
19
20
|
require 'octokit/client/contents'
|
20
21
|
require 'octokit/client/downloads'
|
@@ -73,6 +74,7 @@ module Octokit
|
|
73
74
|
include Octokit::Client::Checks
|
74
75
|
include Octokit::Client::Commits
|
75
76
|
include Octokit::Client::CommitComments
|
77
|
+
include Octokit::Client::CommitPulls
|
76
78
|
include Octokit::Client::CommunityProfile
|
77
79
|
include Octokit::Client::Contents
|
78
80
|
include Octokit::Client::Deployments
|
data/lib/octokit/client/apps.rb
CHANGED
@@ -204,6 +204,19 @@ module Octokit
|
|
204
204
|
data.repositories.concat last_response.data.repositories
|
205
205
|
end
|
206
206
|
end
|
207
|
+
|
208
|
+
# Delete an installation and uninstall a GitHub App
|
209
|
+
#
|
210
|
+
# @param installation [Integer] The id of a GitHub App Installation
|
211
|
+
# @param options [Hash] A customizable set of options
|
212
|
+
#
|
213
|
+
# @see https://developer.github.com/v3/apps/#delete-an-installation
|
214
|
+
#
|
215
|
+
# @return [Boolean] Success
|
216
|
+
def delete_installation(installation, options = {})
|
217
|
+
opts = ensure_api_media_type(:uninstall_github_app, options)
|
218
|
+
boolean_from_response :delete, "app/installations/#{installation}", opts
|
219
|
+
end
|
207
220
|
end
|
208
221
|
end
|
209
222
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Octokit
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Methods for the Commit Pulls API
|
5
|
+
#
|
6
|
+
# @see https://developer.github.com/v3/repos/comments/
|
7
|
+
module CommitPulls
|
8
|
+
|
9
|
+
# List pulls for a single commit
|
10
|
+
#
|
11
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
12
|
+
# @param sha [String] The SHA of the commit whose pulls will be fetched
|
13
|
+
# @return [Array] List of commit pulls
|
14
|
+
# @see https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit
|
15
|
+
def commit_pulls(repo, sha, options = {})
|
16
|
+
paginate "#{Repository.path repo}/commits/#{sha}/pulls", options
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -81,6 +81,7 @@ module Octokit
|
|
81
81
|
# @param body [String] An optional concise description
|
82
82
|
# @param options [Hash] A customizable set of options.
|
83
83
|
# @option options [String] :assignee User login.
|
84
|
+
# @option options [Array<String>] :assignees User login.
|
84
85
|
# @option options [Integer] :milestone Milestone number.
|
85
86
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
86
87
|
# @return [Sawyer::Resource] Your newly created issue
|
@@ -120,6 +121,7 @@ module Octokit
|
|
120
121
|
# @param number [Integer] Number ID of the issue
|
121
122
|
# @param options [Hash] A customizable set of options.
|
122
123
|
# @option options [String] :assignee User login.
|
124
|
+
# @option options [Array<String>] :assignees User login.
|
123
125
|
# @option options [Integer] :milestone Milestone number.
|
124
126
|
# @option options [Array<String>] :labels List of Label names. Example: <tt>['bug', 'ui', '@high']</tt>.
|
125
127
|
# @return [Sawyer::Resource] The updated Issue
|
@@ -136,6 +138,7 @@ module Octokit
|
|
136
138
|
# @param number [Integer] Number ID of the issue
|
137
139
|
# @param options [Hash] A customizable set of options.
|
138
140
|
# @option options [String] :assignee User login.
|
141
|
+
# @option options [Array<String>] :assignees User login.
|
139
142
|
# @option options [Integer] :milestone Milestone number.
|
140
143
|
# @option options [Array<String>] :labels List of Label names. Example: <tt>['bug', 'ui', '@high']</tt>.
|
141
144
|
# @return [Sawyer::Resource] The updated Issue
|
@@ -179,6 +182,7 @@ module Octokit
|
|
179
182
|
# @param body [String] Updated body of the issue
|
180
183
|
# @param options [Hash] A customizable set of options.
|
181
184
|
# @option options [String] :assignee User login.
|
185
|
+
# @option options [Array<String>] :assignees User login.
|
182
186
|
# @option options [Integer] :milestone Milestone number.
|
183
187
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
184
188
|
# @option options [String] :state State of the issue. <tt>open</tt> or <tt>closed</tt>
|
@@ -190,6 +194,7 @@ module Octokit
|
|
190
194
|
# @option options [String] :title Updated title for the issue
|
191
195
|
# @option options [String] :body Updated body of the issue
|
192
196
|
# @option options [String] :assignee User login.
|
197
|
+
# @option options [Array<String>] :assignees User login.
|
193
198
|
# @option options [Integer] :milestone Milestone number.
|
194
199
|
# @option options [Array<String>] :labels List of Label names. Example: <tt>['bug', 'ui', '@high']</tt>.
|
195
200
|
# @option options [String] :state State of the issue. <tt>open</tt> or <tt>closed</tt>
|
@@ -332,7 +337,7 @@ module Octokit
|
|
332
337
|
#
|
333
338
|
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
334
339
|
# @param number [Integer] Issue number
|
335
|
-
# @param assignees [Array] Assignees to be added
|
340
|
+
# @param assignees [Array<String>] Assignees to be added
|
336
341
|
# @return [Sawyer::Resource] Issue
|
337
342
|
# @see https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue
|
338
343
|
# @example Add assignees "pengwynn" and "joeyw" to Issue #23 on octokit/octokit.rb
|
@@ -345,7 +350,7 @@ module Octokit
|
|
345
350
|
#
|
346
351
|
# @param repo [Integer, String, Repository, Hash] A GitHub repository
|
347
352
|
# @param number [Integer] Issue number
|
348
|
-
# @param assignees [Array] Assignees to be removed
|
353
|
+
# @param assignees [Array<String>] Assignees to be removed
|
349
354
|
# @param options [Hash] Header params for request
|
350
355
|
# @return [Sawyer::Resource] Issue
|
351
356
|
# @see https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue
|
@@ -324,6 +324,20 @@ module Octokit
|
|
324
324
|
get "teams/#{team_id}", options
|
325
325
|
end
|
326
326
|
|
327
|
+
# Get team by name and org
|
328
|
+
#
|
329
|
+
# Requires authenticated organization member.
|
330
|
+
#
|
331
|
+
# @param org [String, Integer] Organization GitHub login or id.
|
332
|
+
# @param team_slug [String] Team slug.
|
333
|
+
# @return [Sawyer::Resource] Hash representing team.
|
334
|
+
# @see https://developer.github.com/v3/teams/#get-team-by-name
|
335
|
+
# @example
|
336
|
+
# @client.team("github", "justice-league")
|
337
|
+
def team_by_name(org, team_slug, options = {})
|
338
|
+
get "#{Organization.path(org)}/teams/#{team_slug}", options
|
339
|
+
end
|
340
|
+
|
327
341
|
# List child teams
|
328
342
|
#
|
329
343
|
# Requires authenticated organization member.
|
@@ -11,7 +11,7 @@ module Octokit
|
|
11
11
|
# @overload pull_requests(repo, options)
|
12
12
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
13
13
|
# @param options [Hash] Method options
|
14
|
-
# @option options [String] :state `open` or `closed`.
|
14
|
+
# @option options [String] :state `open` or `closed` or `all`.
|
15
15
|
# @return [Array<Sawyer::Resource>] Array of pulls
|
16
16
|
# @see https://developer.github.com/v3/pulls/#list-pull-requests
|
17
17
|
# @example
|
data/lib/octokit/client/refs.rb
CHANGED
@@ -83,7 +83,7 @@ module Octokit
|
|
83
83
|
# @return [Array<Sawyer::Resource>] The list of references updated
|
84
84
|
# @see https://developer.github.com/v3/git/refs/#update-a-reference
|
85
85
|
# @example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
|
86
|
-
# Octokit.
|
86
|
+
# Octokit.update_branch("octocat/Hello-World","sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd")
|
87
87
|
def update_branch(repo, branch, sha, force = true, options = {})
|
88
88
|
update_ref repo, "heads/#{branch}", sha, force, options
|
89
89
|
end
|
@@ -41,11 +41,15 @@ module Octokit
|
|
41
41
|
# @option options [String] :private `true` makes the repository private, and `false` makes it public.
|
42
42
|
# @option options [String] :has_issues `true` enables issues for this repo, `false` disables issues.
|
43
43
|
# @option options [String] :has_wiki `true` enables wiki for this repo, `false` disables wiki.
|
44
|
+
# @option options [Boolean] :is_template `true` makes the repository a template, `false` makes it not a template.
|
44
45
|
# @option options [String] :has_downloads `true` enables downloads for this repo, `false` disables downloads.
|
45
46
|
# @option options [String] :default_branch Update the default branch for this repository.
|
46
47
|
# @return [Sawyer::Resource] Repository information
|
47
48
|
def edit_repository(repo, options = {})
|
48
49
|
repo = Repository.new(repo)
|
50
|
+
if options.include? :is_template
|
51
|
+
options = ensure_api_media_type(:template_repositories, options)
|
52
|
+
end
|
49
53
|
options[:name] ||= repo.name
|
50
54
|
patch "repos/#{repo}", options
|
51
55
|
end
|
@@ -144,6 +148,7 @@ module Octokit
|
|
144
148
|
# @option options [String] :private `true` makes the repository private, and `false` makes it public.
|
145
149
|
# @option options [String] :has_issues `true` enables issues for this repo, `false` disables issues.
|
146
150
|
# @option options [String] :has_wiki `true` enables wiki for this repo, `false` disables wiki.
|
151
|
+
# @option options [Boolean] :is_template `true` makes this repo available as a template repository, `false` to prevent it.
|
147
152
|
# @option options [String] :has_downloads `true` enables downloads for this repo, `false` disables downloads.
|
148
153
|
# @option options [String] :organization Short name for the org under which to create the repo.
|
149
154
|
# @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.
|
@@ -155,6 +160,9 @@ module Octokit
|
|
155
160
|
opts = options.dup
|
156
161
|
organization = opts.delete :organization
|
157
162
|
opts.merge! :name => name
|
163
|
+
if opts.include? :is_template
|
164
|
+
opts = ensure_api_media_type(:template_repositories, opts)
|
165
|
+
end
|
158
166
|
|
159
167
|
if organization.nil?
|
160
168
|
post 'user/repos', opts
|
@@ -192,6 +200,22 @@ module Octokit
|
|
192
200
|
end
|
193
201
|
alias :transfer_repo :transfer_repository
|
194
202
|
|
203
|
+
# Create a repository for a user or organization generated from a template repository
|
204
|
+
#
|
205
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub template repository
|
206
|
+
# @param name [String] Name of the new repo
|
207
|
+
# @option options [String] :owner Organization or user who the new repository will belong to.
|
208
|
+
# @option options [String] :description Description of the repo
|
209
|
+
# @option options [String] :private `true` makes the repository private, and `false` makes it public.
|
210
|
+
# @option options [Boolean] :include_all_branches `true` copies all branches from the template repository, `false` (default) makes it only copy the master branch.
|
211
|
+
# @return [Sawyer::Resource] Repository info for the new repository
|
212
|
+
def create_repository_from_template(repo, name, options = {})
|
213
|
+
options.merge! :name => name
|
214
|
+
options = ensure_api_media_type(:template_repositories, options)
|
215
|
+
post "#{Repository.path repo}/generate", options
|
216
|
+
end
|
217
|
+
alias :create_repo_from_template :create_repository_from_template
|
218
|
+
|
195
219
|
# Hide a public repository
|
196
220
|
#
|
197
221
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
@@ -13,7 +13,7 @@ module Octokit
|
|
13
13
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
14
14
|
# @param user [String] User GitHub username to add
|
15
15
|
# @return [Sawyer::Resource] The repository invitation
|
16
|
-
# @see https://developer.github.com/v3/repos/
|
16
|
+
# @see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator
|
17
17
|
def invite_user_to_repository(repo, user, options = {})
|
18
18
|
put "#{Repository.path repo}/collaborators/#{user}", options
|
19
19
|
end
|
@@ -204,6 +204,24 @@ module Octokit
|
|
204
204
|
options = options.merge(reviewers)
|
205
205
|
delete "#{Repository.path repo}/pulls/#{id}/requested_reviewers", options
|
206
206
|
end
|
207
|
+
|
208
|
+
# Update a review request comment
|
209
|
+
#
|
210
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
211
|
+
# @param number [Integer] Number ID of the pull request
|
212
|
+
# @param review [Integer] The id of the review
|
213
|
+
# @param body [String] body text of the pull request review.
|
214
|
+
# @param options [Hash] Method options
|
215
|
+
# @see https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review
|
216
|
+
#
|
217
|
+
# @example
|
218
|
+
# @client.update_pull_request_review('octokit/octokit.rb', 825, 6505518, 'This is close to perfect! Please address the suggested inline change. And add more about this.')
|
219
|
+
#
|
220
|
+
# @return [Sawyer::Resource] Hash representing the review comment
|
221
|
+
def update_pull_request_review(repo, number, review, body, options = {})
|
222
|
+
options[:body] = body
|
223
|
+
put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
|
224
|
+
end
|
207
225
|
end
|
208
226
|
end
|
209
227
|
end
|
data/lib/octokit/error.rb
CHANGED
@@ -63,6 +63,8 @@ module Octokit
|
|
63
63
|
Octokit::TooManyRequests
|
64
64
|
elsif body =~ /login attempts exceeded/i
|
65
65
|
Octokit::TooManyLoginAttempts
|
66
|
+
elsif body =~ /returns blobs up to [0-9]+ MB/i
|
67
|
+
Octokit::TooLargeContent
|
66
68
|
elsif body =~ /abuse/i
|
67
69
|
Octokit::AbuseDetected
|
68
70
|
elsif body =~ /repository access blocked/i
|
@@ -71,6 +73,10 @@ module Octokit
|
|
71
73
|
Octokit::UnverifiedEmail
|
72
74
|
elsif body =~ /account was suspended/i
|
73
75
|
Octokit::AccountSuspended
|
76
|
+
elsif body =~ /billing issue/i
|
77
|
+
Octokit::BillingIssue
|
78
|
+
elsif body =~ /Resource protected by organization SAML enforcement/i
|
79
|
+
Octokit::SAMLProtected
|
74
80
|
else
|
75
81
|
Octokit::Forbidden
|
76
82
|
end
|
@@ -231,6 +237,10 @@ module Octokit
|
|
231
237
|
# and body matches 'login attempts exceeded'
|
232
238
|
class TooManyLoginAttempts < Forbidden; end
|
233
239
|
|
240
|
+
# Raised when GitHub returns a 403 HTTP status code
|
241
|
+
# and body matches 'returns blobs up to [0-9]+ MB'
|
242
|
+
class TooLargeContent < Forbidden; end
|
243
|
+
|
234
244
|
# Raised when GitHub returns a 403 HTTP status code
|
235
245
|
# and body matches 'abuse'
|
236
246
|
class AbuseDetected < Forbidden; end
|
@@ -247,6 +257,14 @@ module Octokit
|
|
247
257
|
# and body matches 'account was suspended'
|
248
258
|
class AccountSuspended < Forbidden; end
|
249
259
|
|
260
|
+
# Raised when GitHub returns a 403 HTTP status code
|
261
|
+
# and body matches 'billing issue'
|
262
|
+
class BillingIssue < Forbidden; end
|
263
|
+
|
264
|
+
# Raised when GitHub returns a 403 HTTP status code
|
265
|
+
# and body matches 'Resource protected by organization SAML enforcement'
|
266
|
+
class SAMLProtected < Forbidden; end
|
267
|
+
|
250
268
|
# Raised when GitHub returns a 404 HTTP status code
|
251
269
|
class NotFound < ClientError; end
|
252
270
|
|
@@ -11,7 +11,7 @@ module Octokit
|
|
11
11
|
module Middleware
|
12
12
|
|
13
13
|
# Public: Exception thrown when the maximum amount of requests is exceeded.
|
14
|
-
class RedirectLimitReached < Faraday::
|
14
|
+
class RedirectLimitReached < Faraday::ClientError
|
15
15
|
attr_reader :response
|
16
16
|
|
17
17
|
def initialize(response)
|
data/lib/octokit/preview.rb
CHANGED
@@ -4,9 +4,10 @@ module Octokit
|
|
4
4
|
module Preview
|
5
5
|
|
6
6
|
PREVIEW_TYPES = {
|
7
|
-
:branch_protection => 'application/vnd.github.
|
7
|
+
:branch_protection => 'application/vnd.github.luke-cage-preview+json'.freeze,
|
8
8
|
:checks => 'application/vnd.github.antiope-preview+json'.freeze,
|
9
9
|
:commit_search => 'application/vnd.github.cloak-preview+json'.freeze,
|
10
|
+
:commit_pulls => 'application/vnd.github.groot-preview+json'.freeze,
|
10
11
|
:migrations => 'application/vnd.github.wyandotte-preview+json'.freeze,
|
11
12
|
:licenses => 'application/vnd.github.drax-preview+json'.freeze,
|
12
13
|
:source_imports => 'application/vnd.github.barred-rock-preview'.freeze,
|
@@ -21,6 +22,9 @@ module Octokit
|
|
21
22
|
:topics => 'application/vnd.github.mercy-preview+json'.freeze,
|
22
23
|
:community_profile => 'application/vnd.github.black-panther-preview+json'.freeze,
|
23
24
|
:strict_validation => 'application/vnd.github.speedy-preview+json'.freeze,
|
25
|
+
:drafts => 'application/vnd.github.shadow-cat-preview'.freeze,
|
26
|
+
:template_repositories => 'application/vnd.github.baptiste-preview+json'.freeze,
|
27
|
+
:uninstall_github_app => 'application/vnd.github.gambit-preview+json'.freeze,
|
24
28
|
}
|
25
29
|
|
26
30
|
def ensure_api_media_type(type, options)
|
data/lib/octokit/version.rb
CHANGED
data/octokit.gemspec
CHANGED
@@ -6,6 +6,7 @@ require 'octokit/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.add_development_dependency 'bundler', '>= 1', '< 3'
|
8
8
|
spec.add_dependency 'sawyer', '>= 0.5.3', '~> 0.8.0'
|
9
|
+
spec.add_dependency 'faraday', '>= 0.9'
|
9
10
|
spec.authors = ["Wynn Netherland", "Erik Michaels-Ober", "Clint Shryock"]
|
10
11
|
spec.description = %q{Simple wrapper for the GitHub API}
|
11
12
|
spec.email = ['wynn.netherland@gmail.com', 'sferik@gmail.com', 'clint@ctshryock.com']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.8.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.9'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.9'
|
55
69
|
description: Simple wrapper for the GitHub API
|
56
70
|
email:
|
57
71
|
- wynn.netherland@gmail.com
|
@@ -75,6 +89,7 @@ files:
|
|
75
89
|
- lib/octokit/client/authorizations.rb
|
76
90
|
- lib/octokit/client/checks.rb
|
77
91
|
- lib/octokit/client/commit_comments.rb
|
92
|
+
- lib/octokit/client/commit_pulls.rb
|
78
93
|
- lib/octokit/client/commits.rb
|
79
94
|
- lib/octokit/client/community_profile.rb
|
80
95
|
- lib/octokit/client/contents.rb
|
@@ -160,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
175
|
- !ruby/object:Gem::Version
|
161
176
|
version: 1.3.5
|
162
177
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
178
|
+
rubygems_version: 3.1.2
|
164
179
|
signing_key:
|
165
180
|
specification_version: 4
|
166
181
|
summary: Ruby toolkit for working with the GitHub API
|