octokit 3.0.0 → 3.1.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 +4 -4
- data/lib/octokit/authentication.rb +4 -4
- data/lib/octokit/client.rb +70 -5
- data/lib/octokit/client/authorizations.rb +123 -29
- data/lib/octokit/client/commit_comments.rb +7 -7
- data/lib/octokit/client/commits.rb +11 -11
- data/lib/octokit/client/contents.rb +7 -7
- data/lib/octokit/client/deployments.rb +5 -5
- data/lib/octokit/client/downloads.rb +5 -5
- data/lib/octokit/client/emojis.rb +1 -1
- data/lib/octokit/client/events.rb +15 -15
- data/lib/octokit/client/feeds.rb +2 -2
- data/lib/octokit/client/gists.rb +17 -17
- data/lib/octokit/client/gitignore.rb +3 -3
- data/lib/octokit/client/hooks.rb +1 -1
- data/lib/octokit/client/issues.rb +16 -16
- data/lib/octokit/client/labels.rb +14 -14
- data/lib/octokit/client/legacy_search.rb +3 -3
- data/lib/octokit/client/markdown.rb +2 -2
- data/lib/octokit/client/meta.rb +2 -2
- data/lib/octokit/client/milestones.rb +6 -6
- data/lib/octokit/client/notifications.rb +10 -10
- data/lib/octokit/client/objects.rb +8 -8
- data/lib/octokit/client/organizations.rb +30 -30
- data/lib/octokit/client/pages.rb +4 -4
- data/lib/octokit/client/pub_sub_hubbub.rb +5 -5
- data/lib/octokit/client/pull_requests.rb +20 -20
- data/lib/octokit/client/rate_limit.rb +5 -5
- data/lib/octokit/client/refs.rb +9 -9
- data/lib/octokit/client/releases.rb +11 -11
- data/lib/octokit/client/repositories.rb +44 -44
- data/lib/octokit/client/search.rb +5 -5
- data/lib/octokit/client/stats.rb +6 -6
- data/lib/octokit/client/statuses.rb +3 -3
- data/lib/octokit/client/users.rb +36 -36
- data/lib/octokit/configurable.rb +4 -4
- data/lib/octokit/error.rb +4 -0
- data/lib/octokit/rate_limit.rb +1 -1
- data/lib/octokit/version.rb +1 -1
- metadata +9 -9
data/lib/octokit/client/hooks.rb
CHANGED
@@ -7,7 +7,7 @@ module Octokit
|
|
7
7
|
# List all Service Hooks supported by GitHub
|
8
8
|
#
|
9
9
|
# @return [Sawyer::Resource] A list of all hooks on GitHub
|
10
|
-
# @see
|
10
|
+
# @see https://developer.github.com/v3/repos/hooks/#services
|
11
11
|
# @example List all hooks
|
12
12
|
# Octokit.available_hooks
|
13
13
|
def available_hooks(options = {})
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Issues API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/issues/
|
7
7
|
module Issues
|
8
8
|
|
9
9
|
# List issues for the authenticated user or repository
|
@@ -20,8 +20,8 @@ module Octokit
|
|
20
20
|
# @option options [String] :direction (desc) Direction: <tt>asc</tt> or <tt>desc</tt>.
|
21
21
|
# @option options [Integer] :page (1) Page number.
|
22
22
|
# @return [Array<Sawyer::Resource>] A list of issues for a repository.
|
23
|
-
# @see
|
24
|
-
# @see
|
23
|
+
# @see https://developer.github.com/v3/issues/#list-issues-for-a-repository
|
24
|
+
# @see https://developer.github.com/v3/issues/#list-issues
|
25
25
|
# @example List issues for a repository
|
26
26
|
# Octokit.list_issues("sferik/rails_admin")
|
27
27
|
# @example List issues for the authenticted user across repositories
|
@@ -48,7 +48,7 @@ module Octokit
|
|
48
48
|
# @option options [String] :since Timestamp in ISO 8601
|
49
49
|
# format: YYYY-MM-DDTHH:MM:SSZ
|
50
50
|
# @return [Array<Sawyer::Resource>] A list of issues for a repository.
|
51
|
-
# @see
|
51
|
+
# @see https://developer.github.com/v3/issues/#list-issues
|
52
52
|
# @example List issues for the authenticted user across owned and member repositories
|
53
53
|
# @client = Octokit::Client.new(:login => 'foo', :password => 'bar')
|
54
54
|
# @client.user_issues
|
@@ -69,7 +69,7 @@ module Octokit
|
|
69
69
|
# @option options [String] :since Timestamp in ISO 8601
|
70
70
|
# format: YYYY-MM-DDTHH:MM:SSZ
|
71
71
|
# @return [Array<Sawyer::Resource>] A list of issues.
|
72
|
-
# @see
|
72
|
+
# @see https://developer.github.com/v3/issues/#list-issues
|
73
73
|
# @example List all issues for a given organization for the authenticated user
|
74
74
|
# @client = Octokit::Client.new(:login => 'foo', :password => 'bar')
|
75
75
|
# @client.org_issues("octokit")
|
@@ -87,7 +87,7 @@ module Octokit
|
|
87
87
|
# @option options [Integer] :milestone Milestone number.
|
88
88
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
89
89
|
# @return [Sawyer::Resource] Your newly created issue
|
90
|
-
# @see
|
90
|
+
# @see https://developer.github.com/v3/issues/#create-an-issue
|
91
91
|
# @example Create a new Issues for a repository
|
92
92
|
# Octokit.create_issue("sferik/rails_admin", 'Updated Docs', 'Added some extra links')
|
93
93
|
def create_issue(repo, title, body, options = {})
|
@@ -106,7 +106,7 @@ module Octokit
|
|
106
106
|
# @param repo [String, Repository, Hash] A GitHub repository
|
107
107
|
# @param number [Integer] Number ID of the issue
|
108
108
|
# @return [Sawyer::Resource] The issue you requested, if it exists
|
109
|
-
# @see
|
109
|
+
# @see https://developer.github.com/v3/issues/#get-a-single-issue
|
110
110
|
# @example Get issue #25 from octokit/octokit.rb
|
111
111
|
# Octokit.issue("octokit/octokit.rb", "25")
|
112
112
|
def issue(repo, number, options = {})
|
@@ -122,7 +122,7 @@ module Octokit
|
|
122
122
|
# @option options [Integer] :milestone Milestone number.
|
123
123
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
124
124
|
# @return [Sawyer::Resource] The updated Issue
|
125
|
-
# @see
|
125
|
+
# @see https://developer.github.com/v3/issues/#edit-an-issue
|
126
126
|
# @example Close Issue #25 from octokit/octokit.rb
|
127
127
|
# Octokit.close_issue("octokit/octokit.rb", "25")
|
128
128
|
def close_issue(repo, number, options = {})
|
@@ -138,7 +138,7 @@ module Octokit
|
|
138
138
|
# @option options [Integer] :milestone Milestone number.
|
139
139
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
140
140
|
# @return [Sawyer::Resource] The updated Issue
|
141
|
-
# @see
|
141
|
+
# @see https://developer.github.com/v3/issues/#edit-an-issue
|
142
142
|
# @example Reopen Issue #25 from octokit/octokit.rb
|
143
143
|
# Octokit.reopen_issue("octokit/octokit.rb", "25")
|
144
144
|
def reopen_issue(repo, number, options = {})
|
@@ -157,7 +157,7 @@ module Octokit
|
|
157
157
|
# @option options [String] :labels List of comma separated Label names. Example: <tt>bug,ui,@high</tt>.
|
158
158
|
# @option options [String] :state State of the issue. <tt>open</tt> or <tt>closed</tt>
|
159
159
|
# @return [Sawyer::Resource] The updated Issue
|
160
|
-
# @see
|
160
|
+
# @see https://developer.github.com/v3/issues/#edit-an-issue
|
161
161
|
# @example Change the title of Issue #25
|
162
162
|
# Octokit.update_issue("octokit/octokit.rb", "25", "A new title", "the same body"")
|
163
163
|
def update_issue(repo, number, title, body, options = {})
|
@@ -178,7 +178,7 @@ module Octokit
|
|
178
178
|
#
|
179
179
|
# @return [Array<Sawyer::Resource>] List of issues comments.
|
180
180
|
#
|
181
|
-
# @see
|
181
|
+
# @see https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository
|
182
182
|
#
|
183
183
|
# @example Get the comments for issues in the octokit repository
|
184
184
|
# @client.issues_comments("octokit/octokit.rb")
|
@@ -198,7 +198,7 @@ module Octokit
|
|
198
198
|
# @param repo [String, Repository, Hash] A GitHub repository
|
199
199
|
# @param number [Integer] Number ID of the issue
|
200
200
|
# @return [Array<Sawyer::Resource>] Array of comments that belong to an issue
|
201
|
-
# @see
|
201
|
+
# @see https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue
|
202
202
|
# @example Get comments for issue #25 from octokit/octokit.rb
|
203
203
|
# Octokit.issue_comments("octokit/octokit.rb", "25")
|
204
204
|
def issue_comments(repo, number, options = {})
|
@@ -210,7 +210,7 @@ module Octokit
|
|
210
210
|
# @param repo [String, Repository, Hash] A GitHub repository
|
211
211
|
# @param number [Integer] Number ID of the comment
|
212
212
|
# @return [Sawyer::Resource] The specific comment in question
|
213
|
-
# @see
|
213
|
+
# @see https://developer.github.com/v3/issues/comments/#get-a-single-comment
|
214
214
|
# @example Get comment #1194549 from an issue on octokit/octokit.rb
|
215
215
|
# Octokit.issue_comments("octokit/octokit.rb", 1194549)
|
216
216
|
def issue_comment(repo, number, options = {})
|
@@ -223,7 +223,7 @@ module Octokit
|
|
223
223
|
# @param number [Integer] Issue number
|
224
224
|
# @param comment [String] Comment to be added
|
225
225
|
# @return [Sawyer::Resource] Comment
|
226
|
-
# @see
|
226
|
+
# @see https://developer.github.com/v3/issues/comments/#create-a-comment
|
227
227
|
# @example Add the comment "Almost to v1" to Issue #23 on octokit/octokit.rb
|
228
228
|
# Octokit.add_comment("octokit/octokit.rb", 23, "Almost to v1")
|
229
229
|
def add_comment(repo, number, comment, options = {})
|
@@ -236,7 +236,7 @@ module Octokit
|
|
236
236
|
# @param number [Integer] Comment number
|
237
237
|
# @param comment [String] Body of the comment which will replace the existing body.
|
238
238
|
# @return [Sawyer::Resource] Comment
|
239
|
-
# @see
|
239
|
+
# @see https://developer.github.com/v3/issues/comments/#edit-a-comment
|
240
240
|
# @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
|
241
241
|
# Octokit.update_comment("octokit/octokit.rb", 1194549, "Almost to v1, added this on my fork")
|
242
242
|
def update_comment(repo, number, comment, options = {})
|
@@ -248,7 +248,7 @@ module Octokit
|
|
248
248
|
# @param repo [String, Repository, Hash] A GitHub repository
|
249
249
|
# @param number [Integer] Comment number
|
250
250
|
# @return [Boolean] Success
|
251
|
-
# @see
|
251
|
+
# @see https://developer.github.com/v3/issues/comments/#delete-a-comment
|
252
252
|
# @example Delete the comment #1194549 on an issue on octokit/octokit.rb
|
253
253
|
# Octokit.delete_comment("octokit/octokit.rb", 1194549)
|
254
254
|
def delete_comment(repo, number, options = {})
|
@@ -5,18 +5,18 @@ module Octokit
|
|
5
5
|
|
6
6
|
# Methods for the Issue Labels API
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see https://developer.github.com/v3/issues/labels/
|
9
9
|
module Labels
|
10
10
|
|
11
11
|
# List available labels for a repository
|
12
12
|
#
|
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
|
-
# @see
|
15
|
+
# @see https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
|
16
16
|
# @example List labels for octokit/octokit.rb
|
17
17
|
# Octokit.labels("octokit/octokit.rb")
|
18
18
|
def labels(repo, options = {})
|
19
|
-
|
19
|
+
paginate "repos/#{Repository.new(repo)}/labels", options
|
20
20
|
end
|
21
21
|
|
22
22
|
# Get single label for a repository
|
@@ -24,7 +24,7 @@ module Octokit
|
|
24
24
|
# @param repo [String, Repository, Hash] A GitHub repository
|
25
25
|
# @param name [String] Name of the label
|
26
26
|
# @return [Sawyer::Resource] A single label from the repository
|
27
|
-
# @see
|
27
|
+
# @see https://developer.github.com/v3/issues/labels/#get-a-single-label
|
28
28
|
# @example Get the "V3 Addition" label from octokit/octokit.rb
|
29
29
|
# Octokit.labels("octokit/octokit.rb", "V3 Addition")
|
30
30
|
def label(repo, name, options = {})
|
@@ -37,7 +37,7 @@ module Octokit
|
|
37
37
|
# @param label [String] A new label
|
38
38
|
# @param color [String] A color, in hex, without the leading #
|
39
39
|
# @return [Sawyer::Resource] The new label
|
40
|
-
# @see
|
40
|
+
# @see https://developer.github.com/v3/issues/labels/#create-a-label
|
41
41
|
# @example Add a new label "Version 1.0" with color "#cccccc"
|
42
42
|
# Octokit.add_label("octokit/octokit.rb", "Version 1.0", "cccccc")
|
43
43
|
def add_label(repo, label, color="ffffff", options = {})
|
@@ -52,7 +52,7 @@ module Octokit
|
|
52
52
|
# @option options [String] :name An updated label name
|
53
53
|
# @option options [String] :color An updated color value, in hex, without leading #
|
54
54
|
# @return [Sawyer::Resource] The updated label
|
55
|
-
# @see
|
55
|
+
# @see https://developer.github.com/v3/issues/labels/#update-a-label
|
56
56
|
# @example Update the label "Version 1.0" with new color "#cceeaa"
|
57
57
|
# Octokit.update_label("octokit/octokit.rb", "Version 1.0", {:color => "cceeaa"})
|
58
58
|
def update_label(repo, label, options = {})
|
@@ -66,7 +66,7 @@ module Octokit
|
|
66
66
|
# @param repo [String, Repository, Hash] A GitHub repository
|
67
67
|
# @param label [String] String name of the label
|
68
68
|
# @return [Boolean] Success
|
69
|
-
# @see
|
69
|
+
# @see https://developer.github.com/v3/issues/labels/#delete-a-label
|
70
70
|
# @example Delete the label "Version 1.0" from the repository.
|
71
71
|
# Octokit.delete_label!("octokit/octokit.rb", "Version 1.0")
|
72
72
|
def delete_label!(repo, label, options = {})
|
@@ -81,7 +81,7 @@ module Octokit
|
|
81
81
|
# @param number [Fixnum] Number ID of the issue
|
82
82
|
# @param label [String] String name of the label
|
83
83
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
84
|
-
# @see
|
84
|
+
# @see https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
|
85
85
|
# @example Remove the label "Version 1.0" from the repository.
|
86
86
|
# Octokit.remove_label("octokit/octokit.rb", 23, "Version 1.0")
|
87
87
|
def remove_label(repo, number, label, options = {})
|
@@ -95,7 +95,7 @@ module Octokit
|
|
95
95
|
# @param repo [String, Repository, Hash] A GitHub repository
|
96
96
|
# @param number [Fixnum] Number ID of the issue
|
97
97
|
# @return [Boolean] Success of operation
|
98
|
-
# @see
|
98
|
+
# @see https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue
|
99
99
|
# @example Remove all labels from Issue #23
|
100
100
|
# Octokit.remove_all_labels("octokit/octokit.rb", 23)
|
101
101
|
def remove_all_labels(repo, number, options = {})
|
@@ -107,11 +107,11 @@ module Octokit
|
|
107
107
|
# @param repo [String, Repository, Hash] A GitHub repository
|
108
108
|
# @param number [Fixnum] Number ID of the issue
|
109
109
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
110
|
-
# @see
|
110
|
+
# @see https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue
|
111
111
|
# @example List labels for octokit/octokit.rb, issue # 1
|
112
112
|
# Octokit.labels_for_issue("octokit/octokit.rb", 1)
|
113
113
|
def labels_for_issue(repo, number, options = {})
|
114
|
-
|
114
|
+
paginate "repos/#{Repository.new(repo)}/issues/#{number}/labels", options
|
115
115
|
end
|
116
116
|
|
117
117
|
# Add label(s) to an Issue
|
@@ -120,7 +120,7 @@ module Octokit
|
|
120
120
|
# @param number [Fixnum] Number ID of the issue
|
121
121
|
# @param labels [Array] An array of labels to apply to this Issue
|
122
122
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
123
|
-
# @see
|
123
|
+
# @see https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
|
124
124
|
# @example Add two labels for octokit/octokit.rb
|
125
125
|
# Octokit.add_labels_to_an_issue("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement'])
|
126
126
|
def add_labels_to_an_issue(repo, number, labels)
|
@@ -133,7 +133,7 @@ module Octokit
|
|
133
133
|
# @param number [Fixnum] Number ID of the issue
|
134
134
|
# @param labels [Array] An array of labels to use as replacement
|
135
135
|
# @return [Array<Sawyer::Resource>] A list of the labels currently on the issue
|
136
|
-
# @see
|
136
|
+
# @see https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue
|
137
137
|
# @example Replace labels for octokit/octokit.rb Issue #10
|
138
138
|
# Octokit.replace_all_labels("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement'])
|
139
139
|
def replace_all_labels(repo, number, labels, options = {})
|
@@ -149,7 +149,7 @@ module Octokit
|
|
149
149
|
# @example List all labels for milestone #2 on octokit/octokit.rb
|
150
150
|
# Octokit.labels_for_milestone("octokit/octokit.rb", 2)
|
151
151
|
def labels_for_milestone(repo, number, options = {})
|
152
|
-
|
152
|
+
paginate "repos/#{Repository.new(repo)}/milestones/#{number}/labels", options
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
@@ -3,12 +3,12 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Legacy Search API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/search/
|
7
7
|
module LegacySearch
|
8
8
|
|
9
9
|
# Legacy repository search
|
10
10
|
#
|
11
|
-
# @see
|
11
|
+
# @see https://developer.github.com/v3/search/#search-repositories
|
12
12
|
# @param q [String] Search keyword
|
13
13
|
# @return [Array<Sawyer::Resource>] List of repositories found
|
14
14
|
def legacy_search_repositories(q, options = {})
|
@@ -31,7 +31,7 @@ module Octokit
|
|
31
31
|
#
|
32
32
|
# @param search [String] User to search for.
|
33
33
|
# @return [Array<Sawyer::Resource>] Array of hashes representing users.
|
34
|
-
# @see
|
34
|
+
# @see https://developer.github.com/v3/search/#search-users
|
35
35
|
# @example
|
36
36
|
# Octokit.search_users('pengwynn')
|
37
37
|
def legacy_search_users(search, options = {})
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Markdown API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/markdown/
|
7
7
|
module Markdown
|
8
8
|
|
9
9
|
# Render an arbitrary Markdown document
|
@@ -12,7 +12,7 @@ module Octokit
|
|
12
12
|
# @option options [String] (optional) :mode (`markdown` or `gfm`)
|
13
13
|
# @option options [String] (optional) :context Repo context
|
14
14
|
# @return [String] HTML renderization
|
15
|
-
# @see
|
15
|
+
# @see https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document
|
16
16
|
# @example Render some GFM
|
17
17
|
# Octokit.markdown('Fixed in #111', :mode => "gfm", :context => "octokit/octokit.rb")
|
18
18
|
def markdown(text, options = {})
|
data/lib/octokit/client/meta.rb
CHANGED
@@ -3,11 +3,11 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Meta API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/meta/
|
7
7
|
module Meta
|
8
8
|
|
9
9
|
# Get meta information about GitHub.com, the service.
|
10
|
-
# @see
|
10
|
+
# @see https://developer.github.com/v3/meta/#meta
|
11
11
|
# @return [Sawyer::Resource] Hash with meta information.
|
12
12
|
# @example Get GitHub meta information
|
13
13
|
# @client.github_meta
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Issues Milestones API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/issues/milestones/
|
7
7
|
module Milestones
|
8
8
|
|
9
9
|
# List milestones for a repository
|
@@ -15,7 +15,7 @@ module Octokit
|
|
15
15
|
# @option options [String] :sort (created) Sort: <tt>created</tt>, <tt>updated</tt>, or <tt>comments</tt>.
|
16
16
|
# @option options [String] :direction (desc) Direction: <tt>asc</tt> or <tt>desc</tt>.
|
17
17
|
# @return [Array<Sawyer::Resource>] A list of milestones for a repository.
|
18
|
-
# @see
|
18
|
+
# @see https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository
|
19
19
|
# @example List milestones for a repository
|
20
20
|
# Octokit.list_milestones("octokit/octokit.rb")
|
21
21
|
def list_milestones(repository, options = {})
|
@@ -32,7 +32,7 @@ module Octokit
|
|
32
32
|
# @option options [String] :sort (created) Sort: <tt>created</tt>, <tt>updated</tt>, or <tt>comments</tt>.
|
33
33
|
# @option options [String] :direction (desc) Direction: <tt>asc</tt> or <tt>desc</tt>.
|
34
34
|
# @return [Sawyer::Resource] A single milestone from a repository.
|
35
|
-
# @see
|
35
|
+
# @see https://developer.github.com/v3/issues/milestones/#get-a-single-milestone
|
36
36
|
# @example Get a single milestone for a repository
|
37
37
|
# Octokit.milestone("octokit/octokit.rb", 1)
|
38
38
|
def milestone(repository, number, options = {})
|
@@ -48,7 +48,7 @@ module Octokit
|
|
48
48
|
# @option options [String] :description A meaningful description
|
49
49
|
# @option options [Time] :due_on Set if the milestone has a due date
|
50
50
|
# @return [Sawyer::Resource] A single milestone object
|
51
|
-
# @see
|
51
|
+
# @see https://developer.github.com/v3/issues/milestones/#create-a-milestone
|
52
52
|
# @example Create a milestone for a repository
|
53
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 = {})
|
@@ -65,7 +65,7 @@ module Octokit
|
|
65
65
|
# @option options [String] :description A meaningful description
|
66
66
|
# @option options [Time] :due_on Set if the milestone has a due date
|
67
67
|
# @return [Sawyer::Resource] A single milestone object
|
68
|
-
# @see
|
68
|
+
# @see https://developer.github.com/v3/issues/milestones/#update-a-milestone
|
69
69
|
# @example Update a milestone for a repository
|
70
70
|
# Octokit.update_milestone("octokit/octokit.rb", 1, {:description => 'Add support for v3 of Github API'})
|
71
71
|
def update_milestone(repository, number, options = {})
|
@@ -79,7 +79,7 @@ module Octokit
|
|
79
79
|
# @param options [Hash] A customizable set of options.
|
80
80
|
# @option options [Integer] :milestone Milestone number.
|
81
81
|
# @return [Boolean] Success
|
82
|
-
# @see
|
82
|
+
# @see https://developer.github.com/v3/issues/milestones/#delete-a-milestone
|
83
83
|
# @example Delete a single milestone from a repository
|
84
84
|
# Octokit.delete_milestone("octokit/octokit.rb", 1)
|
85
85
|
def delete_milestone(repository, number, options = {})
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Notifications API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/activity/notifications/
|
7
7
|
module Notifications
|
8
8
|
|
9
9
|
# List your notifications
|
@@ -18,7 +18,7 @@ module Octokit
|
|
18
18
|
# updated before the given time. The time should be passed in as UTC in
|
19
19
|
# the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Ex. '2012-10-09T23:39:01Z'
|
20
20
|
# @return [Array<Sawyer::Resource>] Array of notifications.
|
21
|
-
# @see
|
21
|
+
# @see https://developer.github.com/v3/activity/notifications/#list-your-notifications
|
22
22
|
# @example Get users notifications
|
23
23
|
# @client.notifications
|
24
24
|
# @example Get all notifications since a certain time.
|
@@ -40,7 +40,7 @@ module Octokit
|
|
40
40
|
# updated before the given time. The time should be passed in as UTC in
|
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
|
-
# @see
|
43
|
+
# @see https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository
|
44
44
|
# @example Get your notifications for octokit/octokit.rb
|
45
45
|
# @client.repository_notifications('octokit/octokit.rb')
|
46
46
|
# @example Get your notifications for octokit/octokit.rb since a time.
|
@@ -61,7 +61,7 @@ module Octokit
|
|
61
61
|
# will not be updated. The time should be passed in as UTC in the
|
62
62
|
# ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Ex. '2012-10-09T23:39:01Z'
|
63
63
|
# @return [Boolean] True if marked as read, false otherwise
|
64
|
-
# @see
|
64
|
+
# @see https://developer.github.com/v3/activity/notifications/#mark-as-read
|
65
65
|
#
|
66
66
|
# @example
|
67
67
|
# @client.mark_notifications_as_read
|
@@ -83,7 +83,7 @@ module Octokit
|
|
83
83
|
# will not be updated. The time should be passed in as UTC in the
|
84
84
|
# ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Ex. '2012-10-09T23:39:01Z'
|
85
85
|
# @return [Boolean] True if marked as read, false otherwise
|
86
|
-
# @see
|
86
|
+
# @see https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository
|
87
87
|
# @example
|
88
88
|
# @client.mark_notifications_as_read("octokit/octokit.rb")
|
89
89
|
def mark_repository_notifications_as_read(repo, options = {})
|
@@ -97,7 +97,7 @@ module Octokit
|
|
97
97
|
#
|
98
98
|
# @param thread_id [Integer] Id of the thread.
|
99
99
|
# @return [Array<Sawyer::Resource>] Array of notifications.
|
100
|
-
# @see
|
100
|
+
# @see https://developer.github.com/v3/activity/notifications/#view-a-single-thread
|
101
101
|
#
|
102
102
|
# @example
|
103
103
|
# @client.notification_thread(1000)
|
@@ -113,7 +113,7 @@ module Octokit
|
|
113
113
|
# threads.
|
114
114
|
# @option options [Boolean] :read Inverse of 'unread'.
|
115
115
|
# @return [Boolean] True if updated, false otherwise.
|
116
|
-
# @see
|
116
|
+
# @see https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read
|
117
117
|
# @example
|
118
118
|
# @client.mark_thread_as_ready(1, :read => false)
|
119
119
|
def mark_thread_as_read(thread_id, options = {})
|
@@ -126,7 +126,7 @@ module Octokit
|
|
126
126
|
#
|
127
127
|
# @param thread_id [Integer] Id of the thread.
|
128
128
|
# @return [Sawyer::Resource] Subscription.
|
129
|
-
# @see
|
129
|
+
# @see https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription
|
130
130
|
# @example
|
131
131
|
# @client.thread_subscription(1)
|
132
132
|
def thread_subscription(thread_id, options = {})
|
@@ -147,7 +147,7 @@ module Octokit
|
|
147
147
|
# @option options [Boolean] :ignored Deterimines if all notifications
|
148
148
|
# should be blocked from this repository.
|
149
149
|
# @return [Sawyer::Resource] Updated subscription.
|
150
|
-
# @see
|
150
|
+
# @see https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription
|
151
151
|
# @example Subscribe to notifications
|
152
152
|
# @client.update_thread_subscription(1, :subscribed => true)
|
153
153
|
# @example Ignore notifications from a repo
|
@@ -160,7 +160,7 @@ module Octokit
|
|
160
160
|
#
|
161
161
|
# @param thread_id [Integer] Id of the thread.
|
162
162
|
# @return [Boolean] True if delete successful, false otherwise.
|
163
|
-
# @see
|
163
|
+
# @see https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription
|
164
164
|
# @example
|
165
165
|
# @client.delete_thread_subscription(1)
|
166
166
|
def delete_thread_subscription(thread_id, options = {})
|
@@ -3,7 +3,7 @@ module Octokit
|
|
3
3
|
|
4
4
|
# Methods for the Git Data API
|
5
5
|
#
|
6
|
-
# @see
|
6
|
+
# @see https://developer.github.com/v3/git/
|
7
7
|
module Objects
|
8
8
|
|
9
9
|
# Get a single tree, fetching information about its root-level objects
|
@@ -13,8 +13,8 @@ module Octokit
|
|
13
13
|
# @param repo [String, Hash, Repository] A GitHub repository
|
14
14
|
# @param tree_sha [String] The SHA of the tree to fetch
|
15
15
|
# @return [Sawyer::Resource] A hash representing the fetched tree
|
16
|
-
# @see
|
17
|
-
# @see
|
16
|
+
# @see https://developer.github.com/v3/git/trees/#get-a-tree
|
17
|
+
# @see https://developer.github.com/v3/git/trees/#get-a-tree-recursively
|
18
18
|
# @example Fetch a tree and inspect the path of one of its files
|
19
19
|
# tree = Octokit.tree("octocat/Hello-World", "9fb037999f264ba9a7fc6274d15fa3ae2ab98312")
|
20
20
|
# tree.tree.first.path # => "file.rb"
|
@@ -32,7 +32,7 @@ module Octokit
|
|
32
32
|
# @param repo [String, Hash, Repository] A GitHub repository
|
33
33
|
# @param tree [Array] An array of hashes representing a tree structure
|
34
34
|
# @return [Sawyer::Resource] A hash representing the new tree
|
35
|
-
# @see
|
35
|
+
# @see https://developer.github.com/v3/git/trees/#create-a-tree
|
36
36
|
# @example Create a tree containing one file
|
37
37
|
# tree = Octokit.create_tree("octocat/Hello-World", [ { :path => "file.rb", :mode => "100644", :type => "blob", :sha => "44b4fc6d56897b048c772eb4087f854f46256132" } ])
|
38
38
|
# tree.sha # => "cd8274d15fa3ae2ab983129fb037999f264ba9a7"
|
@@ -47,7 +47,7 @@ module Octokit
|
|
47
47
|
# @param repo [String, Hash, Repository] A GitHub repository
|
48
48
|
# @param blob_sha [String] The SHA of the blob to fetch
|
49
49
|
# @return [Sawyer::Resource] A hash representing the fetched blob
|
50
|
-
# @see
|
50
|
+
# @see https://developer.github.com/v3/git/blobs/#get-a-blob
|
51
51
|
# @example Fetch a blob and inspect its contents
|
52
52
|
# blob = Octokit.blob("octocat/Hello-World", "827efc6d56897b048c772eb4087f854f46256132")
|
53
53
|
# blob.encoding # => "utf-8"
|
@@ -68,7 +68,7 @@ module Octokit
|
|
68
68
|
# @param content [String] Content of the blob
|
69
69
|
# @param encoding [String] The content's encoding. <tt>utf-8</tt> and <tt>base64</tt> are accepted. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it
|
70
70
|
# @return [String] The new blob's SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
|
71
|
-
# @see
|
71
|
+
# @see https://developer.github.com/v3/git/blobs/#create-a-blob
|
72
72
|
# @example Create a blob containing <tt>foo bar baz</tt>
|
73
73
|
# Octokit.create_blob("octocat/Hello-World", "foo bar baz")
|
74
74
|
# @example Create a blob containing <tt>foo bar baz</tt>, encoded using base64
|
@@ -89,7 +89,7 @@ module Octokit
|
|
89
89
|
# @param repo [String, Hash, Repository] A GitHub repository.
|
90
90
|
# @param tag_sha [String] The SHA of the tag to fetch.
|
91
91
|
# @return [Sawyer::Resource] Hash representing the tag.
|
92
|
-
# @see
|
92
|
+
# @see https://developer.github.com/v3/git/tags/#get-a-tag
|
93
93
|
# @example Fetch a tag
|
94
94
|
# Octokit.tag('octokit/octokit.rb', '23aad20633f4d2981b1c7209a800db3014774e96')
|
95
95
|
def tag(repo, tag_sha, options = {})
|
@@ -110,7 +110,7 @@ module Octokit
|
|
110
110
|
# @param tagger_email [String] Email of the author of the tag.
|
111
111
|
# @param tagger_date [string] Timestamp of when this object was tagged.
|
112
112
|
# @return [Sawyer::Resource] Hash representing new tag.
|
113
|
-
# @see
|
113
|
+
# @see https://developer.github.com/v3/git/tags/#create-a-tag-object
|
114
114
|
# @example
|
115
115
|
# @client.create_tag(
|
116
116
|
# "octokit/octokit.rb",
|