octokit 1.17.1 → 1.18.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +1 -0
- data/lib/octokit/client/gists.rb +68 -0
- data/lib/octokit/client/objects.rb +54 -0
- data/lib/octokit/client/organizations.rb +280 -1
- data/lib/octokit/client/pulls.rb +25 -0
- data/lib/octokit/client/repositories.rb +307 -1
- data/lib/octokit/client/users.rb +144 -3
- data/lib/octokit/connection.rb +2 -1
- data/lib/octokit/version.rb +1 -1
- data/spec/fixtures/v3/gist_comment.json +19 -0
- data/spec/fixtures/v3/gist_comment_create.json +19 -0
- data/spec/fixtures/v3/gist_comment_update.json +19 -0
- data/spec/fixtures/v3/gist_comments.json +40 -0
- data/spec/fixtures/v3/pull_update.json +138 -0
- data/spec/fixtures/v3/tag.json +16 -0
- data/spec/fixtures/v3/tag_create.json +16 -0
- data/spec/octokit/client/gists_spec.rb +45 -0
- data/spec/octokit/client/objects_spec.rb +48 -0
- data/spec/octokit/client/pulls_spec.rb +14 -0
- metadata +16 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
* [1.18.0 - October 15, 2012](https://github.com/pengwynn/octokit/compare/v1.17.1...v1.18.0)
|
3
4
|
* [1.17.1 - October 11, 2012](https://github.com/pengwynn/octokit/compare/v1.17.0...v1.17.1)
|
4
5
|
* [1.17.0 - October 8, 2012](https://github.com/pengwynn/octokit/compare/v1.16.0...v1.17.0)
|
5
6
|
* [1.16.0 - September 25,2012](https://github.com/pengwynn/octokit/compare/v1.15.1...v1.16.0)
|
data/lib/octokit/client/gists.rb
CHANGED
@@ -132,6 +132,74 @@ module Octokit
|
|
132
132
|
response.status == 204
|
133
133
|
end
|
134
134
|
|
135
|
+
# List gist comments
|
136
|
+
#
|
137
|
+
# @param gist_id [Integer] Gist Id.
|
138
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing comments.
|
139
|
+
# @see http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist
|
140
|
+
# @example
|
141
|
+
# Octokit.gist_comments(3528645)
|
142
|
+
def gist_comments(gist_id, options={})
|
143
|
+
get "gists/#{gist_id}/comments", options, 3
|
144
|
+
end
|
145
|
+
|
146
|
+
# Get gist comment
|
147
|
+
#
|
148
|
+
# @param gist_comment_id [Integer] Id of the gist comment.
|
149
|
+
# @return [Hashie::Mash] Hash representing gist comment.
|
150
|
+
# @see http://developer.github.com/v3/gists/comments/#get-a-single-comment
|
151
|
+
# @example
|
152
|
+
# Octokit.gist_comment(451398)
|
153
|
+
def gist_comment(gist_comment_id, options={})
|
154
|
+
get "gists/comments/#{gist_comment_id}", options, 3
|
155
|
+
end
|
156
|
+
|
157
|
+
# Create gist comment
|
158
|
+
#
|
159
|
+
# Requires authenticated client.
|
160
|
+
#
|
161
|
+
# @param gist_id [Integer] Id of the gist.
|
162
|
+
# @param comment [String] Comment contents.
|
163
|
+
# @return [Hashie::Mash] Hash representing the new comment.
|
164
|
+
# @see Octokit::Client
|
165
|
+
# @see http://developer.github.com/v3/gists/comments/#create-a-comment
|
166
|
+
# @example
|
167
|
+
# @client.create_gist_comment(3528645, 'This is very helpful.')
|
168
|
+
def create_gist_comment(gist_id, comment, options={})
|
169
|
+
options.merge!({:body => comment})
|
170
|
+
post "gists/#{gist_id}/comments", options, 3
|
171
|
+
end
|
172
|
+
|
173
|
+
# Update gist comment
|
174
|
+
#
|
175
|
+
# Requires authenticated client
|
176
|
+
#
|
177
|
+
# @param gist_comment_id [Integer] Id of the gist comment to update.
|
178
|
+
# @param comment [String] Updated comment contents.
|
179
|
+
# @return [Hashie::Mash] Hash representing the updated comment.
|
180
|
+
# @see Octokit::Client
|
181
|
+
# @see http://developer.github.com/v3/gists/comments/#edit-a-comment
|
182
|
+
# @example
|
183
|
+
# @client.update_gist_comment(3528645, ':heart:')
|
184
|
+
def update_gist_comment(gist_comment_id, comment, options={})
|
185
|
+
options.merge!({:body => comment})
|
186
|
+
patch "gists/comments/#{gist_comment_id}", options, 3
|
187
|
+
end
|
188
|
+
|
189
|
+
# Delete gist comment
|
190
|
+
#
|
191
|
+
# Requires authenticated client.
|
192
|
+
#
|
193
|
+
# @param gist_comment_id [Integer] Id of the gist comment to delete.
|
194
|
+
# @return [Boolean] True if comment deleted, false otherwise.
|
195
|
+
# @see Octokit::Client
|
196
|
+
# @see http://developer.github.com/v3/gists/comments/#delete-a-comment
|
197
|
+
# @example
|
198
|
+
# @client.delete_gist_comment(586399)
|
199
|
+
def delete_gist_comment(gist_comment_id, options={})
|
200
|
+
delete("gists/comments/#{gist_comment_id}", options, 3, true, true).status == 204
|
201
|
+
end
|
202
|
+
|
135
203
|
end
|
136
204
|
end
|
137
205
|
end
|
@@ -75,6 +75,60 @@ module Octokit
|
|
75
75
|
}
|
76
76
|
post("repos/#{Repository.new(repo)}/git/blobs", options.merge(parameters), 3).sha
|
77
77
|
end
|
78
|
+
|
79
|
+
# Get a tag
|
80
|
+
#
|
81
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
82
|
+
# @param tag_sha [String] The SHA of the tag to fetch.
|
83
|
+
# @return [Hashie::Mash] Hash representing the tag.
|
84
|
+
# @see http://developer.github.com/v3/git/tags/#get-a-tag
|
85
|
+
# @example Fetch a tag
|
86
|
+
# Octokit.tag('pengwynn/octokit', '23aad20633f4d2981b1c7209a800db3014774e96')
|
87
|
+
def tag(repo, tag_sha, options={})
|
88
|
+
get("repos/#{Repository.new repo}/git/tags/#{tag_sha}", options, 3)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Create a tag
|
92
|
+
#
|
93
|
+
# Requires authenticated client.
|
94
|
+
#
|
95
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
96
|
+
# @param tag [String] Tag string.
|
97
|
+
# @param message [String] Tag message.
|
98
|
+
# @param object_sha [String] SHA of the git object this is tagging.
|
99
|
+
# @param type [String] Type of the object we're tagging. Normally this is
|
100
|
+
# a `commit` but it can also be a `tree` or a `blob`.
|
101
|
+
# @param tagger_name [String] Name of the author of the tag.
|
102
|
+
# @param tagger_email [String] Email of the author of the tag.
|
103
|
+
# @param tagger_date [string] Timestamp of when this object was tagged.
|
104
|
+
# @return [Hashie::Mash] Hash representing new tag.
|
105
|
+
# @see Octokit::Client
|
106
|
+
# @see http://developer.github.com/v3/git/tags/#create-a-tag-object
|
107
|
+
# @example
|
108
|
+
# @client.create_tag(
|
109
|
+
# "pengwynn/octokit",
|
110
|
+
# "v9000.0.0",
|
111
|
+
# "Version 9000\n",
|
112
|
+
# "f4cdf6eb734f32343ce3f27670c17b35f54fd82e",
|
113
|
+
# "commit",
|
114
|
+
# "Wynn Netherland",
|
115
|
+
# "wynn.netherland@gmail.com",
|
116
|
+
# "2012-06-03T17:03:11-07:00"
|
117
|
+
# )
|
118
|
+
def create_tag(repo, tag, message, object_sha, type, tagger_name, tagger_email, tagger_date, options={})
|
119
|
+
options.merge!(
|
120
|
+
:tag => tag,
|
121
|
+
:message => message,
|
122
|
+
:object => object_sha,
|
123
|
+
:type => type,
|
124
|
+
:tagger => {
|
125
|
+
:name => tagger_name,
|
126
|
+
:email => tagger_email,
|
127
|
+
:date => tagger_date
|
128
|
+
}
|
129
|
+
)
|
130
|
+
post("repos/#{Repository.new repo}/git/tags", options, 3)
|
131
|
+
end
|
78
132
|
end
|
79
133
|
end
|
80
134
|
end
|
@@ -1,16 +1,76 @@
|
|
1
1
|
module Octokit
|
2
2
|
class Client
|
3
3
|
module Organizations
|
4
|
+
# Get an organization
|
5
|
+
#
|
6
|
+
# @param org [String] Organization GitHub username.
|
7
|
+
# @return [Hashie::Mash] Hash representing GitHub organization.
|
8
|
+
# @see http://developer.github.com/v3/orgs/#get-an-organization
|
9
|
+
# @example
|
10
|
+
# Octokit.organization('github')
|
11
|
+
# @example
|
12
|
+
# Octokit.org('github')
|
4
13
|
def organization(org, options={})
|
5
14
|
get("orgs/#{org}", options, 3)
|
6
15
|
end
|
7
16
|
alias :org :organization
|
8
17
|
|
18
|
+
# Update an organization.
|
19
|
+
#
|
20
|
+
# Requires authenticated client with proper organization permissions.
|
21
|
+
#
|
22
|
+
# @param org [String] Organization GitHub username.
|
23
|
+
# @param values [Hash] The updated organization attributes.
|
24
|
+
# @option values [String] :billing_email Billing email address. This address is not publicized.
|
25
|
+
# @option values [String] :company Company name.
|
26
|
+
# @option values [String] :email Publicly visible email address.
|
27
|
+
# @option values [String] :location Location of organization.
|
28
|
+
# @option values [String] :name GitHub username for organization.
|
29
|
+
# @return [Hashie::Mash] Hash representing GitHub organization.
|
30
|
+
# @see Octokit::Client
|
31
|
+
# @see http://developer.github.com/v3/orgs/#edit-an-organization
|
32
|
+
# @example
|
33
|
+
# @client.update_organization('github', {
|
34
|
+
# :billing_email => 'support@github.com',
|
35
|
+
# :company => 'GitHub',
|
36
|
+
# :email => 'support@github.com',
|
37
|
+
# :location => 'San Francisco',
|
38
|
+
# :name => 'github'
|
39
|
+
# })
|
40
|
+
# @example
|
41
|
+
# @client.update_org('github', {:company => 'Unicorns, Inc.'})
|
9
42
|
def update_organization(org, values, options={})
|
10
43
|
patch("orgs/#{org}", options.merge({:organization => values}), 3)
|
11
44
|
end
|
12
45
|
alias :update_org :update_organization
|
13
46
|
|
47
|
+
# Get organizations for a user.
|
48
|
+
#
|
49
|
+
# Nonauthenticated calls to this method will return organizations that
|
50
|
+
# the user is a public member.
|
51
|
+
#
|
52
|
+
# Use an authenicated client to get both public and private organizations
|
53
|
+
# for a user.
|
54
|
+
#
|
55
|
+
# Calling this method on a `@client` will return that users organizations.
|
56
|
+
# Private organizations are included only if the `@client` is authenticated.
|
57
|
+
#
|
58
|
+
# @param user [String] Username of the user to get list of organizations.
|
59
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing organizations.
|
60
|
+
# @see Octokit::Client
|
61
|
+
# @see http://developer.github.com/v3/orgs/#list-user-organizations
|
62
|
+
# @example
|
63
|
+
# Octokit.organizations('pengwynn')
|
64
|
+
# @example
|
65
|
+
# @client.organizations('pengwynn')
|
66
|
+
# @example
|
67
|
+
# Octokit.orgs('pengwynn')
|
68
|
+
# @example
|
69
|
+
# Octokit.list_organizations('pengwynn')
|
70
|
+
# @example
|
71
|
+
# Octokit.list_orgs('pengwynn')
|
72
|
+
# @example
|
73
|
+
# @client.organizations
|
14
74
|
def organizations(user=nil, options={})
|
15
75
|
if user
|
16
76
|
get("users/#{user}/orgs", options, 3)
|
@@ -24,45 +84,171 @@ module Octokit
|
|
24
84
|
|
25
85
|
# List organization repositories
|
26
86
|
#
|
27
|
-
#
|
87
|
+
# Public repositories are available without authentication. Private repos
|
88
|
+
# require authenticated organization member.
|
89
|
+
#
|
28
90
|
# @param org [String] Organization handle for which to list repos
|
91
|
+
# @option options [String] :type ('all') Filter by repository type.
|
92
|
+
# `all`, `public`, `member` or `private`.
|
93
|
+
#
|
29
94
|
# @return [Array<Hashie::Mash>] List of repositories
|
95
|
+
# @see Octokit::Client
|
96
|
+
# @see http://developer.github.com/v3/repos/#list-organization-repositories
|
97
|
+
# @example
|
98
|
+
# Octokit.organization_repositories('github')
|
99
|
+
# @example
|
100
|
+
# Octokit.org_repositories('github')
|
101
|
+
# @example
|
102
|
+
# Octokit.org_repos('github')
|
103
|
+
# @example
|
104
|
+
# @client.org_repos('github', {:type => 'private'})
|
30
105
|
def organization_repositories(org, options={})
|
31
106
|
get("orgs/#{org}/repos", options, 3)
|
32
107
|
end
|
33
108
|
alias :org_repositories :organization_repositories
|
34
109
|
alias :org_repos :organization_repositories
|
35
110
|
|
111
|
+
# Get organization members
|
112
|
+
#
|
113
|
+
# Public members of the organization are returned by default. An
|
114
|
+
# authenticated client that is a member of the GitHub organization
|
115
|
+
# is required to get private members.
|
116
|
+
#
|
117
|
+
# @param org [String] Organization GitHub username.
|
118
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing users.
|
119
|
+
# @see Octokit::Client
|
120
|
+
# @see http://developer.github.com/v3/orgs/members/#list-members
|
121
|
+
# @example
|
122
|
+
# Octokit.organization_members('github')
|
123
|
+
# @example
|
124
|
+
# @client.organization_members('github')
|
125
|
+
# @example
|
126
|
+
# Octokit.org_members('github')
|
36
127
|
def organization_members(org, options={})
|
37
128
|
get("orgs/#{org}/members", options, 3)
|
38
129
|
end
|
39
130
|
alias :org_members :organization_members
|
40
131
|
|
132
|
+
# List teams
|
133
|
+
#
|
134
|
+
# Requires authenticated organization member.
|
135
|
+
#
|
136
|
+
# @param org [String] Organization GitHub username.
|
137
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing teams.
|
138
|
+
# @see Octokit::Client
|
139
|
+
# @see http://developer.github.com/v3/orgs/teams/#list-teams
|
140
|
+
# @example
|
141
|
+
# @client.organization_teams('github')
|
142
|
+
# @example
|
143
|
+
# @client.org_teams('github')
|
41
144
|
def organization_teams(org, options={})
|
42
145
|
get("orgs/#{org}/teams", options, 3)
|
43
146
|
end
|
44
147
|
alias :org_teams :organization_teams
|
45
148
|
|
149
|
+
# Create team
|
150
|
+
#
|
151
|
+
# Requires authenticated organization owner.
|
152
|
+
#
|
153
|
+
# @param org [String] Organization GitHub username.
|
154
|
+
# @option options [String] :name Team name.
|
155
|
+
# @option options [Array<String>] :repo_names Repositories for the team.
|
156
|
+
# @option options [String, optional] :permission ('pull') Permissions the
|
157
|
+
# team has for team repositories.
|
158
|
+
#
|
159
|
+
# `pull` - team members can pull, but not push to or administer these repositories.
|
160
|
+
# `push` - team members can pull and push, but not administer these repositories.
|
161
|
+
# `admin` - team members can pull, push and administer these repositories.
|
162
|
+
# @return [Hashie::Mash] Hash representing new team.
|
163
|
+
# @see Octokit::Client
|
164
|
+
# @see http://developer.github.com/v3/orgs/teams/#create-team
|
165
|
+
# @example
|
166
|
+
# @client.create_team('github', {
|
167
|
+
# :name => 'Designers',
|
168
|
+
# :repo_names => ['dotcom', 'developer.github.com'],
|
169
|
+
# :permission => 'push'
|
170
|
+
# })
|
46
171
|
def create_team(org, options={})
|
47
172
|
post("orgs/#{org}/teams", options, 3)
|
48
173
|
end
|
49
174
|
|
175
|
+
# Get team
|
176
|
+
#
|
177
|
+
# Requires authenticated organization member.
|
178
|
+
#
|
179
|
+
# @param team_id [Integer] Team id.
|
180
|
+
# @return [Hashie::Mash] Hash representing team.
|
181
|
+
# @see Octokit::Client
|
182
|
+
# @see http://developer.github.com/v3/orgs/teams/#get-team
|
183
|
+
# @example
|
184
|
+
# @client.team(100000)
|
50
185
|
def team(team_id, options={})
|
51
186
|
get("teams/#{team_id}", options, 3)
|
52
187
|
end
|
53
188
|
|
189
|
+
# Update team
|
190
|
+
#
|
191
|
+
# Requires authenticated organization owner.
|
192
|
+
#
|
193
|
+
# @param team_id [Integer] Team id.
|
194
|
+
# @option options [String] :name Team name.
|
195
|
+
# @option options [String] :permission Permissions the team has for team repositories.
|
196
|
+
#
|
197
|
+
# `pull` - team members can pull, but not push to or administer these repositories.
|
198
|
+
# `push` - team members can pull and push, but not administer these repositories.
|
199
|
+
# `admin` - team members can pull, push and administer these repositories.
|
200
|
+
# @return [Hashie::Mash] Hash representing updated team.
|
201
|
+
# @see Octokit::Client
|
202
|
+
# @see http://developer.github.com/v3/orgs/teams/#edit-team
|
203
|
+
# @example
|
204
|
+
# @client.update_team(100000, {
|
205
|
+
# :name => 'Front-end Designers',
|
206
|
+
# :permission => 'push'
|
207
|
+
# })
|
54
208
|
def update_team(team_id, options={})
|
55
209
|
patch("teams/#{team_id}", options, 3)
|
56
210
|
end
|
57
211
|
|
212
|
+
# Delete team
|
213
|
+
#
|
214
|
+
# Requires authenticated organization owner.
|
215
|
+
#
|
216
|
+
# @param team_id [Integer] Team id.
|
217
|
+
# @return [Boolean] True if deletion successful, false otherwise.
|
218
|
+
# @see Octokit::Client
|
219
|
+
# @see http://developer.github.com/v3/orgs/teams/#delete-team
|
220
|
+
# @example
|
221
|
+
# @client.delete_team(100000)
|
58
222
|
def delete_team(team_id, options={})
|
59
223
|
delete("teams/#{team_id}", options, 3, true, true)
|
60
224
|
end
|
61
225
|
|
226
|
+
# List team members
|
227
|
+
#
|
228
|
+
# Requires authenticated organization member.
|
229
|
+
#
|
230
|
+
# @param team_id [Integer] Team id.
|
231
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing users.
|
232
|
+
# @see Octokit::Client
|
233
|
+
# @see http://developer.github.com/v3/orgs/teams/#list-team-members
|
234
|
+
# @example
|
235
|
+
# @client.team_members(100000)
|
62
236
|
def team_members(team_id, options={})
|
63
237
|
get("teams/#{team_id}/members", options, 3)
|
64
238
|
end
|
65
239
|
|
240
|
+
# Add team member
|
241
|
+
#
|
242
|
+
# Requires authenticated organization owner or member with team
|
243
|
+
# `admin` permission.
|
244
|
+
#
|
245
|
+
# @param team_id [Integer] Team id.
|
246
|
+
# @param user [String] GitHub username of new team member.
|
247
|
+
# @return [Boolean] True on successful addition, false otherwise.
|
248
|
+
# @see Octokit::Client
|
249
|
+
# @see http://developer.github.com/v3/orgs/teams/#add-team-member
|
250
|
+
# @example
|
251
|
+
# @client.add_team_member(100000, 'pengwynn')
|
66
252
|
def add_team_member(team_id, user, options={})
|
67
253
|
# There's a bug in this API call. The docs say to leave the body blank,
|
68
254
|
# but it fails if the body is both blank and the content-length header
|
@@ -70,25 +256,94 @@ module Octokit
|
|
70
256
|
put("teams/#{team_id}/members/#{user}", options.merge({:name => user}), 3, true, raw=true).status == 204
|
71
257
|
end
|
72
258
|
|
259
|
+
# Remove team member
|
260
|
+
#
|
261
|
+
# Requires authenticated organization owner or member with team
|
262
|
+
# `admin` permission.
|
263
|
+
#
|
264
|
+
# @param team_id [Integer] Team id.
|
265
|
+
# @param user [String] GitHub username of the user to boot.
|
266
|
+
# @return [Boolean] True if user removed, false otherwise.
|
267
|
+
# @see Octokit::Client
|
268
|
+
# @see http://developer.github.com/v3/orgs/teams/#remove-team-member
|
269
|
+
# @example
|
270
|
+
# @client.remove_team_member(100000, 'pengwynn')
|
73
271
|
def remove_team_member(team_id, user, options={})
|
74
272
|
delete("teams/#{team_id}/members/#{user}", options, 3, true, raw=true).status == 204
|
75
273
|
end
|
76
274
|
|
275
|
+
# List team repositories
|
276
|
+
#
|
277
|
+
# Requires authenticated organization member.
|
278
|
+
#
|
279
|
+
# @param team_id [Integer] Team id.
|
280
|
+
# @return [Array<Hashie::Mash>] Array of hashes representing repositories.
|
281
|
+
# @see Octokit::Client
|
282
|
+
# @see http://developer.github.com/v3/orgs/teams/#list-team-repos
|
283
|
+
# @example
|
284
|
+
# @client.team_repositories(100000)
|
285
|
+
# @example
|
286
|
+
# @client.team_repos(100000)
|
77
287
|
def team_repositories(team_id, options={})
|
78
288
|
get("teams/#{team_id}/repos", options, 3)
|
79
289
|
end
|
80
290
|
alias :team_repos :team_repositories
|
81
291
|
|
292
|
+
# Add team repository
|
293
|
+
#
|
294
|
+
# Requires authenticated user to be an owner of the organization that the
|
295
|
+
# team is associated with. Also, the repo must be owned by the
|
296
|
+
# organization, or a direct form of a repo owned by the organization.
|
297
|
+
#
|
298
|
+
# @param team_id [Integer] Team id.
|
299
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
300
|
+
# @return [Boolean] True if successful, false otherwise.
|
301
|
+
# @see Octokit::Client
|
302
|
+
# @see Octokit::Repository
|
303
|
+
# @see http://developer.github.com/v3/orgs/teams/#add-team-repo
|
304
|
+
# @example
|
305
|
+
# @client.add_team_repository(100000, 'github/developer.github.com')
|
306
|
+
# @example
|
307
|
+
# @client.add_team_repo(100000, 'github/developer.github.com')
|
82
308
|
def add_team_repository(team_id, repo, options={})
|
83
309
|
put("teams/#{team_id}/repos/#{Repository.new(repo)}", options.merge(:name => Repository.new(repo)), 3, true, raw=true).status == 204
|
84
310
|
end
|
85
311
|
alias :add_team_repo :add_team_repository
|
86
312
|
|
313
|
+
# Remove team repository
|
314
|
+
#
|
315
|
+
# Removes repository from team. Does not delete the repository.
|
316
|
+
#
|
317
|
+
# Requires authenticated organization owner.
|
318
|
+
#
|
319
|
+
# @param team_id [Integer] Team id.
|
320
|
+
# @param repo [String, Hash, Repository] A GitHub repository.
|
321
|
+
# @return [Boolean] Return true if repo removed from team, false otherwise.
|
322
|
+
# @see Octokit::Client
|
323
|
+
# @see Octokit::Repository
|
324
|
+
# @see http://developer.github.com/v3/orgs/teams/#remove-team-repo
|
325
|
+
# @example
|
326
|
+
# @client.remove_team_repository(100000, 'github/developer.github.com')
|
327
|
+
# @example
|
328
|
+
# @client.remove_team_repo(100000, 'github/developer.github.com')
|
87
329
|
def remove_team_repository(team_id, repo, options={})
|
88
330
|
delete("teams/#{team_id}/repos/#{Repository.new(repo)}", options, 3, true, raw=true).status == 204
|
89
331
|
end
|
90
332
|
alias :remove_team_repo :remove_team_repository
|
91
333
|
|
334
|
+
# Remove organization member
|
335
|
+
#
|
336
|
+
# Requires authenticated organization owner or member with team `admin` access.
|
337
|
+
#
|
338
|
+
# @param org [String] Organization GitHub username.
|
339
|
+
# @param user [String] GitHub username of user to remove.
|
340
|
+
# @return [Boolean] True if removal is successful, false otherwise.
|
341
|
+
# @see Octokit::Client
|
342
|
+
# @see http://developer.github.com/v3/orgs/teams/#remove-team-member
|
343
|
+
# @example
|
344
|
+
# @client.remove_organization_member('github', 'pengwynn')
|
345
|
+
# @example
|
346
|
+
# @client.remove_org_member('github', 'pengwynn')
|
92
347
|
def remove_organization_member(org, user, options={})
|
93
348
|
# this is a synonym for: for team in org.teams: remove_team_member(team.id, user)
|
94
349
|
# provided in the GH API v3
|
@@ -96,10 +351,34 @@ module Octokit
|
|
96
351
|
end
|
97
352
|
alias :remove_org_member :remove_organization_member
|
98
353
|
|
354
|
+
# Publicize a user's membership of an organization
|
355
|
+
#
|
356
|
+
# Requires authenticated organization owner.
|
357
|
+
#
|
358
|
+
# @param org [String] Organization GitHub username.
|
359
|
+
# @param user [String] GitHub username of user to publicize.
|
360
|
+
# @return [Boolean] True if publicization successful, false otherwise.
|
361
|
+
# @see Octokit::Client
|
362
|
+
# @see http://developer.github.com/v3/orgs/members/#publicize-a-users-membership
|
363
|
+
# @example
|
364
|
+
# @client.publicize_membership('github', 'pengwynn')
|
99
365
|
def publicize_membership(org, user, options={})
|
100
366
|
put("orgs/#{org}/public_members/#{user}", options, 3, true, raw=true).status == 204
|
101
367
|
end
|
102
368
|
|
369
|
+
# Conceal a user's membership of an organization.
|
370
|
+
#
|
371
|
+
# Requires authenticated organization owner.
|
372
|
+
#
|
373
|
+
# @param org [String] Organization GitHub username.
|
374
|
+
# @param user [String] GitHub username of user to unpublicize.
|
375
|
+
# @return [Boolean] True of unpublicization successful, false otherwise.
|
376
|
+
# @see Octokit::Client
|
377
|
+
# @see http://developer.github.com/v3/orgs/members/#conceal-a-users-membership
|
378
|
+
# @example
|
379
|
+
# @client.unpublicize_membership('github', 'pengwynn')
|
380
|
+
# @example
|
381
|
+
# @client.conceal_membership('github', 'pengwynn')
|
103
382
|
def unpublicize_membership(org, user, options={})
|
104
383
|
delete("orgs/#{org}/public_members/#{user}", options, 3, true, raw=true).status == 204
|
105
384
|
end
|