Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 41d28a5

Browse files
committed
Update gist files hash to consistently key by filename
The responses returned by the API for Gists always includes a hash for files that contains a hash for each file in the gist keyed by the file's name, but this was only reflected in the example response for listing gists. This commit updates the example responses for getting a single gist, creating a gist, and editing a gist to correct the files hash.
1 parent 3eb05f4 commit 41d28a5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/resources.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,11 +1226,12 @@ def text_html(response, status, head = {})
12261226
}
12271227

12281228
GIST_FILE = {
1229-
"size" => 932,
1230-
"filename" => "ring.erl",
1231-
"raw_url" => "https://gist.githubusercontent.com/raw/365370/8c4d2d43d178df44f4c03a7f2ac0ff512853564e/ring.erl",
1232-
"type" => "text/plain",
1233-
"language" => "Erlang"
1229+
"ring.erl" => {
1230+
"size" => 932,
1231+
"raw_url" => "https://gist.githubusercontent.com/raw/365370/8c4d2d43d178df44f4c03a7f2ac0ff512853564e/ring.erl",
1232+
"type" => "text/plain",
1233+
"language" => "Erlang"
1234+
}
12341235
}
12351236

12361237
GIST = {
@@ -1241,7 +1242,7 @@ def text_html(response, status, head = {})
12411242
"description" => "description of gist",
12421243
"public" => true,
12431244
"user" => USER,
1244-
"files" => { "ring.erl" => GIST_FILE },
1245+
"files" => GIST_FILE,
12451246
"comments" => 0,
12461247
"comments_url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}/comments/",
12471248
"html_url" => "https://gist.github.com/1",
@@ -1252,7 +1253,7 @@ def text_html(response, status, head = {})
12521253
}
12531254

12541255
FULL_GIST = GIST.merge(GIST_FORKS).merge(GIST_HISTORY)
1255-
FULL_GIST["files"] = GIST_FILE.merge({'content' => 'contents of gist'})
1256+
FULL_GIST["files"] = {"ring.erl" => GIST_FILE["ring.erl"].merge({"content" => "contents of gist"})}
12561257

12571258
GIST_COMMENT = {
12581259
"id" => 1,

0 commit comments

Comments
 (0)