octokit 3.7.1 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ed9c913826b2d42443b7ba5790e5c1a64eacf8c
4
- data.tar.gz: 417bda71bdee949b4d4285750e2567c629df7027
3
+ metadata.gz: f2dedaa6599d61d3a75894f9d9650fc19f795510
4
+ data.tar.gz: cb4a2597cfa0df06f1f82c002e81e1dec0fee990
5
5
  SHA512:
6
- metadata.gz: 71b430500419af8f9cfd601400a519d6476490ec8d9fdb81487f346137e40b6f8cc2254f01671031475ea96cd7478b7d5598a29827f566f234f4ffc6f1a8cd2e
7
- data.tar.gz: 6dc2cb4d23e657ae56d573bd8beb705120e3a01a28a73bfcb5b0786e478dcf47f813a34ae6536d82adf8d41bd6a5d84e1a114a32a65054364d23bdc6b3d7738f
6
+ metadata.gz: 6b7d47dd30eff757599a6ce3080c60f7fdbdb99089cc9c9cee724f8e7cd5255b10a714698725a3f00ed59aee32e620e6ae9e6ac86f8c88590bccb463dcd72fb7
7
+ data.tar.gz: 826384c7909a6dcfd31f8590a9a6eeadbdda2a9b4b281f0bcb06d601e2d9ba74b0533d1cd946820650c09be07639236e1dde5b1549043ee6c430061a3ce5ac0f
@@ -292,7 +292,7 @@ module Octokit
292
292
  octokit_warn <<-EOS
293
293
  WARNING: The preview version of the Org Hooks API is not yet suitable for production use.
294
294
  You can avoid this message by supplying an appropriate media type in the 'Accept' request
295
- header. See the blog post for details: http://git.io/<LINK>
295
+ header. See the blog post for details: http://git.io/uucWqg
296
296
  EOS
297
297
  end
298
298
  end
@@ -127,6 +127,23 @@ module Octokit
127
127
  boolean_from_response(:delete, asset_url, options)
128
128
  end
129
129
 
130
+ # Get the release for a given tag
131
+ #
132
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
133
+ # @param tag_name [String] the name for a tag
134
+ # @return [Sawyer::Resource] The release
135
+ def release_for_tag(repo, tag_name, options = {})
136
+ get "#{Repository.path repo}/releases/tags/#{tag_name}", options
137
+ end
138
+
139
+ # Get the latest release
140
+ #
141
+ # @param repo [Integer, String, Repository, Hash] A GitHub repository
142
+ # @return [Sawyer::Resource] The release
143
+ def latest_release(repo, options = {})
144
+ get "#{Repository.path repo}/releases/latest", options
145
+ end
146
+
130
147
  private
131
148
 
132
149
  def content_type_from_file(file)
@@ -64,6 +64,8 @@ module Octokit
64
64
  Octokit::TooManyLoginAttempts
65
65
  elsif body =~ /abuse/i
66
66
  Octokit::AbuseDetected
67
+ elsif body =~ /repository access blocked/i
68
+ Octokit::RepositoryUnavailable
67
69
  else
68
70
  Octokit::Forbidden
69
71
  end
@@ -193,6 +195,10 @@ module Octokit
193
195
  # and body matches 'abuse'
194
196
  class AbuseDetected < Forbidden; end
195
197
 
198
+ # Raised when GitHub returns a 403 HTTP status code
199
+ # and body matches 'repository access blocked'
200
+ class RepositoryUnavailable < Forbidden; end
201
+
196
202
  # Raised when GitHub returns a 404 HTTP status code
197
203
  class NotFound < ClientError; end
198
204
 
@@ -5,11 +5,11 @@ module Octokit
5
5
 
6
6
  # Current minor release.
7
7
  # @return [Integer]
8
- MINOR = 7
8
+ MINOR = 8
9
9
 
10
10
  # Current patch level.
11
11
  # @return [Integer]
12
- PATCH = 1
12
+ PATCH = 0
13
13
 
14
14
  # Full release version.
15
15
  # @return [String]
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: 3.7.1
4
+ version: 3.8.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: 2015-02-13 00:00:00.000000000 Z
13
+ date: 2015-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler