8000 Merge pull request #457 from wilkinsona/gist-files-hash · ejholmes/developer.github.com@3dc622d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3dc622d

Browse files
committed
Merge pull request github#457 from wilkinsona/gist-files-hash
Update gist files hash to consistently key by filename
2 parents 3eb05f4 + 41d28a5 commit 3dc622d

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)
0