github_api 0.7.0 → 0.7.1
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/README.md +11 -5
- data/Rakefile +2 -0
- data/features/repos/statuses.feature +12 -12
- data/lib/github_api/api.rb +1 -1
- data/lib/github_api/authorizations.rb +3 -3
- data/lib/github_api/events.rb +7 -7
- data/lib/github_api/gists.rb +7 -7
- data/lib/github_api/gists/comments.rb +4 -4
- data/lib/github_api/git_data/blobs.rb +2 -3
- data/lib/github_api/git_data/commits.rb +2 -3
- data/lib/github_api/git_data/references.rb +10 -17
- data/lib/github_api/git_data/tags.rb +2 -3
- data/lib/github_api/git_data/trees.rb +2 -3
- data/lib/github_api/issues.rb +4 -6
- data/lib/github_api/issues/assignees.rb +5 -4
- data/lib/github_api/issues/comments.rb +5 -10
- data/lib/github_api/issues/events.rb +2 -3
- data/lib/github_api/issues/labels.rb +11 -20
- data/lib/github_api/issues/milestones.rb +5 -8
- data/lib/github_api/orgs.rb +2 -2
- data/lib/github_api/orgs/members.rb +7 -7
- data/lib/github_api/orgs/teams.rb +13 -13
- data/lib/github_api/page_iterator.rb +3 -1
- data/lib/github_api/pull_requests.rb +8 -16
- data/lib/github_api/pull_requests/comments.rb +5 -10
- data/lib/github_api/repos.rb +27 -8
- data/lib/github_api/repos/collaborators.rb +4 -7
- data/lib/github_api/repos/commits.rb +9 -16
- data/lib/github_api/repos/downloads.rb +5 -7
- data/lib/github_api/repos/forks.rb +3 -3
- data/lib/github_api/repos/hooks.rb +10 -13
- data/lib/github_api/repos/keys.rb +5 -8
- data/lib/github_api/repos/pub_sub_hubbub.rb +4 -4
- data/lib/github_api/repos/starring.rb +4 -4
- data/lib/github_api/repos/statuses.rb +2 -2
- data/lib/github_api/repos/watching.rb +4 -4
- data/lib/github_api/users/followers.rb +3 -3
- data/lib/github_api/users/keys.rb +3 -3
- data/lib/github_api/validations/presence.rb +16 -17
- data/lib/github_api/version.rb +1 -1
- data/spec/fixtures/repos/repos_sorted_by_pushed.json +56 -0
- data/spec/github/git_data_spec.rb +5 -7
- data/spec/github/issues_spec.rb +12 -12
- data/spec/github/orgs_spec.rb +2 -4
- data/spec/github/pull_requests_spec.rb +1 -1
- data/spec/github/repos/branch_spec.rb +48 -0
- data/spec/github/repos/branches_spec.rb +62 -0
- data/spec/github/repos/contributors_spec.rb +62 -0
- data/spec/github/repos/create_spec.rb +77 -0
- data/spec/github/repos/delete_spec.rb +43 -0
- data/spec/github/repos/downloads_spec.rb +51 -45
- data/spec/github/repos/edit_spec.rb +66 -0
- data/spec/github/repos/forks/create_spec.rb +49 -0
- data/spec/github/repos/forks/list_spec.rb +65 -0
- data/spec/github/repos/get_spec.rb +57 -0
- data/spec/github/repos/languages_spec.rb +61 -0
- data/spec/github/repos/list_spec.rb +99 -0
- data/spec/github/repos/tags_spec.rb +59 -0
- data/spec/github/repos/teams_spec.rb +59 -0
- data/spec/github/repos_spec.rb +13 -578
- data/spec/github/validations/presence_spec.rb +23 -4
- metadata +48 -42
- data/spec/github/repos/forks_spec.rb +0 -106
@@ -21,8 +21,7 @@ module Github
|
|
21
21
|
#
|
22
22
|
def list(user_name, repo_name, request_id, params={})
|
23
23
|
_update_user_repo_params(user_name, repo_name)
|
24
|
-
|
25
|
-
_validate_presence_of request_id
|
24
|
+
assert_presence_of user, repo, request_id
|
26
25
|
|
27
26
|
normalize! params
|
28
27
|
# _merge_mime_type(:pull_comment, params)
|
@@ -40,8 +39,7 @@ module Github
|
|
40
39
|
#
|
41
40
|
def get(user_name, repo_name, comment_id, params={})
|
42
41
|
_update_user_repo_params(user_name, repo_name)
|
43
|
-
|
44
|
-
_validate_presence_of comment_id
|
42
|
+
assert_presence_of user, repo, comment_id
|
45
43
|
|
46
44
|
normalize! params
|
47
45
|
# _merge_mime_type(:pull_comment, params)
|
@@ -80,8 +78,7 @@ module Github
|
|
80
78
|
#
|
81
79
|
def create(user_name, repo_name, request_id, params={})
|
82
80
|
_update_user_repo_params(user_name, repo_name)
|
83
|
-
|
84
|
-
_validate_presence_of request_id
|
81
|
+
assert_presence_of user, repo, request_id
|
85
82
|
|
86
83
|
normalize! params
|
87
84
|
# _merge_mime_type(:pull_comment, params)
|
@@ -103,8 +100,7 @@ module Github
|
|
103
100
|
#
|
104
101
|
def edit(user_name, repo_name, comment_id, params={})
|
105
102
|
_update_user_repo_params(user_name, repo_name)
|
106
|
-
|
107
|
-
_validate_presence_of comment_id
|
103
|
+
assert_presence_of user, repo, comment_id
|
108
104
|
|
109
105
|
normalize! params
|
110
106
|
# _merge_mime_type(:pull_comment, params)
|
@@ -121,8 +117,7 @@ module Github
|
|
121
117
|
#
|
122
118
|
def delete(user_name, repo_name, comment_id, params={})
|
123
119
|
_update_user_repo_params(user_name, repo_name)
|
124
|
-
|
125
|
-
_validate_presence_of comment_id
|
120
|
+
assert_presence_of user, repo, comment_id
|
126
121
|
|
127
122
|
normalize! params
|
128
123
|
# _merge_mime_type(:pull_comment, params)
|
data/lib/github_api/repos.rb
CHANGED
@@ -117,7 +117,7 @@ module Github
|
|
117
117
|
#
|
118
118
|
def branches(user_name, repo_name, params={})
|
119
119
|
_update_user_repo_params(user_name, repo_name)
|
120
|
-
|
120
|
+
assert_presence_of user, repo
|
121
121
|
normalize! params
|
122
122
|
|
123
123
|
response = get_request("/repos/#{user}/#{repo}/branches", params)
|
@@ -134,6 +134,7 @@ module Github
|
|
134
134
|
# github.repos.branch 'user-name', 'repo-name', 'branch-name'
|
135
135
|
#
|
136
136
|
def branch(user_name, repo_name, branch, params={})
|
137
|
+
assert_presence_of user_name, repo_name, branch
|
137
138
|
normalize! params
|
138
139
|
|
139
140
|
get_request("repos/#{user_name}/#{repo_name}/branches/#{branch}", params)
|
@@ -183,6 +184,24 @@ module Github
|
|
183
184
|
end
|
184
185
|
end
|
185
186
|
|
187
|
+
# Delete a repository
|
188
|
+
#
|
189
|
+
# Deleting a repository requires admin access.
|
190
|
+
# If OAuth is used, the delete_repo scope is required.
|
191
|
+
#
|
192
|
+
# = Examples
|
193
|
+
# github = Github.new :oauth_token => '...'
|
194
|
+
# github.repos.delete 'user-name', 'repo-name'
|
195
|
+
#
|
196
|
+
def delete(user_name, repo_name, params={})
|
197
|
+
_update_user_repo_params(user_name, repo_name)
|
198
|
+
assert_presence_of user, repo
|
199
|
+
normalize! params
|
200
|
+
|
201
|
+
delete_request("/repos/#{user}/#{repo}")
|
202
|
+
end
|
203
|
+
alias :remove :delete
|
204
|
+
|
186
205
|
# List contributors
|
187
206
|
#
|
188
207
|
# = Parameters
|
@@ -196,7 +215,7 @@ module Github
|
|
196
215
|
#
|
197
216
|
def contributors(user_name, repo_name, params={})
|
198
217
|
_update_user_repo_params(user_name, repo_name)
|
199
|
-
|
218
|
+
assert_presence_of user, repo
|
200
219
|
normalize! params
|
201
220
|
filter! ['anon'], params
|
202
221
|
|
@@ -229,7 +248,7 @@ module Github
|
|
229
248
|
#
|
230
249
|
def edit(user_name, repo_name, params={})
|
231
250
|
_update_user_repo_params(user_name, repo_name)
|
232
|
-
|
251
|
+
assert_presence_of user, repo
|
233
252
|
|
234
253
|
normalize! params
|
235
254
|
filter! VALID_REPO_OPTIONS, params
|
@@ -246,7 +265,7 @@ module Github
|
|
246
265
|
#
|
247
266
|
def get(user_name, repo_name, params={})
|
248
267
|
_update_user_repo_params(user_name, repo_name)
|
249
|
-
|
268
|
+
assert_presence_of user, repo
|
250
269
|
normalize! params
|
251
270
|
|
252
271
|
get_request("/repos/#{user}/#{repo}", params)
|
@@ -262,7 +281,7 @@ module Github
|
|
262
281
|
#
|
263
282
|
def languages(user_name, repo_name, params={})
|
264
283
|
_update_user_repo_params(user_name, repo_name)
|
265
|
-
|
284
|
+
assert_presence_of user, repo
|
266
285
|
normalize! params
|
267
286
|
|
268
287
|
response = get_request("/repos/#{user}/#{repo}/languages", params)
|
@@ -295,7 +314,7 @@ module Github
|
|
295
314
|
def list(*args)
|
296
315
|
params = args.extract_options!
|
297
316
|
normalize! params
|
298
|
-
filter! %w[ org
|
317
|
+
filter! %w[ user org type sort direction ], params
|
299
318
|
|
300
319
|
response = if (user_name = params.delete("user"))
|
301
320
|
get_request("/users/#{user_name}/repos", params)
|
@@ -319,7 +338,7 @@ module Github
|
|
319
338
|
#
|
320
339
|
def tags(user_name, repo_name, params={})
|
321
340
|
_update_user_repo_params(user_name, repo_name)
|
322
|
-
|
341
|
+
assert_presence_of user, repo
|
323
342
|
normalize! params
|
324
343
|
|
325
344
|
response = get_request("/repos/#{user}/#{repo}/tags", params)
|
@@ -339,7 +358,7 @@ module Github
|
|
339
358
|
#
|
340
359
|
def teams(user_name, repo_name, params={})
|
341
360
|
_update_user_repo_params(user_name, repo_name)
|
342
|
-
|
361
|
+
assert_presence_of user, repo
|
343
362
|
normalize! params
|
344
363
|
|
345
364
|
response = get_request("/repos/#{user}/#{repo}/teams", params)
|
@@ -14,8 +14,7 @@ module Github
|
|
14
14
|
#
|
15
15
|
def add(user_name, repo_name, collaborator, params={})
|
16
16
|
_update_user_repo_params(user_name, repo_name)
|
17
|
-
|
18
|
-
_validate_presence_of collaborator
|
17
|
+
assert_presence_of user, repo, collaborator
|
19
18
|
normalize! params
|
20
19
|
|
21
20
|
put_request("/repos/#{user}/#{repo}/collaborators/#{collaborator}", params)
|
@@ -30,8 +29,7 @@ module Github
|
|
30
29
|
#
|
31
30
|
def collaborator?(user_name, repo_name, collaborator, params={})
|
32
31
|
_update_user_repo_params(user_name, repo_name)
|
33
|
-
|
34
|
-
_validate_presence_of collaborator
|
32
|
+
assert_presence_of user, repo, collaborator
|
35
33
|
normalize! params
|
36
34
|
|
37
35
|
get_request("/repos/#{user}/#{repo}/collaborators/#{collaborator}", params)
|
@@ -49,7 +47,7 @@ module Github
|
|
49
47
|
#
|
50
48
|
def list(user_name, repo_name, params={})
|
51
49
|
_update_user_repo_params(user_name, repo_name)
|
52
|
-
|
50
|
+
assert_presence_of user, repo
|
53
51
|
normalize! params
|
54
52
|
|
55
53
|
response = get_request("/repos/#{user}/#{repo}/collaborators", params)
|
@@ -66,8 +64,7 @@ module Github
|
|
66
64
|
#
|
67
65
|
def remove(user_name, repo_name, collaborator, params={})
|
68
66
|
_update_user_repo_params(user_name, repo_name)
|
69
|
-
|
70
|
-
_validate_presence_of collaborator
|
67
|
+
assert_presence_of collaborator
|
71
68
|
normalize! params
|
72
69
|
|
73
70
|
delete_request("/repos/#{user}/#{repo}/collaborators/#{collaborator}", params)
|
@@ -22,7 +22,7 @@ module Github
|
|
22
22
|
# 'master'
|
23
23
|
#
|
24
24
|
def compare(user_name, repo_name, base, head, params={})
|
25
|
-
|
25
|
+
assert_presence_of base, head
|
26
26
|
normalize! params
|
27
27
|
|
28
28
|
get_request("/repos/#{user_name}/#{repo_name}/compare/#{base}...#{head}", params)
|
@@ -48,8 +48,7 @@ module Github
|
|
48
48
|
#
|
49
49
|
def create_comment(user_name, repo_name, sha, params={})
|
50
50
|
_update_user_repo_params(user_name, repo_name)
|
51
|
-
|
52
|
-
_validate_presence_of sha
|
51
|
+
assert_presence_of user, repo, sha
|
53
52
|
|
54
53
|
normalize! params
|
55
54
|
filter! REQUIRED_COMMENT_PARAMS, params
|
@@ -67,8 +66,7 @@ module Github
|
|
67
66
|
#
|
68
67
|
def delete_comment(user_name, repo_name, comment_id, params={})
|
69
68
|
_update_user_repo_params(user_name, repo_name)
|
70
|
-
|
71
|
-
_validate_presence_of comment_id
|
69
|
+
assert_presence_of user, repo, comment_id
|
72
70
|
normalize! params
|
73
71
|
|
74
72
|
delete_request("/repos/#{user}/#{repo}/comments/#{comment_id}", params)
|
@@ -88,7 +86,7 @@ module Github
|
|
88
86
|
#
|
89
87
|
def list(user_name, repo_name, params={})
|
90
88
|
_update_user_repo_params(user_name, repo_name)
|
91
|
-
|
89
|
+
assert_presence_of user, repo
|
92
90
|
normalize! params
|
93
91
|
filter! %w[sha path author], params
|
94
92
|
|
@@ -107,7 +105,7 @@ module Github
|
|
107
105
|
#
|
108
106
|
def repo_comments(user_name, repo_name, params={})
|
109
107
|
_update_user_repo_params(user_name, repo_name)
|
110
|
-
|
108
|
+
assert_presence_of user, repo
|
111
109
|
normalize! params
|
112
110
|
|
113
111
|
response = get_request("/repos/#{user}/#{repo}/comments", params)
|
@@ -125,8 +123,7 @@ module Github
|
|
125
123
|
#
|
126
124
|
def commit_comments(user_name, repo_name, sha, params={})
|
127
125
|
_update_user_repo_params(user_name, repo_name)
|
128
|
-
|
129
|
-
_validate_presence_of sha
|
126
|
+
assert_presence_of user, repo, sha
|
130
127
|
normalize! params
|
131
128
|
|
132
129
|
response = get_request("/repos/#{user}/#{repo}/commits/#{sha}/comments", params)
|
@@ -143,8 +140,7 @@ module Github
|
|
143
140
|
#
|
144
141
|
def get(user_name, repo_name, sha, params={})
|
145
142
|
_update_user_repo_params(user_name, repo_name)
|
146
|
-
|
147
|
-
_validate_presence_of sha
|
143
|
+
assert_presence_of user, repo, sha
|
148
144
|
normalize! params
|
149
145
|
|
150
146
|
get_request("/repos/#{user}/#{repo}/commits/#{sha}", params)
|
@@ -159,8 +155,7 @@ module Github
|
|
159
155
|
#
|
160
156
|
def commit_comment(user_name, repo_name, comment_id, params={})
|
161
157
|
_update_user_repo_params(user_name, repo_name)
|
162
|
-
|
163
|
-
_validate_presence_of comment_id
|
158
|
+
assert_presence_of user, repo, comment_id
|
164
159
|
normalize! params
|
165
160
|
|
166
161
|
get_request("/repos/#{user}/#{repo}/comments/#{comment_id}", params)
|
@@ -179,9 +174,7 @@ module Github
|
|
179
174
|
#
|
180
175
|
def update_comment(user_name, repo_name, comment_id, params={})
|
181
176
|
_update_user_repo_params(user_name, repo_name)
|
182
|
-
|
183
|
-
_validate_presence_of comment_id
|
184
|
-
|
177
|
+
assert_presence_of user, repo, comment_id
|
185
178
|
normalize! params
|
186
179
|
assert_required_keys(%w[ body ], params)
|
187
180
|
|
@@ -23,7 +23,7 @@ module Github
|
|
23
23
|
#
|
24
24
|
def list(user_name, repo_name, params={})
|
25
25
|
_update_user_repo_params(user_name, repo_name)
|
26
|
-
|
26
|
+
assert_presence_of user, repo
|
27
27
|
normalize! params
|
28
28
|
|
29
29
|
response = get_request("/repos/#{user}/#{repo}/downloads", params)
|
@@ -40,8 +40,7 @@ module Github
|
|
40
40
|
#
|
41
41
|
def get(user_name, repo_name, download_id, params={})
|
42
42
|
_update_user_repo_params(user_name, repo_name)
|
43
|
-
|
44
|
-
_validate_presence_of download_id
|
43
|
+
assert_presence_of user, repo, download_id
|
45
44
|
normalize! params
|
46
45
|
|
47
46
|
get_request("/repos/#{user}/#{repo}/downloads/#{download_id}", params)
|
@@ -56,8 +55,7 @@ module Github
|
|
56
55
|
#
|
57
56
|
def delete(user_name, repo_name, download_id, params={})
|
58
57
|
_update_user_repo_params(user_name, repo_name)
|
59
|
-
|
60
|
-
_validate_presence_of download_id
|
58
|
+
assert_presence_of user, repo, download_id
|
61
59
|
normalize! params
|
62
60
|
|
63
61
|
delete_request("/repos/#{user}/#{repo}/downloads/#{download_id}", params)
|
@@ -83,7 +81,7 @@ module Github
|
|
83
81
|
#
|
84
82
|
def create(user_name, repo_name, params={})
|
85
83
|
_update_user_repo_params(user_name, repo_name)
|
86
|
-
|
84
|
+
assert_presence_of user, repo
|
87
85
|
|
88
86
|
normalize! params
|
89
87
|
filter! VALID_DOWNLOAD_PARAM_NAMES, params
|
@@ -106,7 +104,7 @@ module Github
|
|
106
104
|
# github.repos.downloads.upload resource, '/users/octokit/image.jpg'
|
107
105
|
#
|
108
106
|
def upload(resource, filename)
|
109
|
-
|
107
|
+
assert_presence_of resource, filename
|
110
108
|
|
111
109
|
response = Github::S3Uploader.new(resource, filename).send
|
112
110
|
response.body
|
@@ -11,11 +11,11 @@ module Github
|
|
11
11
|
# = Examples
|
12
12
|
# github = Github.new
|
13
13
|
# github.repos.forks.list 'user-name', 'repo-name'
|
14
|
-
# github.repos.forks.list 'user-name', 'repo-name' { |
|
14
|
+
# github.repos.forks.list 'user-name', 'repo-name' { |fork| ... }
|
15
15
|
#
|
16
16
|
def list(user_name, repo_name, params = {})
|
17
17
|
_update_user_repo_params(user_name, repo_name)
|
18
|
-
|
18
|
+
assert_presence_of user, repo
|
19
19
|
normalize! params
|
20
20
|
|
21
21
|
response = get_request("/repos/#{user}/#{repo}/forks", params)
|
@@ -36,7 +36,7 @@ module Github
|
|
36
36
|
#
|
37
37
|
def create(user_name, repo_name, params={})
|
38
38
|
_update_user_repo_params(user_name, repo_name)
|
39
|
-
|
39
|
+
assert_presence_of user, repo
|
40
40
|
normalize! params
|
41
41
|
filter! %w[ org ], params
|
42
42
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Github
|
4
|
+
# The Repository Hooks API manages the post-receive web and
|
5
|
+
# service hooks for a repository.
|
4
6
|
class Repos::Hooks < API
|
5
|
-
# The Repository Hooks API manages the post-receive web and service hooks for a repository.
|
6
7
|
|
7
8
|
VALID_HOOK_PARAM_NAMES = %w[
|
8
9
|
name
|
@@ -13,8 +14,8 @@ module Github
|
|
13
14
|
remove_events
|
14
15
|
].freeze # :nodoc:
|
15
16
|
|
16
|
-
# Active hooks can be configured to trigger for one or more events.
|
17
|
-
# The available events are:
|
17
|
+
# Active hooks can be configured to trigger for one or more events.
|
18
|
+
# The default event is push. The available events are:
|
18
19
|
VALID_HOOK_PARAM_VALUES = {
|
19
20
|
'events' => %w[
|
20
21
|
push
|
@@ -43,7 +44,7 @@ module Github
|
|
43
44
|
#
|
44
45
|
def list(user_name, repo_name, params={})
|
45
46
|
_update_user_repo_params(user_name, repo_name)
|
46
|
-
|
47
|
+
assert_presence_of user, repo
|
47
48
|
normalize! params
|
48
49
|
|
49
50
|
response = get_request("/repos/#{user}/#{repo}/hooks", params)
|
@@ -60,8 +61,7 @@ module Github
|
|
60
61
|
#
|
61
62
|
def get(user_name, repo_name, hook_id, params={})
|
62
63
|
_update_user_repo_params(user_name, repo_name)
|
63
|
-
|
64
|
-
_validate_presence_of hook_id
|
64
|
+
assert_presence_of user, repo, hook_id
|
65
65
|
normalize! params
|
66
66
|
|
67
67
|
get_request("/repos/#{user}/#{repo}/hooks/#{hook_id}", params)
|
@@ -88,7 +88,7 @@ module Github
|
|
88
88
|
#
|
89
89
|
def create(user_name, repo_name, params={})
|
90
90
|
_update_user_repo_params(user_name, repo_name)
|
91
|
-
|
91
|
+
assert_presence_of user, repo
|
92
92
|
|
93
93
|
normalize! params
|
94
94
|
filter! VALID_HOOK_PARAM_NAMES, params, :recursive => false
|
@@ -120,8 +120,7 @@ module Github
|
|
120
120
|
#
|
121
121
|
def edit(user_name, repo_name, hook_id, params={})
|
122
122
|
_update_user_repo_params(user_name, repo_name)
|
123
|
-
|
124
|
-
_validate_presence_of hook_id
|
123
|
+
assert_presence_of user, repo, hook_id
|
125
124
|
|
126
125
|
normalize! params
|
127
126
|
filter! VALID_HOOK_PARAM_NAMES, params, :recursive => false
|
@@ -140,8 +139,7 @@ module Github
|
|
140
139
|
#
|
141
140
|
def test(user_name, repo_name, hook_id, params={})
|
142
141
|
_update_user_repo_params(user_name, repo_name)
|
143
|
-
|
144
|
-
_validate_presence_of hook_id
|
142
|
+
assert_presence_of user, repo, hook_id
|
145
143
|
normalize! params
|
146
144
|
|
147
145
|
post_request("/repos/#{user}/#{repo}/hooks/#{hook_id}/test", params)
|
@@ -155,8 +153,7 @@ module Github
|
|
155
153
|
#
|
156
154
|
def delete(user_name, repo_name, hook_id, params={})
|
157
155
|
_update_user_repo_params(user_name, repo_name)
|
158
|
-
|
159
|
-
_validate_presence_of hook_id
|
156
|
+
assert_presence_of user, repo, hook_id
|
160
157
|
normalize! params
|
161
158
|
|
162
159
|
delete_request("/repos/#{user}/#{repo}/hooks/#{hook_id}", params)
|
@@ -14,7 +14,7 @@ module Github
|
|
14
14
|
#
|
15
15
|
def list(user_name, repo_name, params={})
|
16
16
|
_update_user_repo_params(user_name, repo_name)
|
17
|
-
|
17
|
+
assert_presence_of user, repo
|
18
18
|
normalize! params
|
19
19
|
|
20
20
|
response = get_request("/repos/#{user}/#{repo}/keys", params)
|
@@ -31,8 +31,7 @@ module Github
|
|
31
31
|
#
|
32
32
|
def get(user_name, repo_name, key_id, params={})
|
33
33
|
_update_user_repo_params(user_name, repo_name)
|
34
|
-
|
35
|
-
_validate_presence_of key_id
|
34
|
+
assert_presence_of user, repo, key_id
|
36
35
|
normalize! params
|
37
36
|
|
38
37
|
get_request("/repos/#{user}/#{repo}/keys/#{key_id}", params)
|
@@ -53,7 +52,7 @@ module Github
|
|
53
52
|
#
|
54
53
|
def create(user_name, repo_name, params={})
|
55
54
|
_update_user_repo_params(user_name, repo_name)
|
56
|
-
|
55
|
+
assert_presence_of user, repo
|
57
56
|
normalize! params
|
58
57
|
filter! VALID_KEY_PARAM_NAMES, params
|
59
58
|
assert_required_keys(VALID_KEY_PARAM_NAMES, params)
|
@@ -75,8 +74,7 @@ module Github
|
|
75
74
|
#
|
76
75
|
def edit(user_name, repo_name, key_id, params={})
|
77
76
|
_update_user_repo_params(user_name, repo_name)
|
78
|
-
|
79
|
-
_validate_presence_of key_id
|
77
|
+
assert_presence_of user, repo, key_id
|
80
78
|
|
81
79
|
normalize! params
|
82
80
|
filter! VALID_KEY_PARAM_NAMES, params
|
@@ -92,8 +90,7 @@ module Github
|
|
92
90
|
#
|
93
91
|
def delete(user_name, repo_name, key_id, params={})
|
94
92
|
_update_user_repo_params(user_name, repo_name)
|
95
|
-
|
96
|
-
_validate_presence_of key_id
|
93
|
+
assert_presence_of user, repo, key_id
|
97
94
|
normalize! params
|
98
95
|
|
99
96
|
delete_request("/repos/#{user}/#{repo}/keys/#{key_id}", params)
|