Skip to content

Commit 66813dc

Browse files
author
Peter Williams
committed
Update examples to show new style gist comment uris
1 parent 76924ab commit 66813dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/resources.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'yajl/json_gem'
33
require 'stringio'
44
require 'cgi'
5+
require 'securerandom'
56

67
module GitHub
78
module Resources
@@ -677,7 +678,7 @@ def text_html(response, status, head = {})
677678
GIST_HISTORY = {
678679
"history" => [
679680
{
680-
"url" => "https://api.github.com/gists/1/57a7f021a713b1c5a6a199b54cc514735d2d462f",
681+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
681682
"version" => "57a7f021a713b1c5a6a199b54cc514735d2d462f",
682683
"user" => USER,
683684
"change_status" => {
@@ -690,11 +691,12 @@ def text_html(response, status, head = {})
690691
]
691692
}
692693

694+
693695
GIST_FORKS = {
694696
"forks" => [
695697
{
696698
"user" => USER,
697-
"url" => "https://api.github.com/gists/5",
699+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
698700
"created_at" => "2011-04-14T16:00:49Z"
699701
}
700702
]
@@ -707,7 +709,7 @@ def text_html(response, status, head = {})
707709
}
708710

709711
GIST = {
710-
"url" => "https://api.github.com/gists/1",
712+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}",
711713
"id" => "1",
712714
"description" => "description of gist",
713715
"public" => true,
@@ -725,7 +727,7 @@ def text_html(response, status, head = {})
725727

726728
GIST_COMMENT = {
727729
"id" => 1,
728-
"url" => "https://api.github.com/gists/comments/1",
730+
"url" => "https://api.github.com/gists/#{SecureRandom.hex(10)}/comments/1",
729731
"body" => "Just commenting for the sake of commenting",
730732
"user" => USER,
731733
"created_at" => "2011-04-18T23:23:56Z"

0 commit comments

Comments
 (0)