octokit 2.0.0.rc4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CONTRIBUTING.md +3 -0
- data/LICENSE.md +1 -1
- data/README.md +371 -74
- data/lib/octokit/client/authorizations.rb +6 -6
- data/lib/octokit/client/commits.rb +4 -4
- data/lib/octokit/client/contents.rb +7 -7
- data/lib/octokit/client/events.rb +4 -4
- data/lib/octokit/client/issues.rb +19 -19
- data/lib/octokit/client/labels.rb +17 -19
- data/lib/octokit/client/markdown.rb +1 -1
- data/lib/octokit/client/milestones.rb +5 -5
- data/lib/octokit/client/notifications.rb +4 -4
- data/lib/octokit/client/objects.rb +2 -2
- data/lib/octokit/client/pull_requests.rb +10 -10
- data/lib/octokit/client/repositories.rb +44 -44
- data/lib/octokit/client/stats.rb +4 -4
- data/lib/octokit/error.rb +2 -2
- data/lib/octokit/version.rb +1 -1
- metadata +5 -5
@@ -6,13 +6,13 @@ module Octokit
|
|
6
6
|
# @see http://developer.github.com/v3/oauth/#oauth-authorizations-api
|
7
7
|
module Authorizations
|
8
8
|
|
9
|
-
# List
|
9
|
+
# List the authenticated user's authorizations
|
10
10
|
#
|
11
11
|
# API for users to manage their own tokens.
|
12
12
|
# You can only access your own tokens, and only through
|
13
13
|
# Basic Authentication.
|
14
14
|
#
|
15
|
-
# @return [Array] A list of authorizations for the authenticated user
|
15
|
+
# @return [Array<Sawyer::Resource>] A list of authorizations for the authenticated user
|
16
16
|
# @see http://developer.github.com/v3/oauth/#list-your-authorizations
|
17
17
|
# @example List authorizations for user ctshryock
|
18
18
|
# client = Octokit::Client.new(:login => 'ctshryock', :password => 'secret')
|
@@ -27,7 +27,7 @@ module Octokit
|
|
27
27
|
# You can only access your own tokens, and only through
|
28
28
|
# Basic Authentication.
|
29
29
|
#
|
30
|
-
# @return [
|
30
|
+
# @return [Sawyer::Resource] A single authorization for the authenticated user
|
31
31
|
# @see http://developer.github.com/v3/oauth/#get-a-single-authorization
|
32
32
|
# @example Show authorization for user ctshryock's Travis auth
|
33
33
|
# client = Octokit::Client.new(:login => 'ctshryock', :password => 'secret')
|
@@ -43,11 +43,11 @@ module Octokit
|
|
43
43
|
#
|
44
44
|
# @param options [Hash] A customizable set of options.
|
45
45
|
# @option options [Array] :scopes A list of scopes that this authorization is in.
|
46
|
-
# See http://developer.github.com/v3/oauth/#scopes for available scopes
|
47
46
|
# @option options [String] :note A note to remind you what the OAuth token is for.
|
48
47
|
# @option options [String] :note_url A URL to remind you what app the OAuth token is for.
|
49
48
|
#
|
50
|
-
# @return [
|
49
|
+
# @return [Sawyer::Resource] A single authorization for the authenticated user
|
50
|
+
# @see http://developer.github.com/v3/oauth/#scopes Available scopes
|
51
51
|
# @see http://developer.github.com/v3/oauth/#create-a-new-authorization
|
52
52
|
# @example Create a new authorization for user ctshryock's project Zoidberg
|
53
53
|
# client = Octokit::Client.new(:login => 'ctshryock', :password => 'secret')
|
@@ -70,7 +70,7 @@ module Octokit
|
|
70
70
|
# @option options [String] :note A note to remind you what the OAuth token is for.
|
71
71
|
# @option options [String] :note_url A URL to remind you what app the OAuth token is for.
|
72
72
|
#
|
73
|
-
# @return [
|
73
|
+
# @return [Sawyer::Resource] A single (updated) authorization for the authenticated user
|
74
74
|
# @see http://developer.github.com/v3/oauth/#update-a-new-authorization
|
75
75
|
# @see http://developer.github.com/v3/oauth/#scopes for available scopes
|
76
76
|
# @example Update the authorization for user ctshryock's project Zoidberg
|
@@ -45,7 +45,7 @@ module Octokit
|
|
45
45
|
# @return [Array<Sawyer::Resource>] An array of hashes representing commits
|
46
46
|
# @see http://developer.github.com/v3/repos/commits/
|
47
47
|
# @example
|
48
|
-
# Octokit.commits_since('
|
48
|
+
# Octokit.commits_since('octokit/octokit.rb', '2012-10-01')
|
49
49
|
def commits_since(*args)
|
50
50
|
arguments = Octokit::RepoArguments.new(args)
|
51
51
|
date = parse_date(arguments.shift)
|
@@ -72,7 +72,7 @@ module Octokit
|
|
72
72
|
# @return [Array<Sawyer::Resource>] An array of hashes representing commits
|
73
73
|
# @see http://developer.github.com/v3/repos/commits/
|
74
74
|
# @example
|
75
|
-
# Octokit.commits_before('
|
75
|
+
# Octokit.commits_before('octokit/octokit.rb', '2012-10-01')
|
76
76
|
def commits_before(*args)
|
77
77
|
arguments = Octokit::RepoArguments.new(args)
|
78
78
|
date = parse_date(arguments.shift)
|
@@ -99,7 +99,7 @@ module Octokit
|
|
99
99
|
# @return [Array<Sawyer::Resource>] An array of hashes representing commits
|
100
100
|
# @see http://developer.github.com/v3/repos/commits/
|
101
101
|
# @example
|
102
|
-
# Octokit.commits_on('
|
102
|
+
# Octokit.commits_on('octokit/octokit.rb', '2012-10-01')
|
103
103
|
def commits_on(*args)
|
104
104
|
arguments = Octokit::RepoArguments.new(args)
|
105
105
|
date = parse_date(arguments.shift)
|
@@ -128,7 +128,7 @@ module Octokit
|
|
128
128
|
# @return [Array<Sawyer::Resource>] An array of hashes representing commits
|
129
129
|
# @see http://developer.github.com/v3/repos/commits/
|
130
130
|
# @example
|
131
|
-
# Octokit.commits_on('
|
131
|
+
# Octokit.commits_on('octokit/octokit.rb', '2012-10-01', '2012-11-01')
|
132
132
|
def commits_between(*args)
|
133
133
|
arguments = Octokit::RepoArguments.new(args)
|
134
134
|
date = parse_date(arguments.shift)
|
@@ -15,7 +15,7 @@ module Octokit
|
|
15
15
|
# @return [Sawyer::Resource] The detail of the readme
|
16
16
|
# @see http://developer.github.com/v3/repos/contents/
|
17
17
|
# @example Get the readme file for a repo
|
18
|
-
# Octokit.readme("
|
18
|
+
# Octokit.readme("octokit/octokit.rb")
|
19
19
|
def readme(repo, options={})
|
20
20
|
get "repos/#{Repository.new repo}/readme", options
|
21
21
|
end
|
@@ -28,7 +28,7 @@ module Octokit
|
|
28
28
|
# @return [Sawyer::Resource] The contents of a file or list of the files in the folder
|
29
29
|
# @see http://developer.github.com/v3/repos/contents/
|
30
30
|
# @example List the contents of lib/octokit.rb
|
31
|
-
# Octokit.contents("
|
31
|
+
# Octokit.contents("octokit/octokit.rb", :path => 'lib/octokit.rb')
|
32
32
|
def contents(repo, options={})
|
33
33
|
repo_path = options.delete :path
|
34
34
|
url = "repos/#{Repository.new repo}/contents/#{repo_path}"
|
@@ -48,7 +48,7 @@ module Octokit
|
|
48
48
|
# @return [Sawyer::Resource] The contents and commit info for the addition
|
49
49
|
# @see http://developer.github.com/v3/repos/contents/#create-a-file
|
50
50
|
# @example Add content at lib/octokit.rb
|
51
|
-
# Octokit.create_contents("
|
51
|
+
# Octokit.create_contents("octokit/octokit.rb",
|
52
52
|
# "lib/octokit.rb",
|
53
53
|
# "Adding content",
|
54
54
|
# "asdf9as0df9asdf8as0d9f8==...",
|
@@ -95,7 +95,7 @@ module Octokit
|
|
95
95
|
# @return [Sawyer::Resource] The contents and commit info for the update
|
96
96
|
# @see http://developer.github.com/v3/repos/contents/#update-a-file
|
97
97
|
# @example Update content at lib/octokit.rb
|
98
|
-
# Octokit.update_contents("
|
98
|
+
# Octokit.update_contents("octokit/octokit.rb",
|
99
99
|
# "lib/octokit.rb",
|
100
100
|
# "Updating content",
|
101
101
|
# "7eb95f97e1a0636015df3837478d3f15184a5f49",
|
@@ -123,7 +123,7 @@ module Octokit
|
|
123
123
|
# @return [Sawyer::Resource] The commit info for the delete
|
124
124
|
# @see http://developer.github.com/v3/repos/contents/#delete-a-file
|
125
125
|
# @example Delete content at lib/octokit.rb
|
126
|
-
# Octokit.delete_contents("
|
126
|
+
# Octokit.delete_contents("octokit/octokit.rb",
|
127
127
|
# "lib/octokit.rb",
|
128
128
|
# "Deleting content",
|
129
129
|
# "7eb95f97e1a0636015df3837478d3f15184a5f49",
|
@@ -145,8 +145,8 @@ module Octokit
|
|
145
145
|
# @option options [String] :ref Optional valid Git reference, defaults to master.
|
146
146
|
# @return [String] Location of the download
|
147
147
|
# @see http://developer.github.com/v3/repos/contents/
|
148
|
-
# @example Get archive link for
|
149
|
-
# Octokit.archive_link("
|
148
|
+
# @example Get archive link for octokit/octokit.rb
|
149
|
+
# Octokit.archive_link("octokit/octokit.rb")
|
150
150
|
def archive_link(repo, options={})
|
151
151
|
repo_ref = options.delete :ref
|
152
152
|
format = (options.delete :format) || 'tarball'
|
@@ -110,7 +110,7 @@ module Octokit
|
|
110
110
|
# @return [Array<Sawyer::Resource>] Array of all Issue Events for this Repository
|
111
111
|
# @see http://developer.github.com/v3/issues/events/#list-events-for-a-repository
|
112
112
|
# @example Get all Issue Events for Octokit
|
113
|
-
# Octokit.repository_issue_events("
|
113
|
+
# Octokit.repository_issue_events("octokit/octokit.rb")
|
114
114
|
def repository_issue_events(repo, options = {})
|
115
115
|
paginate "repos/#{Repository.new repo}/issues/events", options
|
116
116
|
end
|
@@ -123,8 +123,8 @@ module Octokit
|
|
123
123
|
#
|
124
124
|
# @return [Array<Sawyer::Resource>] Array of events for that issue
|
125
125
|
# @see http://developer.github.com/v3/issues/events/#list-events-for-an-issue
|
126
|
-
# @example List all issues events for issue #38 on
|
127
|
-
# Octokit.issue_events("
|
126
|
+
# @example List all issues events for issue #38 on octokit/octokit.rb
|
127
|
+
# Octokit.issue_events("octokit/octokit.rb", 38)
|
128
128
|
def issue_events(repo, number, options = {})
|
129
129
|
paginate "repos/#{Repository.new(repo)}/issues/#{number}/events", options
|
130
130
|
end
|
@@ -137,7 +137,7 @@ module Octokit
|
|
137
137
|
# @return [Sawyer::Resource] A single Event for an Issue
|
138
138
|
# @see http://developer.github.com/v3/issues/events/#get-a-single-event
|
139
139
|
# @example Get Event information for ID 3094334 (a pull request was closed)
|
140
|
-
# Octokit.issue_event("
|
140
|
+
# Octokit.issue_event("octokit/octokit.rb", 3094334)
|
141
141
|
def issue_event(repo, number, options = {})
|
142
142
|
paginate "repos/#{Repository.new(repo)}/issues/events/#{number}", options
|
143
143
|
end
|
@@ -106,8 +106,8 @@ module Octokit
|
|
106
106
|
# @param number [String] Number ID of the issue
|
107
107
|
# @return [Sawyer::Resource] The issue you requested, if it exists
|
108
108
|
# @see http://developer.github.com/v3/issues/#get-a-single-issue
|
109
|
-
# @example Get issue #25 from
|
110
|
-
# Octokit.issue("
|
109
|
+
# @example Get issue #25 from octokit/octokit.rb
|
110
|
+
# Octokit.issue("octokit/octokit.rb", "25")
|
111
111
|
def issue(repo, number, options = {})
|
112
112
|
get "repos/#{Repository.new(repo)}/issues/#{number}", options
|
113
113
|
end
|
@@ -122,8 +122,8 @@ module Octokit
|
|
122
122
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
123
123
|
# @return [Sawyer::Resource] The updated Issue
|
124
124
|
# @see http://developer.github.com/v3/issues/#edit-an-issue
|
125
|
-
# @example Close Issue #25 from
|
126
|
-
# Octokit.close_issue("
|
125
|
+
# @example Close Issue #25 from octokit/octokit.rb
|
126
|
+
# Octokit.close_issue("octokit/octokit.rb", "25")
|
127
127
|
def close_issue(repo, number, options = {})
|
128
128
|
patch "repos/#{Repository.new(repo)}/issues/#{number}", options.merge({:state => "closed"})
|
129
129
|
end
|
@@ -138,8 +138,8 @@ module Octokit
|
|
138
138
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
139
139
|
# @return [Sawyer::Resource] The updated Issue
|
140
140
|
# @see http://developer.github.com/v3/issues/#edit-an-issue
|
141
|
-
# @example Reopen Issue #25 from
|
142
|
-
# Octokit.reopen_issue("
|
141
|
+
# @example Reopen Issue #25 from octokit/octokit.rb
|
142
|
+
# Octokit.reopen_issue("octokit/octokit.rb", "25")
|
143
143
|
def reopen_issue(repo, number, options = {})
|
144
144
|
patch "repos/#{Repository.new(repo)}/issues/#{number}", options.merge({:state => "open"})
|
145
145
|
end
|
@@ -158,7 +158,7 @@ module Octokit
|
|
158
158
|
# @return [Sawyer::Resource] The updated Issue
|
159
159
|
# @see http://developer.github.com/v3/issues/#edit-an-issue
|
160
160
|
# @example Change the title of Issue #25
|
161
|
-
# Octokit.update_issue("
|
161
|
+
# Octokit.update_issue("octokit/octokit.rb", "25", "A new title", "the same body"")
|
162
162
|
def update_issue(repo, number, title, body, options = {})
|
163
163
|
patch "repos/#{Repository.new(repo)}/issues/#{number}", options.merge({:title => title, :body => body})
|
164
164
|
end
|
@@ -180,10 +180,10 @@ module Octokit
|
|
180
180
|
# @see http://developer.github.com/v3/issues/comments/#list-comments-in-a-repository
|
181
181
|
#
|
182
182
|
# @example Get the comments for issues in the octokit repository
|
183
|
-
# @client.issues_comments("
|
183
|
+
# @client.issues_comments("octokit/octokit.rb")
|
184
184
|
#
|
185
185
|
# @example Get issues comments, sort by updated descending since a time
|
186
|
-
# @client.issues_comments("
|
186
|
+
# @client.issues_comments("octokit/octokit.rb", {
|
187
187
|
# :sort => 'desc',
|
188
188
|
# :direction => 'asc',
|
189
189
|
# :since => '2010-05-04T23:45:02Z'
|
@@ -198,8 +198,8 @@ module Octokit
|
|
198
198
|
# @param number [String] Number ID of the issue
|
199
199
|
# @return [Array<Sawyer::Resource>] Array of comments that belong to an issue
|
200
200
|
# @see http://developer.github.com/v3/issues/comments
|
201
|
-
# @example Get comments for issue #25 from
|
202
|
-
# Octokit.issue_comments("
|
201
|
+
# @example Get comments for issue #25 from octokit/octokit.rb
|
202
|
+
# Octokit.issue_comments("octokit/octokit.rb", "25")
|
203
203
|
def issue_comments(repo, number, options = {})
|
204
204
|
paginate "repos/#{Repository.new(repo)}/issues/#{number}/comments", options
|
205
205
|
end
|
@@ -210,8 +210,8 @@ module Octokit
|
|
210
210
|
# @param number [String] Number ID of the comment
|
211
211
|
# @return [Sawyer::Resource] The specific comment in question
|
212
212
|
# @see http://developer.github.com/v3/issues/comments/#get-a-single-comment
|
213
|
-
# @example Get comment #1194549 from an issue on
|
214
|
-
# Octokit.issue_comments("
|
213
|
+
# @example Get comment #1194549 from an issue on octokit/octokit.rb
|
214
|
+
# Octokit.issue_comments("octokit/octokit.rb", 1194549)
|
215
215
|
def issue_comment(repo, number, options = {})
|
216
216
|
paginate "repos/#{Repository.new(repo)}/issues/comments/#{number}", options
|
217
217
|
end
|
@@ -223,8 +223,8 @@ module Octokit
|
|
223
223
|
# @param comment [String] Comment to be added
|
224
224
|
# @return [Sawyer::Resource] Comment
|
225
225
|
# @see http://developer.github.com/v3/issues/comments/#create-a-comment
|
226
|
-
# @example Add the comment "Almost to v1" to Issue #23 on
|
227
|
-
# Octokit.add_comment("
|
226
|
+
# @example Add the comment "Almost to v1" to Issue #23 on octokit/octokit.rb
|
227
|
+
# Octokit.add_comment("octokit/octokit.rb", 23, "Almost to v1")
|
228
228
|
def add_comment(repo, number, comment, options = {})
|
229
229
|
post "repos/#{Repository.new(repo)}/issues/#{number}/comments", options.merge({:body => comment})
|
230
230
|
end
|
@@ -236,8 +236,8 @@ module Octokit
|
|
236
236
|
# @param comment [String] Body of the comment which will replace the existing body.
|
237
237
|
# @return [Sawyer::Resource] Comment
|
238
238
|
# @see http://developer.github.com/v3/issues/comments/#edit-a-comment
|
239
|
-
# @example Update the comment #1194549 with body "I've started this on my 25-issue-comments-v3 fork" on an issue on
|
240
|
-
# Octokit.update_comment("
|
239
|
+
# @example Update the comment #1194549 with body "I've started this on my 25-issue-comments-v3 fork" on an issue on octokit/octokit.rb
|
240
|
+
# Octokit.update_comment("octokit/octokit.rb", 1194549, "Almost to v1, added this on my fork")
|
241
241
|
def update_comment(repo, number, comment, options = {})
|
242
242
|
patch "repos/#{Repository.new(repo)}/issues/comments/#{number}", options.merge({:body => comment})
|
243
243
|
end
|
@@ -248,8 +248,8 @@ module Octokit
|
|
248
248
|
# @param number [Integer] Comment number
|
249
249
|
# @return [Boolean] Success
|
250
250
|
# @see http://developer.github.com/v3/issues/comments/#delete-a-comment
|
251
|
-
# @example Delete the comment #1194549 on an issue on
|
252
|
-
# Octokit.delete_comment("
|
251
|
+
# @example Delete the comment #1194549 on an issue on octokit/octokit.rb
|
252
|
+
# Octokit.delete_comment("octokit/octokit.rb", 1194549)
|
253
253
|
def delete_comment(repo, number, options = {})
|
254
254
|
boolean_from_response :delete, "repos/#{Repository.new(repo)}/issues/comments/#{number}", options
|
255
255
|
end
|
@@ -13,8 +13,8 @@ module Octokit
|
|
13
13
|
# @param repo [String, Repository, Hash] A GitHub repository
|
14
14
|
# @return [Array<Sawyer::Resource>] A list of the labels across the repository
|
15
15
|
# @see http://developer.github.com/v3/issues/labels/
|
16
|
-
# @example List labels for
|
17
|
-
# Octokit.labels("
|
16
|
+
# @example List labels for octokit/octokit.rb
|
17
|
+
# Octokit.labels("octokit/octokit.rb")
|
18
18
|
def labels(repo, options = {})
|
19
19
|
get "repos/#{Repository.new(repo)}/labels", options
|
20
20
|
end
|
@@ -25,8 +25,8 @@ module Octokit
|
|
25
25
|
# @param name [String] Name of the label
|
26
26
|
# @return [Sawyer::Resource] A single label from the repository
|
27
27
|
# @see http://developer.github.com/v3/issues/labels/#get-a-single-label
|
28
|
-
# @example Get the "V3 Addition" label from
|
29
|
-
# Octokit.labels("
|
28
|
+
# @example Get the "V3 Addition" label from octokit/octokit.rb
|
29
|
+
# Octokit.labels("octokit/octokit.rb")
|
30
30
|
def label(repo, name, options = {})
|
31
31
|
get "repos/#{Repository.new(repo)}/labels/#{CGI.escape(name)}", options
|
32
32
|
end
|
@@ -39,7 +39,7 @@ module Octokit
|
|
39
39
|
# @return [Sawyer::Resource] The new label
|
40
40
|
# @see http://developer.github.com/v3/issues/labels/
|
41
41
|
# @example Add a new label "Version 1.0" with color "#cccccc"
|
42
|
-
# Octokit.add_label("
|
42
|
+
# Octokit.add_label("octokit/octokit.rb", "Version 1.0", "cccccc")
|
43
43
|
def add_label(repo, label, color="ffffff", options = {})
|
44
44
|
post "repos/#{Repository.new(repo)}/labels", options.merge({:name => label, :color => color})
|
45
45
|
end
|
@@ -54,7 +54,7 @@ module Octokit
|
|
54
54
|
# @return [Sawyer::Resource] The updated label
|
55
55
|
# @see http://developer.github.com/v3/issues/labels/#update-a-label
|
56
56
|
# @example Update the label "Version 1.0" with new color "#cceeaa"
|
57
|
-
# Octokit.update_label("
|
57
|
+
# Octokit.update_label("octokit/octokit.rb", "Version 1.0", {:color => "cceeaa"})
|
58
58
|
def update_label(repo, label, options = {})
|
59
59
|
patch "repos/#{Repository.new(repo)}/labels/#{CGI.escape(label)}", options
|
60
60
|
end
|
@@ -67,9 +67,8 @@ module Octokit
|
|
67
67
|
# @param label [String] String name of the label
|
68
68
|
# @return [Boolean] Success
|
69
69
|
# @see http://developer.github.com/v3/issues/labels/#delete-a-label
|
70
|
-
# @see http://rubydoc.info/gems/faraday/0.5.3/Faraday/Response
|
71
70
|
# @example Delete the label "Version 1.0" from the repository.
|
72
|
-
# Octokit.delete_label!("
|
71
|
+
# Octokit.delete_label!("octokit/octokit.rb", "Version 1.0")
|
73
72
|
def delete_label!(repo, label, options = {})
|
74
73
|
boolean_from_response :delete, "repos/#{Repository.new(repo)}/labels/#{CGI.escape(label)}", options
|
75
74
|
end
|
@@ -82,10 +81,9 @@ module Octokit
|
|
82
81
|
# @param number [String] Number ID of the issue
|
83
82
|
# @param label [String] String name of the label
|
84
83
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
85
|
-
# @see http://rubydoc.info/gems/faraday/0.5.3/Faraday/Response
|
86
84
|
# @see http://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
|
87
85
|
# @example Remove the label "Version 1.0" from the repository.
|
88
|
-
# Octokit.remove_label("
|
86
|
+
# Octokit.remove_label("octokit/octokit.rb", 23, "Version 1.0")
|
89
87
|
def remove_label(repo, number, label, options = {})
|
90
88
|
delete "repos/#{Repository.new(repo)}/issues/#{number}/labels/#{CGI.escape(label)}", options
|
91
89
|
end
|
@@ -99,7 +97,7 @@ module Octokit
|
|
99
97
|
# @return [Boolean] Success of operation
|
100
98
|
# @see http://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue
|
101
99
|
# @example Remove all labels from Issue #23
|
102
|
-
# Octokit.remove_all_labels("
|
100
|
+
# Octokit.remove_all_labels("octokit/octokit.rb", 23)
|
103
101
|
def remove_all_labels(repo, number, options = {})
|
104
102
|
boolean_from_response :delete, "repos/#{Repository.new(repo)}/issues/#{number}/labels", options
|
105
103
|
end
|
@@ -110,8 +108,8 @@ module Octokit
|
|
110
108
|
# @param number [String] Number ID of the issue
|
111
109
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
112
110
|
# @see http://developer.github.com/v3/issues/labels/#list-labels-on-an-issue
|
113
|
-
# @example List labels for
|
114
|
-
# Octokit.labels("
|
111
|
+
# @example List labels for octokit/octokit.rb
|
112
|
+
# Octokit.labels("octokit/octokit.rb")
|
115
113
|
def labels_for_issue(repo, number, options = {})
|
116
114
|
get "repos/#{Repository.new(repo)}/issues/#{number}/labels", options
|
117
115
|
end
|
@@ -123,8 +121,8 @@ module Octokit
|
|
123
121
|
# @param labels [Array] An array of labels to apply to this Issue
|
124
122
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
125
123
|
# @see http://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
|
126
|
-
# @example Add two labels for
|
127
|
-
# Octokit.add_labels_to_an_issue("
|
124
|
+
# @example Add two labels for octokit/octokit.rb
|
125
|
+
# Octokit.add_labels_to_an_issue("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement'])
|
128
126
|
def add_labels_to_an_issue(repo, number, labels)
|
129
127
|
post "repos/#{Repository.new(repo)}/issues/#{number}/labels", labels
|
130
128
|
end
|
@@ -136,8 +134,8 @@ module Octokit
|
|
136
134
|
# @param labels [Array] An array of labels to use as replacement
|
137
135
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
138
136
|
# @see http://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue
|
139
|
-
# @example Replace labels for
|
140
|
-
# Octokit.replace_all_labels("
|
137
|
+
# @example Replace labels for octokit/octokit.rb Issue #10
|
138
|
+
# Octokit.replace_all_labels("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement'])
|
141
139
|
def replace_all_labels(repo, number, labels, options = {})
|
142
140
|
put "repos/#{Repository.new(repo)}/issues/#{number}/labels", labels
|
143
141
|
end
|
@@ -148,8 +146,8 @@ module Octokit
|
|
148
146
|
# @param number [String] Number ID of the milestone
|
149
147
|
# @return [Array<Sawyer::Resource>] A list of the labels across the milestone
|
150
148
|
# @see http://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone
|
151
|
-
# @example List all labels for milestone #2 on
|
152
|
-
# Octokit.labels_for_milestone("
|
149
|
+
# @example List all labels for milestone #2 on octokit/octokit.rb
|
150
|
+
# Octokit.labels_for_milestone("octokit/octokit.rb", 2)
|
153
151
|
def labels_for_milestone(repo, number, options = {})
|
154
152
|
get "repos/#{Repository.new(repo)}/milestones/#{number}/labels", options
|
155
153
|
end
|
@@ -14,7 +14,7 @@ module Octokit
|
|
14
14
|
# @return [String] HTML renderization
|
15
15
|
# @see http://developer.github.com/v3/repos/markdown/
|
16
16
|
# @example Render some GFM
|
17
|
-
# Octokit.markdown('Fixed in #111', :mode => "gfm", :context => "
|
17
|
+
# Octokit.markdown('Fixed in #111', :mode => "gfm", :context => "octokit/octokit.rb")
|
18
18
|
def markdown(text, options = {})
|
19
19
|
options[:text] = text
|
20
20
|
options[:repo] = Repository.new(options[:repo]) if options[:repo]
|
@@ -17,7 +17,7 @@ module Octokit
|
|
17
17
|
# @return [Array<Sawyer::Resource>] A list of milestones for a repository.
|
18
18
|
# @see http://developer.github.com/v3/issues/milestones/#List-Milestones-for-an-Issue
|
19
19
|
# @example List milestones for a repository
|
20
|
-
# Octokit.list_milestones("
|
20
|
+
# Octokit.list_milestones("octokit/octokit.rb")
|
21
21
|
def list_milestones(repository, options = {})
|
22
22
|
paginate "repos/#{Repository.new(repository)}/milestones", options
|
23
23
|
end
|
@@ -34,7 +34,7 @@ module Octokit
|
|
34
34
|
# @return [Sawyer::Resource] A single milestone from a repository.
|
35
35
|
# @see http://developer.github.com/v3/issues/milestones/#get-a-single-milestone
|
36
36
|
# @example Get a single milestone for a repository
|
37
|
-
# Octokit.milestone("
|
37
|
+
# Octokit.milestone("octokit/octokit.rb", 1)
|
38
38
|
def milestone(repository, number, options = {})
|
39
39
|
get "repos/#{Repository.new(repository)}/milestones/#{number}", options
|
40
40
|
end
|
@@ -50,7 +50,7 @@ module Octokit
|
|
50
50
|
# @return [Sawyer::Resource] A single milestone object
|
51
51
|
# @see http://developer.github.com/v3/issues/milestones/#create-a-milestone
|
52
52
|
# @example Create a milestone for a repository
|
53
|
-
# Octokit.create_milestone("
|
53
|
+
# Octokit.create_milestone("octokit/octokit.rb", "0.7.0", {:description => 'Add support for v3 of Github API'})
|
54
54
|
def create_milestone(repository, title, options = {})
|
55
55
|
post "repos/#{Repository.new(repository)}/milestones", options.merge({:title => title})
|
56
56
|
end
|
@@ -67,7 +67,7 @@ module Octokit
|
|
67
67
|
# @return [Sawyer::Resource] A single milestone object
|
68
68
|
# @see http://developer.github.com/v3/issues/milestones/#update-a-milestone
|
69
69
|
# @example Update a milestone for a repository
|
70
|
-
# Octokit.update_milestone("
|
70
|
+
# Octokit.update_milestone("octokit/octokit.rb", 1, {:description => 'Add support for v3 of Github API'})
|
71
71
|
def update_milestone(repository, number, options = {})
|
72
72
|
patch "repos/#{Repository.new(repository)}/milestones/#{number}", options
|
73
73
|
end
|
@@ -81,7 +81,7 @@ module Octokit
|
|
81
81
|
# @return [Boolean] Success
|
82
82
|
# @see http://developer.github.com/v3/issues/milestones/#delete-a-milestone
|
83
83
|
# @example Delete a single milestone from a repository
|
84
|
-
# Octokit.delete_milestone("
|
84
|
+
# Octokit.delete_milestone("octokit/octokit.rb", 1)
|
85
85
|
def delete_milestone(repository, number, options = {})
|
86
86
|
boolean_from_response :delete, "repos/#{Repository.new(repository)}/milestones/#{number}", options
|
87
87
|
end
|
@@ -41,9 +41,9 @@ module Octokit
|
|
41
41
|
# the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Ex. '2012-10-09T23:39:01Z'
|
42
42
|
# @return [Array<Sawyer::Resource>] Array of notifications.
|
43
43
|
# @see http://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository
|
44
|
-
# @example Get your notifications for
|
45
|
-
# @client.repository_notifications('
|
46
|
-
# @example Get your notifications for
|
44
|
+
# @example Get your notifications for octokit/octokit.rb
|
45
|
+
# @client.repository_notifications('octokit/octokit.rb')
|
46
|
+
# @example Get your notifications for octokit/octokit.rb since a time.
|
47
47
|
# @client.repository_notifications({since: '2012-10-09T23:39:01Z'})
|
48
48
|
def repository_notifications(repo, options = {})
|
49
49
|
paginate "repos/#{Repository.new repo}/notifications", options
|
@@ -85,7 +85,7 @@ module Octokit
|
|
85
85
|
# @return [Boolean] True if marked as read, false otherwise
|
86
86
|
# @see http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository
|
87
87
|
# @example
|
88
|
-
# @client.mark_notifications_as_read("
|
88
|
+
# @client.mark_notifications_as_read("octokit/octokit.rb")
|
89
89
|
def mark_repository_notifications_as_read(repo, options = {})
|
90
90
|
request :put, "repos/#{Repository.new repo}/notifications", options
|
91
91
|
|