Skip to content

Commit 5625025

Browse files
committed
Document gist commits, forks methods
1 parent 6acca11 commit 5625025

File tree

2 files changed

+45
-28
lines changed

2 files changed

+45
-28
lines changed

content/v3/gists.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ including the filename with a `null` hash.
124124
<%= headers 200 %>
125125
<%= json :full_gist %>
126126

127+
128+
## List gist commits
129+
130+
GET /gists/:id/commits
131+
132+
### Response
133+
134+
<%= headers 200 %>
135+
<%= json(:gist_history) %>
136+
127137
## Star a gist
128138

129139
PUT /gists/:id/star
@@ -163,6 +173,15 @@ including the filename with a `null` hash.
163173
<%= headers 201, :Location => "https://api.github.com/gists/2" %>
164174
<%= json(:gist) %>
165175

176+
## List gist forks
177+
178+
GET /gists/:id/forks
179+
180+
### Response
181+
182+
<%= headers 200 %>
183+
<%= json(:gist_forks) %>
184+
166185
## Delete a gist
167186

168187
DELETE /gists/:id

lib/resources.rb

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,34 +1196,30 @@ def text_html(response, status, head = {})
11961196
}
11971197
}
11981198

1199-
GIST_HISTORY = {
1200-
"history" => [
1201-
{
1202-
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
1203-
"version" => "57a7f021a713b1c5a6a199b54cc514735d2d462f",
1204-
"user" => USER,
1205-
"change_status" => {
1206-
"deletions" => 0,
1207-
"additions" => 180,
1208-
"total" => 180
1209-
},
1210-
"committed_at" => "2010-04-14T02:15:15Z"
1211-
}
1212-
]
1213-
}
1199+
GIST_HISTORY = [
1200+
{
1201+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
1202+
"version" => "57a7f021a713b1c5a6a199b54cc514735d2d462f",
1203+
"user" => USER,
1204+
"change_status" => {
1205+
"deletions" => 0,
1206+
"additions" => 180,
1207+
"total" => 180
1208+
},
1209+
"committed_at" => "2010-04-14T02:15:15Z"
1210+
}
1211+
]
12141212

12151213

1216-
GIST_FORKS = {
1217-
"forks" => [
1218-
{
1219-
"user" => USER,
1220-
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
1221-
"id" => 1,
1222-
"created_at" => "2011-04-14T16:00:49Z",
1223-
"updated_at" => "2011-04-14T16:00:49Z"
1224-
}
1225-
]
1226-
}
1214+
GIST_FORKS = [
1215+
{
1216+
"user" => USER,
1217+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
1218+
"id" => 1,
1219+
"created_at" => "2011-04-14T16:00:49Z",
1220+
"updated_at" => "2011-04-14T16:00:49Z"
1221+
}
1222+
]
12271223

12281224
GIST_FILE = {
12291225
"size" => 932,
@@ -1251,8 +1247,10 @@ def text_html(response, status, head = {})
12511247
"updated_at" => "2011-06-20T11:34:15Z"
12521248
}
12531249

1254-
FULL_GIST = GIST.merge(GIST_FORKS).merge(GIST_HISTORY)
1255-
FULL_GIST["files"] = GIST_FILE.merge({'content' => 'contents of gist'})
1250+
FULL_GIST.update \
1251+
:forks => GIST_FORKS,
1252+
:history => GIST_HISTORY,
1253+
:files => GIST_FILE.merge({'content' => 'contents of gist'})
12561254

12571255
GIST_COMMENT = {
12581256
"id" => 1,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy