octokit 2.5.1 → 2.6.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: c3cf1af069f8340a238fee661f517dbf868eb9b6
4
- data.tar.gz: 2bab369c18b322be7db2c851bd83252d9709a4be
3
+ metadata.gz: aea11664f44be0b77bfab832db28875277969127
4
+ data.tar.gz: 0d18a6aaca5d748a4f2410fd76b5b1f552171ebf
5
5
  SHA512:
6
- metadata.gz: 8395f228a0a1c37f53b9deb90e4fe2966a76e149c94090140d9f2b23ec32a808be5349148a0d104ffed5443b4aa0f4efb428ee3460a77432e82af51133650a06
7
- data.tar.gz: 75ed932cc964201d45e62d154cc955e586e10cff2f7e8302adf271a2c1185c95c103ba7cea096c08ee0a06b235bf6029ac49c3bbdbe047c5a4041594de0bca4b
6
+ metadata.gz: e398e4984360a0f587cb9b869cc70ae40663a8555762eea838ca188525affb0fc1d47ff73bee5ecb1fa511907452a3e97621771dfac0125d6faafb42c94f6208
7
+ data.tar.gz: 7ebab468e733cf771eb5e4fc43af6c5cfe3bb7df304156f3efe60f02adc5d007978e8ce0a1e644e0ce4ceaca05ec256287b7f780ef1b68ec3db22778357441cf
data/README.md CHANGED
@@ -180,7 +180,7 @@ client = Octokit::Client.new \
180
180
  :client_id => "<your 20 char id>",
181
181
  :client_secret => "<your 40 char secret>"
182
182
 
183
- user = client.users 'defunkt'
183
+ user = client.user 'defunkt'
184
184
  ```
185
185
 
186
186
 
@@ -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
- agent.start.data
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', 'yyyy')
142
- def authorize_url(app_id, app_secret, options = {})
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 + "&client_secret=" + app_secret
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
@@ -1,7 +1,7 @@
1
1
  module Octokit
2
2
  class Client
3
3
 
4
- # Methods for the the unpublished Emojis API
4
+ # Methods for the Emojis API
5
5
  module Emojis
6
6
 
7
7
  # List all emojis used on GitHub
@@ -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
- get "repos/#{Repository.new(repo)}/pulls", options
20
+ paginate "repos/#{Repository.new(repo)}/pulls", options
21
21
  end
22
22
  alias :pulls :pull_requests
23
23
 
@@ -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 :client_secret, :password
50
+ attr_writer :password
51
51
 
52
52
  class << self
53
53
 
@@ -2,6 +2,6 @@ module Octokit
2
2
 
3
3
  # Current version
4
4
  # @return [String]
5
- VERSION = "2.5.1".freeze
5
+ VERSION = "2.6.0".freeze
6
6
 
7
7
  end
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.5.1
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-10-29 00:00:00.000000000 Z
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: