octokit 4.12.0 → 4.13.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.
- checksums.yaml +5 -5
- data/README.md +17 -1
- data/lib/octokit/client/authorizations.rb +5 -1
- data/lib/octokit/preview.rb +2 -1
- data/lib/octokit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 62cc9f95627d52ebe1950974e93a4ddf3a24709dd23d24f7124ef9f4befc7a94
|
4
|
+
data.tar.gz: b0390bb087b9cfda51e942ee3958c9ea600750697e4f6b825aa0dd40947574b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efd51d1fb7f93e55da8d616c90ec6840688873f9070f63816a3782d3900587e41b3f4f50e49450bc2b721d088042038dec16d66dbc93b3356191404919932ca4
|
7
|
+
data.tar.gz: faa042b6c7afa1aa67eed9b0904e8319a178f0c79d4bc4be8467ce2fa5604a2c413d93ede232d739083085cdd94fcfa5d6b22854583b5807f0ed0978fc221d48
|
data/README.md
CHANGED
@@ -43,7 +43,8 @@ Upgrading? Check the [Upgrade Guide](#upgrading-guide) before bumping to a new
|
|
43
43
|
1. [Running and writing new tests](#running-and-writing-new-tests)
|
44
44
|
15. [Supported Ruby Versions](#supported-ruby-versions)
|
45
45
|
16. [Versioning](#versioning)
|
46
|
-
17. [
|
46
|
+
17. [Making Repeating Requests](#making-repeating-requests)
|
47
|
+
18. [License](#license)
|
47
48
|
|
48
49
|
## Philosophy
|
49
50
|
|
@@ -727,6 +728,21 @@ The changes made between versions can be seen on the [project releases page][rel
|
|
727
728
|
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
728
729
|
[releases]: https://github.com/octokit/octokit.rb/releases
|
729
730
|
|
731
|
+
## Making Repeating Requests
|
732
|
+
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.
|
733
|
+
|
734
|
+
```ruby
|
735
|
+
Octopoller.poll(timeout: 15.seconds) do
|
736
|
+
begin
|
737
|
+
client.request_progress # ex. request a long running job's status
|
738
|
+
rescue Error
|
739
|
+
:re_poll
|
740
|
+
end
|
741
|
+
end
|
742
|
+
```
|
743
|
+
|
744
|
+
This is useful when making requests for a long running job's progress (ex. requesting a [Source Import's progress](https://developer.github.com/v3/migrations/source_imports/#get-import-progress)).
|
745
|
+
|
730
746
|
## License
|
731
747
|
|
732
748
|
Copyright (c) 2009-2014 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober
|
@@ -66,7 +66,11 @@ module Octokit
|
|
66
66
|
client_id, client_secret = fetch_client_id_and_secret(options)
|
67
67
|
raise ArgumentError.new("Client ID and Secret required for idempotent authorizations") unless client_id && client_secret
|
68
68
|
|
69
|
-
|
69
|
+
# Remove the client_id from the body otherwise
|
70
|
+
# this will result in a 422.
|
71
|
+
options.delete(:client_id)
|
72
|
+
|
73
|
+
if (fingerprint = options.delete(:fingerprint))
|
70
74
|
put "authorizations/clients/#{client_id}/#{fingerprint}", options.merge(:client_secret => client_secret)
|
71
75
|
else
|
72
76
|
put "authorizations/clients/#{client_id}", options.merge(:client_secret => client_secret)
|
data/lib/octokit/preview.rb
CHANGED
@@ -18,7 +18,8 @@ module Octokit
|
|
18
18
|
:traffic => 'application/vnd.github.spiderman-preview'.freeze,
|
19
19
|
:integrations => 'application/vnd.github.machine-man-preview+json'.freeze,
|
20
20
|
:topics => 'application/vnd.github.mercy-preview+json'.freeze,
|
21
|
-
:community_profile => 'application/vnd.github.black-panther-preview+json'.freeze
|
21
|
+
:community_profile => 'application/vnd.github.black-panther-preview+json'.freeze,
|
22
|
+
:strict_validation => 'application/vnd.github.speedy-preview+json'.freeze,
|
22
23
|
}
|
23
24
|
|
24
25
|
def ensure_api_media_type(type, options)
|
data/lib/octokit/version.rb
CHANGED
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.13.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: 2018-
|
13
|
+
date: 2018-10-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: 1.3.5
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.7.7
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Ruby toolkit for working with the GitHub API
|