octokit 2.5.1 → 2.6.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 +4 -4
- data/README.md +1 -1
- data/lib/octokit/client.rb +5 -1
- data/lib/octokit/client/authorizations.rb +9 -4
- data/lib/octokit/client/emojis.rb +1 -1
- data/lib/octokit/client/hooks.rb +17 -0
- data/lib/octokit/client/pull_requests.rb +1 -1
- data/lib/octokit/configurable.rb +2 -2
- data/lib/octokit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aea11664f44be0b77bfab832db28875277969127
|
4
|
+
data.tar.gz: 0d18a6aaca5d748a4f2410fd76b5b1f552171ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e398e4984360a0f587cb9b869cc70ae40663a8555762eea838ca188525affb0fc1d47ff73bee5ecb1fa511907452a3e97621771dfac0125d6faafb42c94f6208
|
7
|
+
data.tar.gz: 7ebab468e733cf771eb5e4fc43af6c5cfe3bb7df304156f3efe60f02adc5d007978e8ce0a1e644e0ce4ceaca05ec256287b7f780ef1b68ec3db22778357441cf
|
data/README.md
CHANGED
data/lib/octokit/client.rb
CHANGED
@@ -15,6 +15,7 @@ require 'octokit/client/emojis'
|
|
15
15
|
require 'octokit/client/events'
|
16
16
|
require 'octokit/client/gists'
|
17
17
|
require 'octokit/client/gitignore'
|
18
|
+
require 'octokit/client/hooks'
|
18
19
|
require 'octokit/client/issues'
|
19
20
|
require 'octokit/client/labels'
|
20
21
|
require 'octokit/client/legacy_search'
|
@@ -55,6 +56,7 @@ module Octokit
|
|
55
56
|
include Octokit::Client::Events
|
56
57
|
include Octokit::Client::Gists
|
57
58
|
include Octokit::Client::Gitignore
|
59
|
+
include Octokit::Client::Hooks
|
58
60
|
include Octokit::Client::Issues
|
59
61
|
include Octokit::Client::Labels
|
60
62
|
include Octokit::Client::LegacySearch
|
@@ -207,6 +209,8 @@ module Octokit
|
|
207
209
|
http.basic_auth(@login, @password)
|
208
210
|
elsif token_authenticated?
|
209
211
|
http.authorization 'token', @access_token
|
212
|
+
elsif application_authenticated?
|
213
|
+
http.params = http.params.merge application_authentication
|
210
214
|
end
|
211
215
|
end
|
212
216
|
end
|
@@ -215,7 +219,7 @@ module Octokit
|
|
215
219
|
#
|
216
220
|
# @return [Sawyer::Resource]
|
217
221
|
def root
|
218
|
-
|
222
|
+
get "/"
|
219
223
|
end
|
220
224
|
|
221
225
|
# Response for last HTTP request
|
@@ -130,7 +130,6 @@ module Octokit
|
|
130
130
|
# Get the URL to authorize a user for an application via the web flow
|
131
131
|
#
|
132
132
|
# @param app_id [String] Client Id we received when our application was registered with GitHub.
|
133
|
-
# @param app_secret [String] Client Secret we received when our application was registered with GitHub.
|
134
133
|
# @option options [String] :redirect_uri The url to redirect to after authorizing.
|
135
134
|
# @option options [String] :scope The scopes to request from the user.
|
136
135
|
# @option options [String] :state A random string to protect against CSRF.
|
@@ -138,10 +137,16 @@ module Octokit
|
|
138
137
|
# @see Octokit::Client
|
139
138
|
# @see http://developer.github.com/v3/oauth/#web-application-flow
|
140
139
|
# @example
|
141
|
-
# @client.authorize_url('xxxx'
|
142
|
-
def authorize_url(
|
140
|
+
# @client.authorize_url('xxxx')
|
141
|
+
def authorize_url(*args)
|
142
|
+
arguments = Arguments.new(args)
|
143
|
+
options = arguments.options
|
144
|
+
app_id = arguments.shift || client_id
|
145
|
+
if app_secret = arguments.shift
|
146
|
+
warn "client_secret is not required for this method"
|
147
|
+
end
|
143
148
|
authorize_url = options.delete(:endpoint) || Octokit.web_endpoint
|
144
|
-
authorize_url += "login/oauth/authorize?client_id=" + app_id
|
149
|
+
authorize_url += "login/oauth/authorize?client_id=" + app_id
|
145
150
|
|
146
151
|
options.each do |key, value|
|
147
152
|
authorize_url += "&" + key.to_s + "=" + value
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Octokit
|
2
|
+
class Client
|
3
|
+
|
4
|
+
# Methods for the Hooks API
|
5
|
+
module Hooks
|
6
|
+
|
7
|
+
# List all Service Hooks supported by GitHub
|
8
|
+
#
|
9
|
+
# @return [Sawyer::Resource] A list of all hooks on GitHub
|
10
|
+
# @example List all hooks
|
11
|
+
# Octokit.available_hooks
|
12
|
+
def available_hooks(options = {})
|
13
|
+
get "hooks", options
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -17,7 +17,7 @@ module Octokit
|
|
17
17
|
# Octokit.pull_requests('rails/rails')
|
18
18
|
def pull_requests(repo, state = nil, options = {})
|
19
19
|
options[:state] = state if state
|
20
|
-
|
20
|
+
paginate "repos/#{Repository.new(repo)}/pulls", options
|
21
21
|
end
|
22
22
|
alias :pulls :pull_requests
|
23
23
|
|
data/lib/octokit/configurable.rb
CHANGED
@@ -44,10 +44,10 @@ module Octokit
|
|
44
44
|
# @return [String] Base URL for web URLs. default: https://github.com/
|
45
45
|
|
46
46
|
attr_accessor :access_token, :api_endpoint, :auto_paginate, :client_id,
|
47
|
-
:default_media_type, :connection_options,
|
47
|
+
:client_secret, :default_media_type, :connection_options,
|
48
48
|
:login, :middleware, :netrc, :netrc_file,
|
49
49
|
:per_page, :proxy, :user_agent, :web_endpoint
|
50
|
-
attr_writer :
|
50
|
+
attr_writer :password
|
51
51
|
|
52
52
|
class << self
|
53
53
|
|
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: 2.
|
4
|
+
version: 2.6.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: 2013-
|
13
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/octokit/client/events.rb
|
68
68
|
- lib/octokit/client/gists.rb
|
69
69
|
- lib/octokit/client/gitignore.rb
|
70
|
+
- lib/octokit/client/hooks.rb
|
70
71
|
- lib/octokit/client/issues.rb
|
71
72
|
- lib/octokit/client/labels.rb
|
72
73
|
- lib/octokit/client/legacy_search.rb
|
@@ -124,3 +125,4 @@ signing_key:
|
|
124
125
|
specification_version: 4
|
125
126
|
summary: Ruby toolkit for working with the GitHub API
|
126
127
|
test_files: []
|
128
|
+
has_rdoc:
|