From 41d28a5bbb3bc6744e758f0e0ea5421c987ae973 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 18 Mar 2014 14:59:48 +0000 Subject: [PATCH] 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. --- lib/resources.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/resources.rb b/lib/resources.rb index d30e12e70e..9c24fd7eb3 100644 --- a/lib/resources.rb +++ b/lib/resources.rb @@ -1226,11 +1226,12 @@ def text_html(response, status, head = {}) } GIST_FILE = { - "size" => 932, - "filename" => "ring.erl", - "raw_url" => "https://gist.githubusercontent.com/raw/365370/8c4d2d43d178df44f4c03a7f2ac0ff512853564e/ring.erl", - "type" => "text/plain", - "language" => "Erlang" + "ring.erl" => { + "size" => 932, + "raw_url" => "https://gist.githubusercontent.com/raw/365370/8c4d2d43d178df44f4c03a7f2ac0ff512853564e/ring.erl", + "type" => "text/plain", + "language" => "Erlang" + } } GIST = { @@ -1241,7 +1242,7 @@ def text_html(response, status, head = {}) "description" => "description of gist", "public" => true, "user" => USER, - "files" => { "ring.erl" => GIST_FILE }, + "files" => GIST_FILE, "comments" => 0, "comments_url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}/comments/", "html_url" => "https://gist.github.com/1", @@ -1252,7 +1253,7 @@ def text_html(response, status, head = {}) } FULL_GIST = GIST.merge(GIST_FORKS).merge(GIST_HISTORY) - FULL_GIST["files"] = GIST_FILE.merge({'content' => 'contents of gist'}) + FULL_GIST["files"] = {"ring.erl" => GIST_FILE["ring.erl"].merge({"content" => "contents of gist"})} GIST_COMMENT = { "id" => 1, 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