github_api 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ Feature: Authorizations API
2
+
3
+ Background:
4
+ Given I have "Github::Authorizations" instance
5
+
6
+ Scenario: List
7
+
8
+ Given I want to list resources
9
+ When I make request within a cassette named "auths/list"
10
+ Then the response status should be 200
11
+ And the response type should be JSON
12
+ And the response should not be empty
@@ -0,0 +1,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/authorizations?access_<TOKEN>=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ""
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.11.0
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Sun, 08 Dec 2013 22:23:35 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Status:
32
+ - 200 OK
33
+ X-Ratelimit-Limit:
34
+ - "5000"
35
+ X-Ratelimit-Remaining:
36
+ - "4999"
37
+ X-Ratelimit-Reset:
38
+ - "1386545015"
39
+ Cache-Control:
40
+ - private, max-age=60, s-maxage=60
41
+ Etag:
42
+ - "\"557c29896b5b01f5dac1fa48fb0c0736\""
43
+ Vary:
44
+ - Accept, Authorization, Cookie, X-GitHub-OTP
45
+ - Accept-Encoding
46
+ X-Github-Media-Type:
47
+ - github.v3; format=json
48
+ X-Content-Type-Options:
49
+ - nosniff
50
+ Access-Control-Allow-Credentials:
51
+ - "true"
52
+ Access-Control-Expose-Headers:
53
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
54
+ Access-Control-Allow-Origin:
55
+ - "*"
56
+ X-Github-Request-Id:
57
+ - 4D649864:70CD:3738031:52A4F167
58
+ Content-Encoding:
59
+ - gzip
60
+ body:
61
+ encoding: ASCII-8BIT
62
+ string: !binary |
63
+ H4sIAAAAAAAAA82WS2/aQBDHv0rkXloJh92ZffrWU9tbD5waRWifwSrBljGR
64
+ 0ijfvWucBwFbwZcoCAlsZobx/zePvXrISp8VlIFEPst2zTorslXb1ttiPjd1
65
+ eXlTtqudvXTV7dzs2lXVlP9MW1ab7bz3yWaZqeuseMg25jYk5x9l+3NnL77/
66
+ /pV+eo2XwvlwF9ZVHZrDoHc4r7rA8y/7j/ztn+QphRTGrcuwaZddphkZeGWP
67
+ s6yt/oZN97sKlElujKbaMWqpRae9IEEqojxwCJxrz2QKu6nalPFmt17335f7
68
+ dPtr1wTTBr80bYoJhNI8vUEuKBRcF5T+6Z6u9u/abF164m1WXGVNqKvs+nHW
69
+ K84lIpmoeO9zoviiub9Iqh/L3Tb3z0KX1ZGIqI0GZJ4KYyEgM4yYQxG1A4NS
70
+ JfmkcUioj6i8SUpGzqySnoFJ4hIxUUTIicopWwApCBZUD4n41gZIZzMmIhCB
71
+ grBpdfvkdCLjTblqd3aZau3ia6reb8d6HnRCHdrQ5Le7xrjVvL/f+R2JPFCo
72
+ 5FBkI0E4T7kIWjCnBXBtLEGGURNmXPDKxxCCfRE5e03x6V5fsfuGTQ12XoZH
73
+ hY05wRxwATRVdYGDTIZsRpmAlnIyk95pgEk3fUaYdCPqvEeeMj48l5prSSND
74
+ yQUzAFqD0tGraDgYatMdFtghlOccT6Gcn+IpFZZTvgAoKC+oGuqUROXE5pVK
75
+ vbPr0i33U2d2NHwAqZYIE/umd/oEjCgSzZk3kOa4Q029CzZYJwzxxGLQXPEY
76
+ rFUfwkjuO0cVCOOM3tqcy4gJpJMZ7Z0+ASPkVCQMkXGj0wJ2lsU0qmOMRGlk
77
+ wSLnSthIPoIRkAWVBSMFZ6OMjmwmMGI4tY8SI4afgJGW0XjHvYzdGpUhakuN
78
+ 4MqmS6cx7R5ilWPuAxmlWTd4tNrPuidGzzZjGwipYkLIaVSenE6ojBxnzx/s
79
+ E3aPAO2UlulwxQIHRdOZVQgnAzNeAiHgHRrtSdfew0fXl5P7eWvxdOfIHPR+
80
+ 58iCjM2zE5t3euX6P3bQzuJkDAAA
81
+
82
+ http_version:
83
+ recorded_at: Sun, 08 Dec 2013 22:23:35 GMT
84
+ recorded_with: VCR 2.6.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://<BASIC_AUTH>@api.github.com/search/code?access_token=<TOKEN>&q=tty%2520repo:peter-murach/tty&sort=indexed
5
+ uri: https://<BASIC_AUTH>@api.github.com/search/code?access_<TOKEN>=<TOKEN>&q=TTY%20in:file%20language:ruby%20repo:peter-murach/tty&sort=indexed
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ""
@@ -12,7 +12,7 @@ http_interactions:
12
12
  Accept-Charset:
13
13
  - utf-8
14
14
  User-Agent:
15
- - Github Ruby Gem 0.10.2
15
+ - Github Ruby Gem 0.11.0
16
16
  Accept-Encoding:
17
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
18
  response:
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - GitHub.com
25
25
  Date:
26
- - Mon, 23 Sep 2013 20:22:30 GMT
26
+ - Mon, 16 Dec 2013 20:36:00 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -35,21 +35,23 @@ http_interactions:
35
35
  X-Ratelimit-Remaining:
36
36
  - "19"
37
37
  X-Ratelimit-Reset:
38
- - "1379967810"
38
+ - "1387226220"
39
39
  Cache-Control:
40
40
  - no-cache
41
41
  X-Github-Media-Type:
42
- - github.preview
42
+ - github.beta; param=preview
43
+ Link:
44
+ - <https://api.github.com/search/code?access_<TOKEN>=<TOKEN>&sort=indexed&q=TTY+in%3Afile+language%3Aruby+repo%3Apeter-murach%2Ftty&page=2>; rel="next", <https://api.github.com/search/code?access_<TOKEN>=<TOKEN>&sort=indexed&q=TTY+in%3Afile+language%3Aruby+repo%3Apeter-murach%2Ftty&page=9>; rel="last"
43
45
  X-Content-Type-Options:
44
46
  - nosniff
45
47
  Access-Control-Allow-Credentials:
46
48
  - "true"
47
49
  Access-Control-Expose-Headers:
48
- - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
50
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
49
51
  Access-Control-Allow-Origin:
50
52
  - "*"
51
53
  X-Github-Request-Id:
52
- - 568653B5:1E47:1D88577:5240A304
54
+ - 4D649864:0439:6A225C3:52AF642F
53
55
  Vary:
54
56
  - Accept-Encoding
55
57
  Content-Encoding:
@@ -57,9 +59,145 @@ http_interactions:
57
59
  body:
58
60
  encoding: ASCII-8BIT
59
61
  string: !binary |
60
- H4sIAAAAAAAAA6tWKskvScyJT84vzStRsjLQUcosSc0tVrKKjq0FAKQh8rEc
61
- AAAA
62
+ H4sIAAAAAAAAA+2dbYvjOLbHv0oTmH2zvWVJlmSrYRiWhYWFfbn31eVS6LHK
63
+ dCoOjqtnekJ/93tkpxLn2VaqM/TsgWGqOmUpkizb0s//8z/rWVu3ev5o69dF
64
+ O/vEBP04q1r/spp9+t/1bKFf/OzTzOhVZR8aM/s4W+r2GT6ZVyZr269Zq83c
65
+ Z41fON/4JhscuHrWcFwwTBRGUEeUyrlRjHNTwA9pHFfKKp2TUpS5gppfmzkU
66
+ eG7b5epTlull9fBUtc+v5sHWL/ANy3pVtXVT+VUmCaOKF5mtF61ftKvsSmt+
67
+ aXz4Oc+9INQWRShNsJpxYRQR2l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cOwyqUKCUR3/7v2/8Ddnn6YZMW
199
+ AgA=
62
200
 
63
201
  http_version:
64
- recorded_at: Mon, 23 Sep 2013 20:22:31 GMT
65
- recorded_with: VCR 2.5.0
202
+ recorded_at: Mon, 16 Dec 2013 20:36:00 GMT
203
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,93 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/search/code?access_<TOKEN>=<TOKEN>&q=Gemfile%20in:path%20repo:peter-murach/github&sort=indexed
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ""
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.preview
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.11.0
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Sun, 15 Dec 2013 23:18:42 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Status:
32
+ - 200 OK
33
+ X-Ratelimit-Limit:
34
+ - "20"
35
+ X-Ratelimit-Remaining:
36
+ - "19"
37
+ X-Ratelimit-Reset:
38
+ - "1387149582"
39
+ Cache-Control:
40
+ - no-cache
41
+ X-Github-Media-Type:
42
+ - github.beta; param=preview
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ Access-Control-Allow-Credentials:
46
+ - "true"
47
+ Access-Control-Expose-Headers:
48
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
49
+ Access-Control-Allow-Origin:
50
+ - "*"
51
+ X-Github-Request-Id:
52
+ - 4D649864:043A:53AB314:52AE38D2
53
+ Vary:
54
+ - Accept-Encoding
55
+ Content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Lb8pUy9HwXIostsKdVvRvnrdsgEu
76
+ 0/ZotBGUEsuac+fFDgQd2RVWKqFmK3fKHb4j/SsbVVg6m2iwSGHbmc+L0GWH
77
+ Df1QR7Dx648PvXjEKsNo8EeE2Ns9ZKLBD4RaPhBXa54hGOjwvNIYYmf7dnjS
78
+ bT1YQr1sYenOOBBgdM1puoTvV/uMyyHeMyCdab2loO1jhWrPYSzsD2bcv+4u
79
+ 3FPsCW2f4JrXh72GXXZViWtH9WUXbuFHKf0gpcnDU1rz//WO4nMzDb4j+3ra
80
+ F+sts6s3t9V6Zx/p9vy7u5wr9XAX7H4291FTgXCaNUjuzmjhpKOAfc50Ou1W
81
+ HGxHW3H5wK7s0UgDkq2wWXO1r9vhsROpQNsGuTDm5dgwlw3kzttoIECyPmSu
82
+ Nvbowzxa403T2TALPmSrUIZQuqnda+Se4ZC3brQoBLvlUnB5Gx2RdK9K1IxP
83
+ oCwnmFZ4iRWYp3jtMhHDpo+7e6VHo/mozvSXgJJjyjp7WfIe3xFzgcMOX7FG
84
+ Yn8fT/10FqdJvJmcSkG4hmMVCAd6ASicBzTmwGYw930GYeLHPkuKNEmTkM6K
85
+ eRz6BYtmFAHX+/hrApDVfpjREFKe4fWf0RzmLEOlB+eKoJjnQczjGZuzKAGc
86
+ EYvnDZl9OuvQ65A7Fnf3rajXfm5dzE77wUXZhDQ2j7LPKPv06ulF8WiUfUbZ
87
+ B9XmUfY593HDKPvsPoYYZZ9PPpU6myaj7HO9mzvruFH2GWWfezfbgXJk7h0H
88
+ H/Dc0N2fzcJR9tnK6KPsM8o+n34n4+z2GWWfnXb0P5B95lP8FkUahvHmn81/
89
+ ep5MRB0kAAA=
90
+
91
+ http_version:
92
+ recorded_at: Sun, 15 Dec 2013 23:18:42 GMT
93
+ recorded_with: VCR 2.6.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://<BASIC_AUTH>@api.github.com/search/users?access_token=<TOKEN>&q=location:Sheffield%2520repos:20
5
+ uri: https://<BASIC_AUTH>@api.github.com/search/users?access_<TOKEN>=<TOKEN>&q=location:Sheffield%20repos:20
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ""
@@ -12,7 +12,7 @@ http_interactions:
12
12
  Accept-Charset:
13
13
  - utf-8
14
14
  User-Agent:
15
- - Github Ruby Gem 0.10.2
15
+ - Github Ruby Gem 0.11.0
16
16
  Accept-Encoding:
17
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
18
  response:
@@ -23,7 +23,7 @@ http_interactions:
23
23
  Server:
24
24
  - GitHub.com
25
25
  Date:
26
- - Mon, 23 Sep 2013 06:14:16 GMT
26
+ - Mon, 16 Dec 2013 21:18:47 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -33,23 +33,23 @@ http_interactions:
33
33
  X-Ratelimit-Limit:
34
34
  - "20"
35
35
  X-Ratelimit-Remaining:
36
- - "18"
36
+ - "19"
37
37
  X-Ratelimit-Reset:
38
- - "1379916888"
38
+ - "1387228787"
39
39
  Cache-Control:
40
40
  - no-cache
41
41
  X-Github-Media-Type:
42
- - github.preview
42
+ - github.beta; param=preview
43
43
  X-Content-Type-Options:
44
44
  - nosniff
45
45
  Access-Control-Allow-Credentials:
46
46
  - "true"
47
47
  Access-Control-Expose-Headers:
48
- - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
48
+ - ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
49
49
  Access-Control-Allow-Origin:
50
50
  - "*"
51
51
  X-Github-Request-Id:
52
- - 568653B5:46FF:E24F03:523FDC37
52
+ - 4D649864:218E:7741118:52AF6E37
53
53
  Vary:
54
54
  - Accept-Encoding
55
55
  Content-Encoding:
@@ -61,5 +61,5 @@ http_interactions:
61
61
  AAAA
62
62
 
63
63
  http_version:
64
- recorded_at: Mon, 23 Sep 2013 06:14:16 GMT
65
- recorded_with: VCR 2.5.0
64
+ recorded_at: Mon, 16 Dec 2013 21:18:47 GMT
65
+ recorded_with: VCR 2.6.0
@@ -62,9 +62,21 @@ Feature: Search API
62
62
 
63
63
  Given I want code resource
64
64
  And I pass the following request options:
65
- | q | sort |
66
- | tty repo:peter-murach/tty | indexed |
65
+ | q | sort |
66
+ | TTY in:file language:ruby repo:peter-murach/tty | indexed |
67
67
  When I make request within a cassette named "search/code_query"
68
68
  Then the response status should be 200
69
69
  And the response type should be JSON
70
70
  And the response should not be empty
71
+
72
+ Scenario: Code with unicode characters
73
+
74
+ Given I want code resource
75
+ And I pass the following request options:
76
+ | q | sort |
77
+ | Gemfile in:path repo:peter-murach/github | indexed |
78
+ When I make request within a cassette named "search/code_unicode"
79
+ Then the response status should be 200
80
+ And the response type should be JSON
81
+ And the response should not be empty
82
+
data/lib/github_api.rb CHANGED
@@ -8,6 +8,7 @@ require 'github_api/connection'
8
8
  require 'github_api/deprecation'
9
9
  require 'github_api/core_ext/ordered_hash'
10
10
  require 'github_api/core_ext/deep_merge'
11
+ require 'github_api/ext/faraday'
11
12
 
12
13
  module Github
13
14
  extend Configuration
@@ -1,4 +1,4 @@
1
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
2
2
 
3
3
  require 'github_api/configuration'
4
4
  require 'github_api/connection'
@@ -10,6 +10,7 @@ require 'github_api/core_ext/array'
10
10
  require 'github_api/compatibility'
11
11
  require 'github_api/api/actions'
12
12
  require 'github_api/api_factory'
13
+ require 'github_api/null_encoder'
13
14
 
14
15
  module Github
15
16
  # Core class for api interface operations
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Github
4
+
5
+ # OAuth Authorizations API
4
6
  class Authorizations < API
5
7
 
6
8
  VALID_AUTH_PARAM_NAMES = %w[
@@ -24,7 +26,7 @@ module Github
24
26
  _check_if_authenticated
25
27
  arguments(args)
26
28
 
27
- response = get_request("/authorizations", arguments.params)
29
+ response = get_request('/authorizations', arguments.params)
28
30
  return response unless block_given?
29
31
  response.each { |el| yield el }
30
32
  end
@@ -38,7 +40,7 @@ module Github
38
40
  #
39
41
  def get(*args)
40
42
  _check_if_authenticated
41
- arguments(args, :required => [:authorization_id])
43
+ arguments(args, required: [:authorization_id])
42
44
 
43
45
  get_request("/authorizations/#{authorization_id}", arguments.params)
44
46
  end
@@ -62,7 +64,7 @@ module Github
62
64
  sift VALID_AUTH_PARAM_NAMES
63
65
  end
64
66
 
65
- post_request("/authorizations", arguments.params)
67
+ post_request('/authorizations', arguments.params)
66
68
  end
67
69
 
68
70
  # Update an existing authorization
@@ -80,7 +82,7 @@ module Github
80
82
  #
81
83
  def update(*args)
82
84
  _check_if_authenticated
83
- arguments(args, :required => [:authorization_id]) do
85
+ arguments(args, required: [:authorization_id]) do
84
86
  sift VALID_AUTH_PARAM_NAMES
85
87
  end
86
88
 
@@ -95,16 +97,29 @@ module Github
95
97
  #
96
98
  def delete(*args)
97
99
  _check_if_authenticated
98
- arguments(args, :required => [:authorization_id])
100
+ arguments(args, required: [:authorization_id])
99
101
 
100
102
  delete_request("/authorizations/#{authorization_id}", arguments.params)
101
103
  end
102
104
  alias :remove :delete
103
105
 
106
+ # Revoke all authorizations for an application
107
+ #
108
+ # = Examples
109
+ # github = Github.new basic_auth: "client_id:client_secret"
110
+ # github.oauth.revoke 'client-id'
111
+ #
112
+ #
113
+ def revoke(*args)
114
+
115
+ end
116
+
104
117
  private
105
118
 
106
119
  def _check_if_authenticated
107
- raise ArgumentError, 'You can only access authentication tokens through Basic Authentication' unless authenticated?
120
+ unless authenticated?
121
+ raise ArgumentError, 'You can only access your own tokens via Basic Authentication'
122
+ end
108
123
  end
109
124
 
110
125
  end # Authorizations
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'github_api/descendants'
3
+ require 'descendants_tracker'
4
4
 
5
5
  module Github
6
6
  module Error
7
7
  class GithubError < StandardError
8
- extend Descendants
8
+ extend DescendantsTracker
9
9
 
10
10
  attr_reader :response_message, :response_headers
11
11
 
@@ -8,22 +8,25 @@ module Github
8
8
  class ServiceError < GithubError
9
9
  include ::Github::Jsonable
10
10
 
11
- attr_reader :http_headers
11
+ attr_reader :http_headers, :body, :status
12
+
13
+ MIN_BODY_LENGTH = 2
12
14
 
13
15
  def initialize(response)
14
16
  @http_headers = response[:response_headers]
15
- message = parse_response(response)
17
+ message = parse_response(response)
16
18
  super(message)
17
19
  end
18
20
 
19
21
  def parse_response(response)
20
- body = parse_body(response[:body])
21
- "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:status]} #{body}"
22
+ @body = parse_body(response[:body])
23
+ @status = response[:status]
24
+ "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{@status} #{@body}"
22
25
  end
23
26
 
24
27
  def decode_body(body)
25
- if body.respond_to?(:to_str) && body.length >= 2
26
- decode body, :symbolize_keys => true
28
+ if body.respond_to?(:to_str) && body.length >= MIN_BODY_LENGTH
29
+ decode body, symbolize_keys: true
27
30
  else
28
31
  body
29
32
  end
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+
3
+ module Faraday
4
+ module Utils
5
+
6
+ class ParamsHash
7
+ def params_encoder(encoder = nil)
8
+ if encoder
9
+ @encoder = encoder
10
+ else
11
+ @encoder
12
+ end
13
+ end
14
+
15
+ def to_query
16
+ Utils.build_nested_query(self, nil, params_encoder)
17
+ end
18
+ end
19
+
20
+ def build_nested_query(value, prefix = nil, encoder = nil)
21
+ case value
22
+ when Array
23
+ value.map { |v| build_nested_query(v, "#{prefix}%5B%5D", encoder) }.join("&")
24
+ when Hash
25
+ value.map { |k, v|
26
+ processed_value = encoder ? encoder.escape(k) : escape(k)
27
+ build_nested_query(v, prefix ? "#{prefix}%5B#{processed_value}%5D" : processed_value, encoder)
28
+ }.join("&")
29
+ when NilClass
30
+ prefix
31
+ else
32
+ raise ArgumentError, "value must be a Hash" if prefix.nil?
33
+ processed_value = encoder ? encoder.escape(value) : escape(value)
34
+ "#{prefix}=#{processed_value}"
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ require 'faraday'
4
+
5
+ module Github
6
+
7
+ # Skip encoding of the key nested parameters
8
+ module NullParamsEncoder
9
+ if defined?(Faraday::NestedParamsEncoder)
10
+ class << self
11
+ Faraday::NestedParamsEncoder.singleton_methods do |m|
12
+ define_method m, ::Faraday::NestedParamsEncoder.method(m).to_proc
13
+ end
14
+ end
15
+ end
16
+
17
+ def self.escape(s)
18
+ s.to_s
19
+ end
20
+
21
+ def self.unescape(s)
22
+ s.to_s
23
+ end
24
+ end # NullEncoder
25
+ end # Github
@@ -50,6 +50,14 @@ module Github
50
50
  end
51
51
  end
52
52
 
53
+ def encoder
54
+ if has_key?('encoder') && self['encoder']
55
+ return delete('encoder')
56
+ else
57
+ return {}
58
+ end
59
+ end
60
+
53
61
  # Any client configuration options
54
62
  #
55
63
  def options
@@ -17,7 +17,7 @@ module Github
17
17
  request(:patch, path, params)
18
18
  end
19
19
 
20
- def post_request(path, params = ParamshHash.empty)
20
+ def post_request(path, params = ParamsHash.empty)
21
21
  request(:post, path, params)
22
22
  end
23
23
 
@@ -46,6 +46,9 @@ module Github
46
46
  case method.to_sym
47
47
  when *(METHODS - METHODS_WITH_BODIES)
48
48
  request.body = params.data if params.has_key?('data')
49
+ if params.has_key?('encoder')
50
+ request.params.params_encoder(params.encoder)
51
+ end
49
52
  request.url(path, params.to_hash)
50
53
  when *METHODS_WITH_BODIES
51
54
  if !(conn_options[:query] || {}).empty?
@@ -40,7 +40,7 @@ module Github
40
40
  #
41
41
  def issues(*args)
42
42
  params = arguments(args, required: [:q]).params
43
- params['q'] ||= escape_uri(q)
43
+ params['q'] ||= q
44
44
  params['accept'] ||= PREVIEW_MEDIA
45
45
 
46
46
  get_request('/search/issues' , params)
@@ -66,7 +66,7 @@ module Github
66
66
  #
67
67
  def repos(*args)
68
68
  params = arguments(args, required: [:q]).params
69
- params['q'] ||= escape_uri(q)
69
+ params['q'] ||= q
70
70
  params['accept'] ||= PREVIEW_MEDIA
71
71
 
72
72
  get_request('/search/repositories', arguments.params)
@@ -91,7 +91,7 @@ module Github
91
91
  #
92
92
  def users(*args)
93
93
  params = arguments(args, required: [:q]).params
94
- params['q'] ||= escape_uri(q)
94
+ params['q'] ||= q
95
95
  params['accept'] ||= PREVIEW_MEDIA
96
96
 
97
97
  get_request('/search/users', arguments.params)
@@ -112,11 +112,11 @@ module Github
112
112
  #
113
113
  # = Examples
114
114
  # github = Github.new
115
- # github.search.email email: 'wycats'
115
+ # github.search.code email: 'wycats'
116
116
  #
117
117
  def code(*args)
118
118
  params = arguments(args, required: [:q]).params
119
- params['q'] ||= escape_uri(q)
119
+ params['q'] ||= q
120
120
  params['accept'] ||= PREVIEW_MEDIA
121
121
 
122
122
  get_request('/search/code', params)
@@ -4,7 +4,7 @@ module Github
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 11
7
- PATCH = 0
7
+ PATCH = 1
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.');
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Github::Error::ServiceError, 'parse_body' do
6
+ let(:message) { 'Requires authentication' }
7
+ let(:body) { "{\"message\":\"#{message}\"}" }
8
+ let(:status) { "401 Unauthorized" }
9
+ let(:response_headers) { {"status"=>"401 Unauthorized"} }
10
+ let(:response) {{
11
+ body: body,
12
+ status: status,
13
+ response_headers: response_headers
14
+ }}
15
+
16
+ let(:object) { described_class.new(response) }
17
+
18
+ subject { object.parse_body(body) }
19
+
20
+ it "decodes body" do
21
+ expect(object).to receive(:decode_body).with(body)
22
+ subject
23
+ end
24
+
25
+ context 'when non string' do
26
+ let(:body) { {message: message} }
27
+
28
+ it "parses object" do
29
+ expect(subject).to eql(message)
30
+ end
31
+ end
32
+
33
+ context 'when string' do
34
+ it "parses string" do
35
+ expect(subject).to eql(message)
36
+ end
37
+ end
38
+ end # Github::Error::ServiceError
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Github::Error::ServiceError, 'parse_response' do
6
+ let(:message) { 'Requires authentication' }
7
+ let(:url) { 'https://api.github.com/user/repos' }
8
+ let(:body) { "{\"message\":\"#{message}\"}" }
9
+ let(:status) { "401 Unauthorized" }
10
+ let(:response_headers) { {"status"=>"401 Unauthorized"} }
11
+ let(:response) {{
12
+ body: body,
13
+ status: status,
14
+ response_headers: response_headers,
15
+ url: url
16
+ }}
17
+
18
+ let(:object) { described_class.new(response) }
19
+
20
+ subject { object.parse_response(response) }
21
+
22
+ it "parses body" do
23
+ expect(object).to receive(:parse_body).with(body)
24
+ subject
25
+ end
26
+
27
+ it "parses http headers" do
28
+ expect(object.http_headers).to eql(response_headers)
29
+ end
30
+
31
+ it "parses status" do
32
+ expect(object.status).to eql(status)
33
+ end
34
+
35
+ it "assembles error message" do
36
+ expect(subject).to eql(" #{url}: #{status} #{message}")
37
+ end
38
+ end # Github::Error::ServiceError
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-07 00:00:00.000000000Z
12
+ date: 2013-12-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
16
- requirement: &2153903320 !ruby/object:Gem::Requirement
16
+ requirement: &2153723980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153903320
24
+ version_requirements: *2153723980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hashie
27
- requirement: &2153899020 !ruby/object:Gem::Requirement
27
+ requirement: &2153722400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153899020
35
+ version_requirements: *2153722400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday
38
- requirement: &2153896520 !ruby/object:Gem::Requirement
38
+ requirement: &2153720400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: '0.10'
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *2153896520
49
+ version_requirements: *2153720400
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: multi_json
52
- requirement: &2153893560 !ruby/object:Gem::Requirement
52
+ requirement: &2153712280 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ! '>='
@@ -60,10 +60,10 @@ dependencies:
60
60
  version: '2.0'
61
61
  type: :runtime
62
62
  prerelease: false
63
- version_requirements: *2153893560
63
+ version_requirements: *2153712280
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: oauth2
66
- requirement: &2153891180 !ruby/object:Gem::Requirement
66
+ requirement: &2153710640 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ! '>='
@@ -71,10 +71,10 @@ dependencies:
71
71
  version: '0'
72
72
  type: :runtime
73
73
  prerelease: false
74
- version_requirements: *2153891180
74
+ version_requirements: *2153710640
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: nokogiri
77
- requirement: &2153872700 !ruby/object:Gem::Requirement
77
+ requirement: &2153708340 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ~>
@@ -82,10 +82,21 @@ dependencies:
82
82
  version: 1.6.0
83
83
  type: :runtime
84
84
  prerelease: false
85
- version_requirements: *2153872700
85
+ version_requirements: *2153708340
86
+ - !ruby/object:Gem::Dependency
87
+ name: descendants_tracker
88
+ requirement: &2153706420 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.0.1
94
+ type: :runtime
95
+ prerelease: false
96
+ version_requirements: *2153706420
86
97
  - !ruby/object:Gem::Dependency
87
98
  name: rspec
88
- requirement: &2153871760 !ruby/object:Gem::Requirement
99
+ requirement: &2153705520 !ruby/object:Gem::Requirement
89
100
  none: false
90
101
  requirements:
91
102
  - - ~>
@@ -93,10 +104,10 @@ dependencies:
93
104
  version: '2.14'
94
105
  type: :development
95
106
  prerelease: false
96
- version_requirements: *2153871760
107
+ version_requirements: *2153705520
97
108
  - !ruby/object:Gem::Dependency
98
109
  name: cucumber
99
- requirement: &2153870860 !ruby/object:Gem::Requirement
110
+ requirement: &2153704760 !ruby/object:Gem::Requirement
100
111
  none: false
101
112
  requirements:
102
113
  - - ~>
@@ -104,10 +115,10 @@ dependencies:
104
115
  version: '1.3'
105
116
  type: :development
106
117
  prerelease: false
107
- version_requirements: *2153870860
118
+ version_requirements: *2153704760
108
119
  - !ruby/object:Gem::Dependency
109
120
  name: webmock
110
- requirement: &2153870080 !ruby/object:Gem::Requirement
121
+ requirement: &2153703940 !ruby/object:Gem::Requirement
111
122
  none: false
112
123
  requirements:
113
124
  - - ~>
@@ -115,10 +126,10 @@ dependencies:
115
126
  version: '1.13'
116
127
  type: :development
117
128
  prerelease: false
118
- version_requirements: *2153870080
129
+ version_requirements: *2153703940
119
130
  - !ruby/object:Gem::Dependency
120
131
  name: vcr
121
- requirement: &2153869140 !ruby/object:Gem::Requirement
132
+ requirement: &2153702840 !ruby/object:Gem::Requirement
122
133
  none: false
123
134
  requirements:
124
135
  - - ~>
@@ -126,10 +137,10 @@ dependencies:
126
137
  version: '2.6'
127
138
  type: :development
128
139
  prerelease: false
129
- version_requirements: *2153869140
140
+ version_requirements: *2153702840
130
141
  - !ruby/object:Gem::Dependency
131
142
  name: simplecov
132
- requirement: &2153868420 !ruby/object:Gem::Requirement
143
+ requirement: &2153701280 !ruby/object:Gem::Requirement
133
144
  none: false
134
145
  requirements:
135
146
  - - ~>
@@ -137,10 +148,10 @@ dependencies:
137
148
  version: 0.7.1
138
149
  type: :development
139
150
  prerelease: false
140
- version_requirements: *2153868420
151
+ version_requirements: *2153701280
141
152
  - !ruby/object:Gem::Dependency
142
153
  name: coveralls
143
- requirement: &2153867140 !ruby/object:Gem::Requirement
154
+ requirement: &2153700180 !ruby/object:Gem::Requirement
144
155
  none: false
145
156
  requirements:
146
157
  - - ~>
@@ -148,10 +159,10 @@ dependencies:
148
159
  version: 0.6.7
149
160
  type: :development
150
161
  prerelease: false
151
- version_requirements: *2153867140
162
+ version_requirements: *2153700180
152
163
  - !ruby/object:Gem::Dependency
153
164
  name: guard
154
- requirement: &2153858560 !ruby/object:Gem::Requirement
165
+ requirement: &2153699280 !ruby/object:Gem::Requirement
155
166
  none: false
156
167
  requirements:
157
168
  - - ~>
@@ -159,10 +170,10 @@ dependencies:
159
170
  version: 1.8.1
160
171
  type: :development
161
172
  prerelease: false
162
- version_requirements: *2153858560
173
+ version_requirements: *2153699280
163
174
  - !ruby/object:Gem::Dependency
164
175
  name: guard-rspec
165
- requirement: &2153856820 !ruby/object:Gem::Requirement
176
+ requirement: &2153698340 !ruby/object:Gem::Requirement
166
177
  none: false
167
178
  requirements:
168
179
  - - ~>
@@ -170,10 +181,10 @@ dependencies:
170
181
  version: 3.0.2
171
182
  type: :development
172
183
  prerelease: false
173
- version_requirements: *2153856820
184
+ version_requirements: *2153698340
174
185
  - !ruby/object:Gem::Dependency
175
186
  name: guard-cucumber
176
- requirement: &2153853600 !ruby/object:Gem::Requirement
187
+ requirement: &2153697380 !ruby/object:Gem::Requirement
177
188
  none: false
178
189
  requirements:
179
190
  - - ~>
@@ -181,10 +192,10 @@ dependencies:
181
192
  version: '1.4'
182
193
  type: :development
183
194
  prerelease: false
184
- version_requirements: *2153853600
195
+ version_requirements: *2153697380
185
196
  - !ruby/object:Gem::Dependency
186
197
  name: rake
187
- requirement: &2153851960 !ruby/object:Gem::Requirement
198
+ requirement: &2153690080 !ruby/object:Gem::Requirement
188
199
  none: false
189
200
  requirements:
190
201
  - - ~>
@@ -192,10 +203,10 @@ dependencies:
192
203
  version: '10.1'
193
204
  type: :development
194
205
  prerelease: false
195
- version_requirements: *2153851960
206
+ version_requirements: *2153690080
196
207
  - !ruby/object:Gem::Dependency
197
208
  name: bundler
198
- requirement: &2153838340 !ruby/object:Gem::Requirement
209
+ requirement: &2153688720 !ruby/object:Gem::Requirement
199
210
  none: false
200
211
  requirements:
201
212
  - - ~>
@@ -203,7 +214,7 @@ dependencies:
203
214
  version: '1.3'
204
215
  type: :development
205
216
  prerelease: false
206
- version_requirements: *2153838340
217
+ version_requirements: *2153688720
207
218
  description: ! ' Ruby wrapper that supports all of the GitHub API v3 methods(nearly
208
219
  200). It''s build in a modular way, that is, you can either instantiate the whole
209
220
  api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely
@@ -219,6 +230,7 @@ files:
219
230
  - features/activity/starring.feature
220
231
  - features/activity/watching.feature
221
232
  - features/arguments_parsing.feature
233
+ - features/authorizations.feature
222
234
  - features/auto_pagination.feature
223
235
  - features/cassettes/activity/events/issue.yml
224
236
  - features/cassettes/activity/events/network.yml
@@ -242,6 +254,7 @@ files:
242
254
  - features/cassettes/arguments/orgs/get.yml
243
255
  - features/cassettes/arguments/pulls/get.yml
244
256
  - features/cassettes/arguments/repo_commits/get.yml
257
+ - features/cassettes/auths/list.yml
245
258
  - features/cassettes/auto_pagination/repos/get.yml
246
259
  - features/cassettes/auto_pagination/repos/global_list.yml
247
260
  - features/cassettes/auto_pagination/repos/list.yml
@@ -374,6 +387,7 @@ files:
374
387
  - features/cassettes/say/random.yml
375
388
  - features/cassettes/search/code.yml
376
389
  - features/cassettes/search/code_query.yml
390
+ - features/cassettes/search/code_unicode.yml
377
391
  - features/cassettes/search/issues.yml
378
392
  - features/cassettes/search/legacy/email.yml
379
393
  - features/cassettes/search/legacy/issues.yml
@@ -458,7 +472,6 @@ files:
458
472
  - lib/github_api/core_ext/hash.rb
459
473
  - lib/github_api/core_ext/ordered_hash.rb
460
474
  - lib/github_api/deprecation.rb
461
- - lib/github_api/descendants.rb
462
475
  - lib/github_api/emojis.rb
463
476
  - lib/github_api/error/bad_request.rb
464
477
  - lib/github_api/error/client_error.rb
@@ -476,6 +489,7 @@ files:
476
489
  - lib/github_api/error/unprocessable_entity.rb
477
490
  - lib/github_api/error/validations.rb
478
491
  - lib/github_api/error.rb
492
+ - lib/github_api/ext/faraday.rb
479
493
  - lib/github_api/gists/comments.rb
480
494
  - lib/github_api/gists.rb
481
495
  - lib/github_api/git_data/blobs.rb
@@ -496,6 +510,7 @@ files:
496
510
  - lib/github_api/meta.rb
497
511
  - lib/github_api/mime_type.rb
498
512
  - lib/github_api/normalizer.rb
513
+ - lib/github_api/null_encoder.rb
499
514
  - lib/github_api/orgs/members.rb
500
515
  - lib/github_api/orgs/teams.rb
501
516
  - lib/github_api/orgs.rb
@@ -703,6 +718,8 @@ files:
703
718
  - spec/github/error/client_error_spec.rb
704
719
  - spec/github/error/invalid_options_spec.rb
705
720
  - spec/github/error/required_params_spec.rb
721
+ - spec/github/error/service_error/parse_body_spec.rb
722
+ - spec/github/error/service_error/parse_response_spec.rb
706
723
  - spec/github/error/service_error_spec.rb
707
724
  - spec/github/error/unknown_media_spec.rb
708
725
  - spec/github/error/unknown_value_spec.rb
@@ -1,9 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Github
4
- module Descendants
5
- def descendants
6
- ObjectSpace.each_object(::Class).select { |klass| klass < self }
7
- end
8
- end
9
- end