Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit41d28a5

Browse files
committed
Update gist files hash to consistently key by filename
The responses returned by the API for Gists always includes a hashfor files that contains a hash for each file in the gist keyed by thefile's name, but this was only reflected in the example response forlisting gists. This commit updates the example responses for getting asingle gist, creating a gist, and editing a gist to correct the fileshash.
1 parent3eb05f4 commit41d28a5

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)

[8]ページ先頭

©2009-2025 Movatter.jp