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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 68d79e41b0ec21db586820ddf1a791ce7a89ee06
4
- data.tar.gz: 5720512cad786914d96be808efbc57f3c11e0c99
2
+ SHA256:
3
+ metadata.gz: 62cc9f95627d52ebe1950974e93a4ddf3a24709dd23d24f7124ef9f4befc7a94
4
+ data.tar.gz: b0390bb087b9cfda51e942ee3958c9ea600750697e4f6b825aa0dd40947574b1
5
5
  SHA512:
6
- metadata.gz: 0bea9d7d21fc8697fb95b1f51c6e5272adac368a65ef274a7699bfe7a4e9436ce5bd71636abfd5963ed75405c29a83358b6ade21d97fd7cf7cbaf2be6f5a9e95
7
- data.tar.gz: 658f7509dd017517e995dec0b32f8759053b0f0acf81cff20e5f9d7fe0060c05fae3433f5638ce1ba1ca788af6e357b749529b5418e68a2be88d2b3ec9d058d5
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. [License](#license)
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
- if fingerprint = options.delete(:fingerprint)
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)
@@ -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)
@@ -5,7 +5,7 @@ module Octokit
5
5
 
6
6
  # Current minor release.
7
7
  # @return [Integer]
8
- MINOR = 12
8
+ MINOR = 13
9
9
 
10
10
  # Current patch level.
11
11
  # @return [Integer]
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.12.0
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-09-11 00:00:00.000000000 Z
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.5.2.3
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