github_api 0.18.2 → 0.19.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 +5 -5
- data/CHANGELOG.md +770 -0
- data/README.md +3 -5
- data/lib/github_api.rb +0 -1
- data/lib/github_api/api.rb +1 -1
- data/lib/github_api/api/arguments.rb +1 -1
- data/lib/github_api/api/config.rb +1 -1
- data/lib/github_api/client/activity/starring.rb +1 -1
- data/lib/github_api/client/activity/watching.rb +1 -1
- data/lib/github_api/client/gists.rb +2 -2
- data/lib/github_api/client/gists/comments.rb +1 -1
- data/lib/github_api/client/git_data/references.rb +4 -2
- data/lib/github_api/client/markdown.rb +1 -1
- data/lib/github_api/client/orgs/teams.rb +3 -3
- data/lib/github_api/client/projects/cards.rb +2 -2
- data/lib/github_api/client/repos.rb +6 -1
- data/lib/github_api/client/repos/branches/protections.rb +1 -1
- data/lib/github_api/client/repos/contents.rb +20 -3
- data/lib/github_api/client/repos/deployments.rb +1 -1
- data/lib/github_api/client/repos/forks.rb +4 -2
- data/lib/github_api/client/repos/invitations.rb +41 -0
- data/lib/github_api/connection.rb +1 -1
- data/lib/github_api/error/service_error.rb +1 -1
- data/lib/github_api/ext/faraday.rb +2 -0
- data/lib/github_api/pagination.rb +6 -6
- data/lib/github_api/request.rb +2 -3
- data/lib/github_api/response/follow_redirects.rb +1 -1
- data/lib/github_api/validations/presence.rb +1 -1
- data/lib/github_api/version.rb +2 -2
- metadata +40 -26
- data/lib/github_api/core_ext/ordered_hash.rb +0 -107
- data/lib/github_api/requestable.rb +0 -67
- data/lib/github_api/resource.rb +0 -13
data/lib/github_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: faraday
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0.8'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '2'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0.8'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: oauth2
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,9 +99,6 @@ dependencies:
|
|
93
99
|
- - ">="
|
94
100
|
- !ruby/object:Gem::Version
|
95
101
|
version: 1.5.0
|
96
|
-
- - "<"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '2.0'
|
99
102
|
type: :development
|
100
103
|
prerelease: false
|
101
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -103,23 +106,20 @@ dependencies:
|
|
103
106
|
- - ">="
|
104
107
|
- !ruby/object:Gem::Version
|
105
108
|
version: 1.5.0
|
106
|
-
- - "<"
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '2.0'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: rake
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - "
|
113
|
+
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: '
|
115
|
+
version: '0'
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- - "
|
120
|
+
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '
|
122
|
+
version: '0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: cucumber
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,14 +140,28 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - "~>"
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: '3'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '3'
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
name: rspec-its
|
153
|
+
requirement: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - "~>"
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '1'
|
144
158
|
type: :development
|
145
159
|
prerelease: false
|
146
160
|
version_requirements: !ruby/object:Gem::Requirement
|
147
161
|
requirements:
|
148
162
|
- - "~>"
|
149
163
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
164
|
+
version: '1'
|
151
165
|
- !ruby/object:Gem::Dependency
|
152
166
|
name: vcr
|
153
167
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,25 +182,28 @@ dependencies:
|
|
168
182
|
requirements:
|
169
183
|
- - "~>"
|
170
184
|
- !ruby/object:Gem::Version
|
171
|
-
version: 3.
|
185
|
+
version: '3.8'
|
172
186
|
type: :development
|
173
187
|
prerelease: false
|
174
188
|
version_requirements: !ruby/object:Gem::Requirement
|
175
189
|
requirements:
|
176
190
|
- - "~>"
|
177
191
|
- !ruby/object:Gem::Version
|
178
|
-
version: 3.
|
179
|
-
description:
|
192
|
+
version: '3.8'
|
193
|
+
description: ' Ruby client that supports all of the GitHub API methods. It"s build
|
180
194
|
in a modular way, that is, you can either instantiate the whole api wrapper Github.new
|
181
195
|
or use parts of it e.i. Github::Client::Repos.new if working solely with repositories
|
182
|
-
is your main concern. Intuitive query methods allow you easily call API endpoints.
|
183
|
-
email:
|
196
|
+
is your main concern. Intuitive query methods allow you easily call API endpoints. '
|
197
|
+
email:
|
198
|
+
- piotr@piotrmurach.com
|
184
199
|
executables: []
|
185
200
|
extensions: []
|
186
201
|
extra_rdoc_files:
|
187
202
|
- LICENSE.txt
|
188
203
|
- README.md
|
204
|
+
- CHANGELOG.md
|
189
205
|
files:
|
206
|
+
- CHANGELOG.md
|
190
207
|
- LICENSE.txt
|
191
208
|
- README.md
|
192
209
|
- lib/github_api.rb
|
@@ -248,6 +265,7 @@ files:
|
|
248
265
|
- lib/github_api/client/repos/downloads.rb
|
249
266
|
- lib/github_api/client/repos/forks.rb
|
250
267
|
- lib/github_api/client/repos/hooks.rb
|
268
|
+
- lib/github_api/client/repos/invitations.rb
|
251
269
|
- lib/github_api/client/repos/keys.rb
|
252
270
|
- lib/github_api/client/repos/merging.rb
|
253
271
|
- lib/github_api/client/repos/pages.rb
|
@@ -271,7 +289,6 @@ files:
|
|
271
289
|
- lib/github_api/constants.rb
|
272
290
|
- lib/github_api/core_ext/array.rb
|
273
291
|
- lib/github_api/core_ext/hash.rb
|
274
|
-
- lib/github_api/core_ext/ordered_hash.rb
|
275
292
|
- lib/github_api/deprecation.rb
|
276
293
|
- lib/github_api/error.rb
|
277
294
|
- lib/github_api/error/client_error.rb
|
@@ -294,8 +311,6 @@ files:
|
|
294
311
|
- lib/github_api/request/jsonize.rb
|
295
312
|
- lib/github_api/request/oauth2.rb
|
296
313
|
- lib/github_api/request/verbs.rb
|
297
|
-
- lib/github_api/requestable.rb
|
298
|
-
- lib/github_api/resource.rb
|
299
314
|
- lib/github_api/response.rb
|
300
315
|
- lib/github_api/response/atom_parser.rb
|
301
316
|
- lib/github_api/response/follow_redirects.rb
|
@@ -332,8 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
347
|
- !ruby/object:Gem::Version
|
333
348
|
version: '0'
|
334
349
|
requirements: []
|
335
|
-
|
336
|
-
rubygems_version: 2.5.1
|
350
|
+
rubygems_version: 3.1.2
|
337
351
|
signing_key:
|
338
352
|
specification_version: 4
|
339
353
|
summary: Ruby client for the official GitHub API
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Github
|
4
|
-
module CoreExt #:nodoc:
|
5
|
-
|
6
|
-
if RUBY_VERSION >= '1.9'
|
7
|
-
class OrderedHash < ::Hash; end
|
8
|
-
else
|
9
|
-
class OrderedHash < ::Hash
|
10
|
-
attr_accessor :order
|
11
|
-
|
12
|
-
class << self
|
13
|
-
def [](*args)
|
14
|
-
hsh = OrderedHash.new
|
15
|
-
if Hash == args[0]
|
16
|
-
hsh.replace args[0]
|
17
|
-
elsif (args.size % 2) != 0
|
18
|
-
pp args if ENV['DEBUG']
|
19
|
-
raise ArgumentError, "odd number of elements for Hash"
|
20
|
-
else
|
21
|
-
0.step(args.size - 1, 2) do |a|
|
22
|
-
b = a + 1
|
23
|
-
hsh[args[a]] = args[b]
|
24
|
-
end
|
25
|
-
end
|
26
|
-
hsh
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def initialize(*args, &block)
|
31
|
-
super
|
32
|
-
@order = []
|
33
|
-
end
|
34
|
-
|
35
|
-
def []=(key, value)
|
36
|
-
@order.push key unless member?(key)
|
37
|
-
super key, value
|
38
|
-
end
|
39
|
-
|
40
|
-
def ==(hsh2)
|
41
|
-
return false if @order != hsh2.order
|
42
|
-
super hsh2
|
43
|
-
end
|
44
|
-
|
45
|
-
def clear
|
46
|
-
@order = []
|
47
|
-
super
|
48
|
-
end
|
49
|
-
|
50
|
-
def delete(key)
|
51
|
-
@order.delete key
|
52
|
-
super
|
53
|
-
end
|
54
|
-
|
55
|
-
def each_key
|
56
|
-
@order.each { |k| yield k }
|
57
|
-
self
|
58
|
-
end
|
59
|
-
|
60
|
-
def each_value
|
61
|
-
@order.each { |k| yield self[k] }
|
62
|
-
self
|
63
|
-
end
|
64
|
-
|
65
|
-
def each
|
66
|
-
@order.each { |k| yield k, self[k] }
|
67
|
-
self
|
68
|
-
end
|
69
|
-
alias :each_pair :each
|
70
|
-
|
71
|
-
def delete_if
|
72
|
-
@order.clone.each { |k| delete k if yield }
|
73
|
-
self
|
74
|
-
end
|
75
|
-
|
76
|
-
def values
|
77
|
-
ary = []
|
78
|
-
@order.each { |k| ary.push self[k] }
|
79
|
-
ary
|
80
|
-
end
|
81
|
-
|
82
|
-
def keys
|
83
|
-
@order
|
84
|
-
end
|
85
|
-
|
86
|
-
def replace(hsh2)
|
87
|
-
@order = hsh2.keys
|
88
|
-
super hsh2
|
89
|
-
end
|
90
|
-
|
91
|
-
def shift
|
92
|
-
key = @order.first
|
93
|
-
key ? [key, delete(key)] : super
|
94
|
-
end
|
95
|
-
|
96
|
-
def class
|
97
|
-
Hash
|
98
|
-
end
|
99
|
-
|
100
|
-
def __class__
|
101
|
-
OrderedHash
|
102
|
-
end
|
103
|
-
end # OrderedHash
|
104
|
-
end
|
105
|
-
|
106
|
-
end # CoreExt
|
107
|
-
end # Github
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Github
|
4
|
-
# Defines HTTP verbs
|
5
|
-
module Request
|
6
|
-
|
7
|
-
METHODS = [:get, :post, :put, :delete, :patch]
|
8
|
-
METHODS_WITH_BODIES = [ :post, :put, :patch ]
|
9
|
-
|
10
|
-
def get_request(path, params={}, options={})
|
11
|
-
request(:get, path, params, options)
|
12
|
-
end
|
13
|
-
|
14
|
-
def patch_request(path, params={}, options={})
|
15
|
-
request(:patch, path, params, options)
|
16
|
-
end
|
17
|
-
|
18
|
-
def post_request(path, params={}, options={})
|
19
|
-
request(:post, path, params, options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def put_request(path, params={}, options={})
|
23
|
-
request(:put, path, params, options)
|
24
|
-
end
|
25
|
-
|
26
|
-
def delete_request(path, params={}, options={})
|
27
|
-
request(:delete, path, params, options)
|
28
|
-
end
|
29
|
-
|
30
|
-
def request(method, path, params, options)
|
31
|
-
if !METHODS.include?(method)
|
32
|
-
raise ArgumentError, "unkown http method: #{method}"
|
33
|
-
end
|
34
|
-
# _extract_mime_type(params, options)
|
35
|
-
|
36
|
-
puts "EXECUTED: #{method} - #{path} with #{params} and #{options}" if ENV['DEBUG']
|
37
|
-
|
38
|
-
conn = connection(options)
|
39
|
-
path = (conn.path_prefix + path).gsub(/\/\//,'/') if conn.path_prefix != '/'
|
40
|
-
|
41
|
-
response = conn.send(method) do |request|
|
42
|
-
case method.to_sym
|
43
|
-
when *(METHODS - METHODS_WITH_BODIES)
|
44
|
-
request.body = params.delete('data') if params.has_key?('data')
|
45
|
-
request.url(path, params)
|
46
|
-
when *METHODS_WITH_BODIES
|
47
|
-
request.path = path
|
48
|
-
request.body = extract_data_from_params(params) unless params.empty?
|
49
|
-
end
|
50
|
-
end
|
51
|
-
response.body
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
def extract_data_from_params(params) # :nodoc:
|
57
|
-
return params['data'] if params.has_key?('data') and !params['data'].nil?
|
58
|
-
return params
|
59
|
-
end
|
60
|
-
|
61
|
-
def _extract_mime_type(params, options) # :nodoc:
|
62
|
-
options['resource'] = params['resource'] ? params.delete('resource') : ''
|
63
|
-
options['mime_type'] = params['resource'] ? params.delete('mime_type') : ''
|
64
|
-
end
|
65
|
-
|
66
|
-
end # Request
|
67
|
-
end # Github
|