octokit 2.0.0.rc3 → 2.0.0.rc4
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.
data/lib/octokit/client.rb
CHANGED
@@ -225,17 +225,19 @@ module Octokit
|
|
225
225
|
|
226
226
|
private
|
227
227
|
|
228
|
-
def request(method, path,
|
228
|
+
def request(method, path, data)
|
229
|
+
options = {}
|
230
|
+
options[:query] = data.delete(:query) || {}
|
231
|
+
options[:headers] = data.delete(:headers) || {}
|
232
|
+
|
229
233
|
if application_authenticated?
|
230
|
-
options[:query] ||= {}
|
231
234
|
options[:query].merge! application_authentication
|
232
235
|
end
|
233
|
-
if accept =
|
234
|
-
options[:headers] ||= {}
|
236
|
+
if accept = data.delete(:accept)
|
235
237
|
options[:headers][:accept] = accept
|
236
238
|
end
|
237
239
|
|
238
|
-
@last_response = response = agent.call(method, URI.encode(path), options)
|
240
|
+
@last_response = response = agent.call(method, URI.encode(path), data, options)
|
239
241
|
response.data
|
240
242
|
end
|
241
243
|
|
data/lib/octokit/client/users.rb
CHANGED
@@ -29,11 +29,11 @@ module Octokit
|
|
29
29
|
# @see http://developer.github.com/v3/users/#get-a-single-user
|
30
30
|
# @example
|
31
31
|
# Octokit.user("sferik")
|
32
|
-
def user(user=nil)
|
32
|
+
def user(user=nil, options = {})
|
33
33
|
if user
|
34
|
-
get "users/#{user}"
|
34
|
+
get "users/#{user}", options
|
35
35
|
else
|
36
|
-
get 'user'
|
36
|
+
get 'user', options
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -99,7 +99,7 @@ module Octokit
|
|
99
99
|
#
|
100
100
|
# @param user [String] Username of the user who you are getting the list of the people they follow.
|
101
101
|
# @return [Array<Sawyer::Resource>] Array of hashes representing users a user is following.
|
102
|
-
# @see
|
102
|
+
# @see http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user
|
103
103
|
# @example
|
104
104
|
# Octokit.following('pengwynn')
|
105
105
|
def following(user=login, options = {})
|
data/lib/octokit/configurable.rb
CHANGED
@@ -43,9 +43,11 @@ module Octokit
|
|
43
43
|
# @!attribute web_endpoint
|
44
44
|
# @return [String] Base URL for web URLs. default: https://github.com/
|
45
45
|
|
46
|
-
attr_accessor :api_endpoint, :auto_paginate, :client_id,
|
47
|
-
:
|
48
|
-
|
46
|
+
attr_accessor :access_token, :api_endpoint, :auto_paginate, :client_id,
|
47
|
+
:default_media_type, :connection_options,
|
48
|
+
:login, :middleware, :netrc, :netrc_file,
|
49
|
+
:per_page, :proxy, :user_agent, :web_endpoint
|
50
|
+
attr_writer :client_secret, :password
|
49
51
|
|
50
52
|
class << self
|
51
53
|
|
data/lib/octokit/default.rb
CHANGED
data/lib/octokit/version.rb
CHANGED
data/spec/octokit/client_spec.rb
CHANGED
@@ -344,6 +344,18 @@ describe Octokit::Client do
|
|
344
344
|
conn = Octokit.client.send(:agent).instance_variable_get(:"@conn")
|
345
345
|
expect(conn.proxy[:uri].to_s).to eq 'http://proxy.example.com'
|
346
346
|
end
|
347
|
+
it "passes along request headers for POST" do
|
348
|
+
VCR.turn_off!
|
349
|
+
headers = {"X-GitHub-Foo" => "bar"}
|
350
|
+
root_request = stub_post("/").
|
351
|
+
with(:headers => headers).
|
352
|
+
to_return(:status => 201)
|
353
|
+
client = Octokit::Client.new
|
354
|
+
client.post "/", :headers => headers
|
355
|
+
assert_requested root_request
|
356
|
+
expect(client.last_response.status).to eq 201
|
357
|
+
VCR.turn_on!
|
358
|
+
end
|
347
359
|
end
|
348
360
|
|
349
361
|
describe "auto pagination", :vcr do
|
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.0.0.
|
4
|
+
version: 2.0.0.rc4
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-08-
|
14
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|