mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Test Gist
This commit is contained in:
@@ -413,6 +413,18 @@
|
||||
"collections": [
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GistHistoryState",
|
||||
"attributes": [
|
||||
{ "name": "change_status", "type": "CommitStats" },
|
||||
{ "name": "committed_at", "type": "string" },
|
||||
{ "name": "url", "type": "string" },
|
||||
{ "name": "user", "type": "NamedUser" },
|
||||
{ "name": "version", "type": "string" }
|
||||
],
|
||||
"collections": [
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Gist",
|
||||
"isCompletable": true,
|
||||
@@ -424,19 +436,20 @@
|
||||
},
|
||||
"delete": true,
|
||||
"attributes": [
|
||||
{ "name": "comments", "type": "@todo" },
|
||||
{ "name": "created_at", "type": "@todo" },
|
||||
{ "name": "comments", "type": "integer" },
|
||||
{ "name": "created_at", "type": "string" },
|
||||
{ "name": "description", "type": "string" },
|
||||
{ "name": "files", "type": "@todo" },
|
||||
{ "name": "forks", "type": "@todo" },
|
||||
{ "name": "git_pull_url", "type": "@todo" },
|
||||
{ "name": "git_push_url", "type": "@todo" },
|
||||
{ "name": "history", "type": "@todo" },
|
||||
{ "name": "html_url", "type": "@todo" },
|
||||
{ "name": "id", "type": "integer" },
|
||||
{ "name": "public", "type": "@todo" },
|
||||
{ "name": "updated_at", "type": "@todo" },
|
||||
{ "name": "url", "type": "@todo" },
|
||||
{ "name": "fork_of", "type": "Gist" },
|
||||
{ "name": "forks", "type": "list:Gist" },
|
||||
{ "name": "git_pull_url", "type": "string" },
|
||||
{ "name": "git_push_url", "type": "string" },
|
||||
{ "name": "history", "type": "list:GistHistoryState" },
|
||||
{ "name": "html_url", "type": "string" },
|
||||
{ "name": "id", "type": "string" },
|
||||
{ "name": "public", "type": "bool" },
|
||||
{ "name": "updated_at", "type": "string" },
|
||||
{ "name": "url", "type": "string" },
|
||||
{ "name": "user", "type": "NamedUser" }
|
||||
],
|
||||
"collections": [
|
||||
@@ -516,7 +529,6 @@
|
||||
},
|
||||
{
|
||||
"name": "GistComment",
|
||||
"isCompletable": true,
|
||||
"edit": {
|
||||
"mandatoryParameters": [
|
||||
{ "name": "body", "type": "@todo" }
|
||||
|
||||
@@ -2448,7 +2448,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "integer"
|
||||
},
|
||||
"name": "comments"
|
||||
},
|
||||
@@ -2456,7 +2456,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "created_at"
|
||||
},
|
||||
@@ -2478,9 +2478,17 @@
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": true,
|
||||
"simple": false,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "Gist"
|
||||
},
|
||||
"name": "fork_of"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": false,
|
||||
"cardinality": "list",
|
||||
"name": "Gist"
|
||||
},
|
||||
"name": "forks"
|
||||
},
|
||||
@@ -2488,7 +2496,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "git_pull_url"
|
||||
},
|
||||
@@ -2496,15 +2504,15 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "git_push_url"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"simple": false,
|
||||
"cardinality": "list",
|
||||
"name": "GistHistoryState"
|
||||
},
|
||||
"name": "history"
|
||||
},
|
||||
@@ -2512,7 +2520,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "html_url"
|
||||
},
|
||||
@@ -2520,7 +2528,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "integer"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "id"
|
||||
},
|
||||
@@ -2528,7 +2536,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "bool"
|
||||
},
|
||||
"name": "public"
|
||||
},
|
||||
@@ -2536,7 +2544,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "updated_at"
|
||||
},
|
||||
@@ -2544,7 +2552,7 @@
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "@todo"
|
||||
"name": "string"
|
||||
},
|
||||
"name": "url"
|
||||
},
|
||||
@@ -2919,7 +2927,7 @@
|
||||
"name": "user"
|
||||
}
|
||||
],
|
||||
"isCompletable": true,
|
||||
"isCompletable": false,
|
||||
"name": "GistComment",
|
||||
"methods": [
|
||||
{
|
||||
@@ -2986,6 +2994,53 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"attributes": [
|
||||
{
|
||||
"type": {
|
||||
"simple": false,
|
||||
"cardinality": "scalar",
|
||||
"name": "CommitStats"
|
||||
},
|
||||
"name": "change_status"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "string"
|
||||
},
|
||||
"name": "committed_at"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "string"
|
||||
},
|
||||
"name": "url"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": false,
|
||||
"cardinality": "scalar",
|
||||
"name": "NamedUser"
|
||||
},
|
||||
"name": "user"
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"simple": true,
|
||||
"cardinality": "scalar",
|
||||
"name": "string"
|
||||
},
|
||||
"name": "version"
|
||||
}
|
||||
],
|
||||
"isCompletable": false,
|
||||
"name": "GistHistoryState",
|
||||
"methods": []
|
||||
},
|
||||
{
|
||||
"attributes": [
|
||||
{
|
||||
|
||||
+23
-11
@@ -309,19 +309,20 @@ Class `Gist`
|
||||
|
||||
Attributes
|
||||
----------
|
||||
* `comments`
|
||||
* `created_at`
|
||||
* `comments`: integer
|
||||
* `created_at`: string
|
||||
* `description`: string
|
||||
* `files`
|
||||
* `forks`
|
||||
* `git_pull_url`
|
||||
* `git_push_url`
|
||||
* `history`
|
||||
* `html_url`
|
||||
* `id`: integer
|
||||
* `public`
|
||||
* `updated_at`
|
||||
* `url`
|
||||
* `fork_of`: `Gist`
|
||||
* `forks`: list of `Gist`
|
||||
* `git_pull_url`: string
|
||||
* `git_push_url`: string
|
||||
* `history`: list of `GistHistoryState`
|
||||
* `html_url`: string
|
||||
* `id`: string
|
||||
* `public`: bool
|
||||
* `updated_at`: string
|
||||
* `url`: string
|
||||
* `user`: `NamedUser`
|
||||
|
||||
Comments
|
||||
@@ -373,6 +374,17 @@ Modification
|
||||
* `edit( body )`
|
||||
* `body`
|
||||
|
||||
Class `GistHistoryState`
|
||||
========================
|
||||
|
||||
Attributes
|
||||
----------
|
||||
* `change_status`: `CommitStats`
|
||||
* `committed_at`: string
|
||||
* `url`: string
|
||||
* `user`: `NamedUser`
|
||||
* `version`: string
|
||||
|
||||
Class `GitAuthor`
|
||||
=================
|
||||
|
||||
|
||||
+30
-4
@@ -3,6 +3,7 @@
|
||||
|
||||
import PaginatedList
|
||||
from GithubObject import *
|
||||
import GistHistoryState
|
||||
import NamedUser
|
||||
import Gist
|
||||
import GistComment
|
||||
@@ -36,6 +37,11 @@ class Gist( object ):
|
||||
self.__completeIfNeeded( self.__files )
|
||||
return self.__files
|
||||
|
||||
@property
|
||||
def fork_of( self ):
|
||||
self.__completeIfNeeded( self.__fork_of )
|
||||
return self.__fork_of
|
||||
|
||||
@property
|
||||
def forks( self ):
|
||||
self.__completeIfNeeded( self.__forks )
|
||||
@@ -183,6 +189,7 @@ class Gist( object ):
|
||||
self.__created_at = None
|
||||
self.__description = None
|
||||
self.__files = None
|
||||
self.__fork_of = None
|
||||
self.__forks = None
|
||||
self.__git_pull_url = None
|
||||
self.__git_push_url = None
|
||||
@@ -211,35 +218,54 @@ class Gist( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "comments", "created_at", "description", "files", "forks", "git_pull_url", "git_push_url", "history", "html_url", "id", "public", "updated_at", "url", "user", ], attribute
|
||||
assert attribute in [ "comments", "created_at", "description", "files", "fork_of", "forks", "git_pull_url", "git_push_url", "history", "html_url", "id", "public", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
assert isinstance( attributes[ "comments" ], int )
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
assert isinstance( attributes[ "description" ], ( str, unicode ) )
|
||||
self.__description = attributes[ "description" ]
|
||||
if "files" in attributes and attributes[ "files" ] is not None:
|
||||
self.__files = attributes[ "files" ]
|
||||
if "fork_of" in attributes and attributes[ "fork_of" ] is not None:
|
||||
assert isinstance( attributes[ "fork_of" ], dict )
|
||||
self.__fork_of = Gist( self.__requester, attributes[ "fork_of" ], completion = LazyCompletion )
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None:
|
||||
self.__forks = attributes[ "forks" ]
|
||||
assert isinstance( attributes[ "forks" ], list ) and ( len( attributes[ "forks" ] ) == 0 or isinstance( attributes[ "forks" ][ 0 ], dict ) )
|
||||
self.__forks = [
|
||||
Gist( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "forks" ]
|
||||
]
|
||||
if "git_pull_url" in attributes and attributes[ "git_pull_url" ] is not None:
|
||||
assert isinstance( attributes[ "git_pull_url" ], ( str, unicode ) )
|
||||
self.__git_pull_url = attributes[ "git_pull_url" ]
|
||||
if "git_push_url" in attributes and attributes[ "git_push_url" ] is not None:
|
||||
assert isinstance( attributes[ "git_push_url" ], ( str, unicode ) )
|
||||
self.__git_push_url = attributes[ "git_push_url" ]
|
||||
if "history" in attributes and attributes[ "history" ] is not None:
|
||||
self.__history = attributes[ "history" ]
|
||||
assert isinstance( attributes[ "history" ], list ) and ( len( attributes[ "history" ] ) == 0 or isinstance( attributes[ "history" ][ 0 ], dict ) )
|
||||
self.__history = [
|
||||
GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "history" ]
|
||||
]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
assert isinstance( attributes[ "id" ], ( str, unicode ) )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "public" in attributes and attributes[ "public" ] is not None:
|
||||
assert isinstance( attributes[ "public" ], bool )
|
||||
self.__public = attributes[ "public" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
assert isinstance( attributes[ "updated_at" ], ( str, unicode ) )
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
|
||||
@@ -10,38 +10,29 @@ class GistComment( object ):
|
||||
self.__requester = requester
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
self.__completed = completion != LazyCompletion
|
||||
if completion == ImmediateCompletion:
|
||||
self.__complete()
|
||||
|
||||
@property
|
||||
def body( self ):
|
||||
self.__completeIfNeeded( self.__body )
|
||||
return self.__body
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
self.__completeIfNeeded( self.__created_at )
|
||||
return self.__created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self.__completeIfNeeded( self.__id )
|
||||
return self.__id
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
self.__completeIfNeeded( self.__updated_at )
|
||||
return self.__updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self.__completeIfNeeded( self.__url )
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
self.__completeIfNeeded( self.__user )
|
||||
return self.__user
|
||||
|
||||
def delete( self ):
|
||||
@@ -72,20 +63,6 @@ class GistComment( object ):
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
|
||||
def __completeIfNeeded( self, testedAttribute ):
|
||||
if not self.__completed and testedAttribute is None:
|
||||
self.__complete()
|
||||
|
||||
def __complete( self ):
|
||||
status, headers, data = self.__requester.request(
|
||||
"GET",
|
||||
self.__url,
|
||||
None,
|
||||
None
|
||||
)
|
||||
self.__useAttributes( data )
|
||||
self.__completed = True
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# WARNING: this file is generated automaticaly.
|
||||
# Do not modify it manually, your work would be lost.
|
||||
|
||||
import PaginatedList
|
||||
from GithubObject import *
|
||||
import NamedUser
|
||||
import CommitStats
|
||||
|
||||
class GistHistoryState( object ):
|
||||
def __init__( self, requester, attributes, completion ):
|
||||
self.__requester = requester
|
||||
self.__initAttributes()
|
||||
self.__useAttributes( attributes )
|
||||
|
||||
@property
|
||||
def change_status( self ):
|
||||
return self.__change_status
|
||||
|
||||
@property
|
||||
def committed_at( self ):
|
||||
return self.__committed_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
return self.__url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
return self.__user
|
||||
|
||||
@property
|
||||
def version( self ):
|
||||
return self.__version
|
||||
|
||||
def __initAttributes( self ):
|
||||
self.__change_status = None
|
||||
self.__committed_at = None
|
||||
self.__url = None
|
||||
self.__user = None
|
||||
self.__version = None
|
||||
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "change_status", "committed_at", "url", "user", "version", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "change_status" in attributes and attributes[ "change_status" ] is not None:
|
||||
assert isinstance( attributes[ "change_status" ], dict )
|
||||
self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ "change_status" ], completion = LazyCompletion )
|
||||
if "committed_at" in attributes and attributes[ "committed_at" ] is not None:
|
||||
assert isinstance( attributes[ "committed_at" ], ( str, unicode ) )
|
||||
self.__committed_at = attributes[ "committed_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
if "version" in attributes and attributes[ "version" ] is not None:
|
||||
assert isinstance( attributes[ "version" ], ( str, unicode ) )
|
||||
self.__version = attributes[ "version" ]
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
import Framework
|
||||
|
||||
class Gist( Framework.TestCase ):
|
||||
def testGetAll( self ):
|
||||
ids = [ "2729695", "2729656", "2729597", "2729584", "2729569", "2729554", "2729543", "2729537", "2729536", "2729533", "2729525", "2729522", "2729519", "2729515", "2729506", "2729487", "2729484", "2729482", "2729441", "2729432", "2729420", "2729398", "2729372", "2729371", "2729351", "2729346", "2729316", "2729304", "2729296", "2729276", "2729272", "2729265", "2729195", "2729160", "2729143", "2729127", "2729119", "2729113", "2729103", "2729069", "2729059", "2729051", "2729029", "2729027", "2729026", "2729022", "2729002", "2728985", "2728979", "2728964", "2728937", "2728933", "2728884", "2728869", "2728866", "2728855", "2728854", "2728853", "2728846", "2728825", "2728814", "2728813", "2728812", "2728805", "2728802", "2728800", "2728798", "2728797", "2728796", "2728793", "2728758", "2728754", "2728751", "2728748", "2728721", "2728716", "2728715", "2728705", "2728701", "2728699", "2728697", "2728688", "2728683", "2728677", "2728649", "2728640", "2728625", "2728620", "2728615", "2728614", "2728565", "2728564", "2728554", "2728523", "2728519", "2728511", "2728497", "2728496", "2728495", "2728487" ]
|
||||
gists = self.g.get_gists()
|
||||
i = 0
|
||||
for gist in gists:
|
||||
self.assertEquals( gist.id, ids[ i ] )
|
||||
i += 1
|
||||
if i == 100:
|
||||
break
|
||||
|
||||
def testAttributes( self ):
|
||||
gist = self.g.get_gist( "1942384" )
|
||||
self.assertEquals( gist.comments, 0 )
|
||||
self.assertEquals( gist.created_at, "2012-02-29T16:47:12Z" )
|
||||
self.assertEquals( gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)" )
|
||||
self.assertEquals( gist.files, {u'fail_github.py': {u'raw_url': u'https://gist.github.com/raw/1942384/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py', u'language': u'Python', u'filename': u'fail_github.py', u'content': u'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n', u'type': u'application/python', u'size': 1636}} ) ### @todo
|
||||
self.assertEquals( gist.forks, [] )
|
||||
self.assertEquals( gist.git_pull_url, "git://gist.github.com/1942384.git" )
|
||||
self.assertEquals( gist.git_push_url, "git@gist.github.com:1942384.git" )
|
||||
self.assertEquals( len( gist.history ), 1 )
|
||||
self.assertEquals( gist.history[ 0 ].change_status.additions, 52 )
|
||||
self.assertEquals( gist.history[ 0 ].change_status.deletions, 0 )
|
||||
self.assertEquals( gist.history[ 0 ].change_status.total, 52 )
|
||||
self.assertEquals( gist.history[ 0 ].committed_at, "2012-02-29T16:47:12Z" )
|
||||
self.assertEquals( gist.history[ 0 ].url, "https://api.github.com/gists/1942384/a40de483e42ba33bda308371c0ef8383db73be9e" )
|
||||
self.assertEquals( gist.history[ 0 ].user.login, "jacquev6" )
|
||||
self.assertEquals( gist.history[ 0 ].version, "a40de483e42ba33bda308371c0ef8383db73be9e" )
|
||||
self.assertEquals( gist.html_url, "https://gist.github.com/1942384" )
|
||||
self.assertEquals( gist.id, "1942384" )
|
||||
self.assertEquals( gist.public, True )
|
||||
self.assertEquals( gist.updated_at, "2012-02-29T16:47:12Z" )
|
||||
self.assertEquals( gist.url, "https://api.github.com/gists/1942384" )
|
||||
self.assertEquals( gist.user.login, "jacquev6" )
|
||||
|
||||
def testCreate( self ):
|
||||
gist = self.g.get_user().create_gist( True, { "foobar.txt": { "content": "File created by PyGithub" } }, "Gist created by PyGithub" )
|
||||
self.assertEquals( gist.description, "Gist created by PyGithub" )
|
||||
self.assertEquals( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}} ) ### @todo
|
||||
|
||||
def testEditWithoutParameters( self ):
|
||||
gist = self.g.get_gist( "2729810" )
|
||||
gist.edit()
|
||||
self.assertEquals( gist.description, "Gist created by PyGithub" )
|
||||
self.assertEquals( gist.updated_at, "2012-05-19T07:00:58Z" )
|
||||
|
||||
def testEditWithAllParameters( self ):
|
||||
gist = self.g.get_gist( "2729810" )
|
||||
gist.edit( "Description edited by PyGithub", { "barbaz.txt": { "content": "File also created by PyGithub" } } )
|
||||
self.assertEquals( gist.description, "Description edited by PyGithub" )
|
||||
self.assertEquals( gist.updated_at, "2012-05-19T07:06:10Z" )
|
||||
self.assertEquals( gist.files, {u'foobar.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt', u'language': u'Text', u'filename': u'foobar.txt', u'content': u'File created by PyGithub', u'type': u'text/plain', u'size': 24}, u'barbaz.txt': {u'raw_url': u'https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt', u'language': u'Text', u'filename': u'barbaz.txt', u'content': u'File also created by PyGithub', u'type': u'text/plain', u'size': 29}} ) # Notice that the file is added, not replacing ### @todo
|
||||
|
||||
def testCreateComment( self ):
|
||||
gist = self.g.get_gist( "2729810" )
|
||||
comment = gist.create_comment( "Comment created by PyGithub" )
|
||||
self.assertEquals( comment.id, 323629 )
|
||||
|
||||
def testCommentAttributes( self ):
|
||||
comment = self.g.get_gist( "2729810" ).get_comment( 323629 )
|
||||
self.assertEquals( comment.body, "Comment created by PyGithub" )
|
||||
self.assertEquals( comment.created_at, "2012-05-19T07:07:57Z" )
|
||||
self.assertEquals( comment.id, 323629 )
|
||||
self.assertEquals( comment.updated_at, "2012-05-19T07:07:57Z" )
|
||||
self.assertEquals( comment.url, "https://api.github.com/gists/comments/323629" )
|
||||
self.assertEquals( comment.user.login, "jacquev6" )
|
||||
|
||||
def testEditComment( self ):
|
||||
comment = self.g.get_gist( "2729810" ).get_comment( 323629 )
|
||||
comment.edit( "Comment edited by PyGithub" )
|
||||
self.assertEquals( comment.body, "Comment edited by PyGithub" )
|
||||
self.assertEquals( comment.updated_at, "2012-05-19T07:12:32Z" )
|
||||
|
||||
def testDeleteComment( self ):
|
||||
comment = self.g.get_gist( "2729810" ).get_comment( 323629 )
|
||||
comment.delete()
|
||||
|
||||
def testGetComments( self ):
|
||||
gist = self.g.get_gist( "2729810" )
|
||||
for comment in gist.get_comments(): # There is only one comment
|
||||
self.assertEquals( comment.id, 323637 )
|
||||
|
||||
def testStarring( self ):
|
||||
gist = self.g.get_gist( "2729810" )
|
||||
self.assertFalse( gist.is_starred() )
|
||||
gist.set_starred()
|
||||
self.assertTrue( gist.is_starred() )
|
||||
gist.reset_starred()
|
||||
self.assertFalse( gist.is_starred() )
|
||||
|
||||
def testFork( self ):
|
||||
gist = self.g.get_gist( "2729818" ) # Random gist
|
||||
myGist = gist.create_fork()
|
||||
self.assertEquals( myGist.id, "2729865" )
|
||||
self.assertEquals( myGist.fork_of, None ) # WTF
|
||||
sameGist = self.g.get_gist( "2729865" )
|
||||
self.assertEquals( sameGist.fork_of.id, "2729818" )
|
||||
|
||||
def testDelete( self ):
|
||||
gist = self.g.get_gist( "2729865" )
|
||||
gist.delete()
|
||||
@@ -9,5 +9,6 @@ from Organization import *
|
||||
from MilestonesAndIssues import *
|
||||
from NamedUser import *
|
||||
from Hook import *
|
||||
from Gist import *
|
||||
|
||||
Framework.main()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
GET /gists/1942384 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '3280'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b01fb6ac81527f99db9f6f586b048ee3"'), ('date', 'Sat, 19 May 2012 06:58:15 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-02-29T16:47:12Z","forks":[],"url":"https://api.github.com/gists/1942384","comments":0,"public":true,"git_pull_url":"git://gist.github.com/1942384.git","files":{"fail_github.py":{"type":"application/python","raw_url":"https://gist.github.com/raw/1942384/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","size":1636,"filename":"fail_github.py","content":"import httplib\nimport base64\nimport json\n\nlogin = \"\"\npassword = \"\"\norgName = \"\"\nrepoName = \"FailGithubApi\"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( \"api.github.com\", strict = True )\n cnx.request( verb, url, input, { \"Authorization\" : \"Basic \" + base64.b64encode( login + \":\" + password ).replace( '\\n', '' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, \"=>\", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( \"POST\", \"/user/repos\", { \"name\": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( login, repoName ),\n { \"content\": \"Content of the blob\", \"encoding\": \"latin1\" }\n)\nt = doRequest(\n \"POST\", \"/repos/%s/%s/git/trees\" % ( login, repoName ),\n { \"tree\" : [ { \"path\": \"foo.bar\", \"type\": \"blob\", \"mode\": \"100644\", \"sha\": b[\"sha\"] } ] }\n)\nc = doRequest(\n \"POST\", \"/repos/%s/%s/git/commits\" % ( login, repoName ),\n { \"parents\": [], \"message\": \"Message of the commit\", \"tree\": t[\"sha\"] }\n)\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/refs\" % ( login, repoName ),\n { \"ref\": \"refs/heads/master\", \"sha\": c[\"sha\"] }\n)\n\n# Fork the repo\ndoRequest( \"POST\", \"/repos/%s/%s/forks?org=%s\" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( orgName, repoName ),\n { \"content\": \"Content of the new blob\", \"encoding\": \"latin1\" }\n)\n","language":"Python"}},"html_url":"https://gist.github.com/1942384","git_push_url":"git@gist.github.com:1942384.git","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","id":"1942384","history":[{"url":"https://api.github.com/gists/1942384/a40de483e42ba33bda308371c0ef8383db73be9e","change_status":{"deletions":0,"additions":52,"total":52},"committed_at":"2012-02-29T16:47:12Z","version":"a40de483e42ba33bda308371c0ef8383db73be9e","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}]}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b4e6600dfa740ccc7f7b9d5ee524cfef"'), ('date', 'Sat, 19 May 2012 07:09:41 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"git_pull_url":"git://gist.github.com/2729810.git","updated_at":"2012-05-19T07:06:10Z","forks":[],"git_push_url":"git@gist.github.com:2729810.git","url":"https://api.github.com/gists/2729810","comments":1,"public":true,"files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","version":"e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
||||
|
||||
GET /gists/comments/323629 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '479'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"71e33af16286b8d531f8d8175ed6a8d1"'), ('date', 'Sat, 19 May 2012 07:09:42 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:07:57Z","body":"Comment created by PyGithub","url":"https://api.github.com/gists/comments/323629","created_at":"2012-05-19T07:07:57Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"id":323629}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
POST /gists {} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub"}
|
||||
201
|
||||
[('status', '201 Created'), ('x-ratelimit-remaining', '4967'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4099af9b70c91fb9c1c8dc72bf773c33"'), ('date', 'Sat, 19 May 2012 07:00:58 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2729810')]
|
||||
{"updated_at":"2012-05-19T07:00:58Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","git_push_url":"git@gist.github.com:2729810.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}}]}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4993'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9e3b50f6c9ead4cffcdbe8edb198fdc7"'), ('date', 'Sat, 19 May 2012 07:07:57 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"git_pull_url":"git://gist.github.com/2729810.git","updated_at":"2012-05-19T07:06:10Z","forks":[],"git_push_url":"git@gist.github.com:2729810.git","url":"https://api.github.com/gists/2729810","comments":0,"public":true,"files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","version":"e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
||||
|
||||
POST /gists/2729810/comments {} {"body": "Comment created by PyGithub"}
|
||||
201
|
||||
[('status', '201 Created'), ('x-ratelimit-remaining', '4992'), ('content-length', '479'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"77456eabf6ebaafc2808cfbd4dfa5904"'), ('date', 'Sat, 19 May 2012 07:07:57 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/comments/323629')]
|
||||
{"updated_at":"2012-05-19T07:07:57Z","body":"Comment created by PyGithub","url":"https://api.github.com/gists/comments/323629","created_at":"2012-05-19T07:07:57Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"id":323629}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729865 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4966'), ('content-length', '3460'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e829012f18db493a69740de762186eb5"'), ('date', 'Sat, 19 May 2012 07:26:54 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","comments":0,"updated_at":"2012-05-19T07:25:30Z","public":true,"git_pull_url":"git://gist.github.com/2729865.git","history":[{"user":{"url":"https://api.github.com/users/Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","id":625489},"change_status":{"total":57,"deletions":0,"additions":57},"committed_at":"2012-05-19T07:06:08Z","version":"a655d19a12233e5e5615deb714eae95c433eed57","url":"https://api.github.com/gists/2729865/a655d19a12233e5e5615deb714eae95c433eed57"}],"git_push_url":"git@gist.github.com:2729865.git","url":"https://api.github.com/gists/2729865","fork_of":{"user":{"url":"https://api.github.com/users/Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","id":625489},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","comments":0,"updated_at":"2012-05-19T07:06:08Z","public":true,"git_pull_url":"git://gist.github.com/2729818.git","git_push_url":"git@gist.github.com:2729818.git","url":"https://api.github.com/gists/2729818","html_url":"https://gist.github.com/2729818","id":"2729818","created_at":"2012-05-19T07:06:08Z","files":{"ror.markdown":{"type":"text/plain","size":1076,"filename":"ror.markdown","raw_url":"https://gist.github.com/raw/2729818/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","language":"Markdown"}}},"html_url":"https://gist.github.com/2729865","id":"2729865","forks":[],"created_at":"2012-05-19T07:25:30Z","files":{"ror.markdown":{"content":"## create user\n\nsudo useradd -m username\nvisudo\n\n## delete default user\n\nsudo userdel ubuntu\nsudo rm -Rf ubuntu\n\n## setup ssh\n\nmkdir ~/.ssh\nvi /etc/ssh/authorized_keys\nsudo vi /etc/ssh/sshd_config\n\n\n## install packages\n\nsudo apt-get update\n\nsudo apt-get install sysv-rc-init git-core apache2-utils wget vim\nsudo apt-get install mysql-client mysql-server libmysqld-dev\nsudo apt-get install g++ openssl zlib1g readline-common libyaml-dev libssl-dev zlib1g-dev libxml2-dev libxslt1-dev libjson0-dev libgcc1 libreadline-dev\n\n\n## install nginx\n\nwget http://nginx.org/keys/nginx_signing.key\nsudo apt-key add nginx_signing.key\n\n### add /etc/sources.list\n> \"deb http://nginx.org/packages/ubuntu/ lucid nginx\ndeb-src http://nginx.org/packages/ubuntu/ lucid nginx\"\n\napt-get update\napt-get install nginx\n\n\n## setup system\n\nsudo sysv-rc-init\n\n\n## install ruby\n\ncd /usr/local/src\nsudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz\nsudo tar zxvf ruby-1.9.3-p194.tar.gz\ncd ruby-1.9.3-p194\nsudo ./configure\nsudo make && make install\n\n\n## install RoR\n\nsudo gem install rails","type":"text/plain","size":1076,"filename":"ror.markdown","raw_url":"https://gist.github.com/raw/2729865/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","language":"Markdown"}}}
|
||||
|
||||
DELETE /gists/2729865 {} null
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4965'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:26:55 GMT')]
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a636b99e979073297d6ca94ce1a8d1ce"'), ('date', 'Sat, 19 May 2012 07:14:32 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Description edited by PyGithub","comments":1,"updated_at":"2012-05-19T07:06:10Z","public":true,"git_pull_url":"git://gist.github.com/2729810.git","history":[{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"change_status":{"total":0,"deletions":0,"additions":0},"committed_at":"2012-05-19T07:06:10Z","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472"},{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"change_status":{"total":1,"deletions":0,"additions":1},"committed_at":"2012-05-19T07:04:31Z","version":"e730170a9599696a9d776f8bb5028b35f937b6de","url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de"},{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"change_status":{"total":1,"deletions":0,"additions":1},"committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c"}],"git_push_url":"git@gist.github.com:2729810.git","url":"https://api.github.com/gists/2729810","html_url":"https://gist.github.com/2729810","id":"2729810","forks":[],"created_at":"2012-05-19T07:00:58Z","files":{"barbaz.txt":{"content":"File also created by PyGithub","type":"text/plain","size":29,"filename":"barbaz.txt","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","language":"Text"},"foobar.txt":{"content":"File created by PyGithub","type":"text/plain","size":24,"filename":"foobar.txt","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","language":"Text"}}}
|
||||
|
||||
GET /gists/comments/323629 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '478'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"32df971f7c0bdddde4a69a2a56144729"'), ('date', 'Sat, 19 May 2012 07:14:33 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:12:32Z","body":"Comment edited by PyGithub","url":"https://api.github.com/gists/comments/323629","created_at":"2012-05-19T07:07:57Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"id":323629}
|
||||
|
||||
DELETE /gists/comments/323629 {} null
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4984'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:14:33 GMT')]
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"81f7a620c437614be12eae5458bb7cfc"'), ('date', 'Sat, 19 May 2012 07:12:30 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:06:10Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":1,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","version":"e730170a9599696a9d776f8bb5028b35f937b6de","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
||||
|
||||
GET /gists/comments/323629 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('content-length', '479'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4988'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"c2581153865c9b18a576589587e1fb98"'), ('date', 'Sat, 19 May 2012 07:12:31 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"url":"https://api.github.com/gists/comments/323629","body":"Comment created by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:07:57Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}}
|
||||
|
||||
PATCH /gists/comments/323629 {} {"body": "Comment edited by PyGithub"}
|
||||
200
|
||||
[('status', '200 OK'), ('content-length', '478'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4987'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"cea8090368993f1fb95c32cdcf4245d3"'), ('date', 'Sat, 19 May 2012 07:12:32 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"url":"https://api.github.com/gists/comments/323629","body":"Comment edited by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:12:32Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '2220'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c27a9e46dabeeafd7f009cc95ed995ad"'), ('date', 'Sat, 19 May 2012 07:06:09 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"git_push_url":"git@gist.github.com:2729810.git","updated_at":"2012-05-19T07:04:31Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGitHub","created_at":"2012-05-19T07:00:58Z","git_pull_url":"git://gist.github.com/2729810.git","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","version":"e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
||||
|
||||
PATCH /gists/2729810 {} {"files": {"barbaz.txt": {"content": "File also created by PyGithub"}}, "description": "Description edited by PyGithub"}
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"14d4466c0580c6f8e9be17f81eb1c3b0"'), ('date', 'Sat, 19 May 2012 07:06:10 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:06:10Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","version":"e730170a9599696a9d776f8bb5028b35f937b6de","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4999'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9d90688efdf43c600be9c6c068f007dd"'), ('date', 'Sat, 19 May 2012 07:03:54 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:00:58Z","git_push_url":"git@gist.github.com:2729810.git","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}],"git_pull_url":"git://gist.github.com/2729810.git"}
|
||||
|
||||
PATCH /gists/2729810 {} {}
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9d90688efdf43c600be9c6c068f007dd"'), ('date', 'Sat, 19 May 2012 07:03:55 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:00:58Z","git_push_url":"git@gist.github.com:2729810.git","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}],"git_pull_url":"git://gist.github.com/2729810.git"}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
GET /gists/2729818 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2576'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"fda4eb92e9b9a245bccf9efd47857766"'), ('date', 'Sat, 19 May 2012 07:25:30 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"git_push_url":"git@gist.github.com:2729818.git","updated_at":"2012-05-19T07:06:08Z","forks":[],"url":"https://api.github.com/gists/2729818","comments":0,"public":true,"files":{"ror.markdown":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729818/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","size":1076,"filename":"ror.markdown","content":"## create user\n\nsudo useradd -m username\nvisudo\n\n## delete default user\n\nsudo userdel ubuntu\nsudo rm -Rf ubuntu\n\n## setup ssh\n\nmkdir ~/.ssh\nvi /etc/ssh/authorized_keys\nsudo vi /etc/ssh/sshd_config\n\n\n## install packages\n\nsudo apt-get update\n\nsudo apt-get install sysv-rc-init git-core apache2-utils wget vim\nsudo apt-get install mysql-client mysql-server libmysqld-dev\nsudo apt-get install g++ openssl zlib1g readline-common libyaml-dev libssl-dev zlib1g-dev libxml2-dev libxslt1-dev libjson0-dev libgcc1 libreadline-dev\n\n\n## install nginx\n\nwget http://nginx.org/keys/nginx_signing.key\nsudo apt-key add nginx_signing.key\n\n### add /etc/sources.list\n> \"deb http://nginx.org/packages/ubuntu/ lucid nginx\ndeb-src http://nginx.org/packages/ubuntu/ lucid nginx\"\n\napt-get update\napt-get install nginx\n\n\n## setup system\n\nsudo sysv-rc-init\n\n\n## install ruby\n\ncd /usr/local/src\nsudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz\nsudo tar zxvf ruby-1.9.3-p194.tar.gz\ncd ruby-1.9.3-p194\nsudo ./configure\nsudo make && make install\n\n\n## install RoR\n\nsudo gem install rails","language":"Markdown"}},"html_url":"https://gist.github.com/2729818","user":{"url":"https://api.github.com/users/Kechol","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":625489},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","created_at":"2012-05-19T07:06:08Z","git_pull_url":"git://gist.github.com/2729818.git","id":"2729818","history":[{"url":"https://api.github.com/gists/2729818/a655d19a12233e5e5615deb714eae95c433eed57","version":"a655d19a12233e5e5615deb714eae95c433eed57","change_status":{"deletions":0,"additions":57,"total":57},"committed_at":"2012-05-19T07:06:08Z","user":{"url":"https://api.github.com/users/Kechol","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":625489}}]}
|
||||
|
||||
POST /gists/2729818/fork {} null
|
||||
201
|
||||
[('status', '201 Created'), ('x-ratelimit-remaining', '4969'), ('content-length', '873'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"502531cd2afdff81b572c8565b17f601"'), ('date', 'Sat, 19 May 2012 07:25:30 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2729865')]
|
||||
{"updated_at":"2012-05-19T07:25:30Z","url":"https://api.github.com/gists/2729865","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729865.git","files":{"ror.markdown":{"raw_url":"https://gist.github.com/raw/2729865/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","type":"text/plain","size":1076,"filename":"ror.markdown","language":"Markdown"}},"html_url":"https://gist.github.com/2729865","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","created_at":"2012-05-19T07:25:30Z","git_push_url":"git@gist.github.com:2729865.git","id":"2729865"}
|
||||
|
||||
GET /gists/2729865 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4966'), ('content-length', '3460'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e829012f18db493a69740de762186eb5"'), ('date', 'Sat, 19 May 2012 07:26:54 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","comments":0,"updated_at":"2012-05-19T07:25:30Z","public":true,"git_pull_url":"git://gist.github.com/2729865.git","history":[{"user":{"url":"https://api.github.com/users/Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","id":625489},"change_status":{"total":57,"deletions":0,"additions":57},"committed_at":"2012-05-19T07:06:08Z","version":"a655d19a12233e5e5615deb714eae95c433eed57","url":"https://api.github.com/gists/2729865/a655d19a12233e5e5615deb714eae95c433eed57"}],"git_push_url":"git@gist.github.com:2729865.git","url":"https://api.github.com/gists/2729865","fork_of":{"user":{"url":"https://api.github.com/users/Kechol","avatar_url":"https://secure.gravatar.com/avatar/f2a6400b393749ccd9ad3f24d4995f77?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f2a6400b393749ccd9ad3f24d4995f77","login":"Kechol","id":625489},"description":"RoR setup in AWS EC2(Ubuntu 12.04 LTS)","comments":0,"updated_at":"2012-05-19T07:06:08Z","public":true,"git_pull_url":"git://gist.github.com/2729818.git","git_push_url":"git@gist.github.com:2729818.git","url":"https://api.github.com/gists/2729818","html_url":"https://gist.github.com/2729818","id":"2729818","created_at":"2012-05-19T07:06:08Z","files":{"ror.markdown":{"type":"text/plain","size":1076,"filename":"ror.markdown","raw_url":"https://gist.github.com/raw/2729818/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","language":"Markdown"}}},"html_url":"https://gist.github.com/2729865","id":"2729865","forks":[],"created_at":"2012-05-19T07:25:30Z","files":{"ror.markdown":{"content":"## create user\n\nsudo useradd -m username\nvisudo\n\n## delete default user\n\nsudo userdel ubuntu\nsudo rm -Rf ubuntu\n\n## setup ssh\n\nmkdir ~/.ssh\nvi /etc/ssh/authorized_keys\nsudo vi /etc/ssh/sshd_config\n\n\n## install packages\n\nsudo apt-get update\n\nsudo apt-get install sysv-rc-init git-core apache2-utils wget vim\nsudo apt-get install mysql-client mysql-server libmysqld-dev\nsudo apt-get install g++ openssl zlib1g readline-common libyaml-dev libssl-dev zlib1g-dev libxml2-dev libxslt1-dev libjson0-dev libgcc1 libreadline-dev\n\n\n## install nginx\n\nwget http://nginx.org/keys/nginx_signing.key\nsudo apt-key add nginx_signing.key\n\n### add /etc/sources.list\n> \"deb http://nginx.org/packages/ubuntu/ lucid nginx\ndeb-src http://nginx.org/packages/ubuntu/ lucid nginx\"\n\napt-get update\napt-get install nginx\n\n\n## setup system\n\nsudo sysv-rc-init\n\n\n## install ruby\n\ncd /usr/local/src\nsudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz\nsudo tar zxvf ruby-1.9.3-p194.tar.gz\ncd ruby-1.9.3-p194\nsudo ./configure\nsudo make && make install\n\n\n## install RoR\n\nsudo gem install rails","type":"text/plain","size":1076,"filename":"ror.markdown","raw_url":"https://gist.github.com/raw/2729865/1284e70f4c16550ef32a26aa4f5f0c78edaa7008/ror.markdown","language":"Markdown"}}}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('content-length', '2759'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4981'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"de29b22b323aa9d2a9a8befbac2342e3"'), ('date', 'Sat, 19 May 2012 07:20:32 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"git_pull_url":"git://gist.github.com/2729810.git","url":"https://api.github.com/gists/2729810","git_push_url":"git@gist.github.com:2729810.git","created_at":"2012-05-19T07:00:58Z","public":true,"history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"total":0,"deletions":0,"additions":0},"committed_at":"2012-05-19T07:06:10Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","version":"e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"total":1,"deletions":0,"additions":1},"committed_at":"2012-05-19T07:04:31Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"total":1,"deletions":0,"additions":1},"committed_at":"2012-05-19T07:00:58Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}}],"files":{"foobar.txt":{"type":"text/plain","filename":"foobar.txt","content":"File created by PyGithub","size":24,"raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","language":"Text"},"barbaz.txt":{"type":"text/plain","filename":"barbaz.txt","content":"File also created by PyGithub","size":29,"raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","language":"Text"}},"forks":[],"comments":1,"description":"Description edited by PyGithub","updated_at":"2012-05-19T07:06:10Z","html_url":"https://gist.github.com/2729810","id":"2729810","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}}
|
||||
|
||||
GET /gists/2729810/comments {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4980'), ('content-length', '473'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ed0bedf32cc0d6f8dfe93e85ffa951cc"'), ('date', 'Sat, 19 May 2012 07:20:33 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
[{"updated_at":"2012-05-19T07:19:02Z","body":"Some random comment","url":"https://api.github.com/gists/comments/323637","created_at":"2012-05-19T07:19:02Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"id":323637}]
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
GET /gists/2729810 {} null
|
||||
200
|
||||
[('status', '200 OK'), ('x-ratelimit-remaining', '4976'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4f8e6261b538d0fc14d571775f76d923"'), ('date', 'Sat, 19 May 2012 07:22:28 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{"updated_at":"2012-05-19T07:06:10Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":1,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"barbaz.txt":{"raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","type":"text/plain","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","type":"text/plain","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","git_push_url":"git@gist.github.com:2729810.git","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","committed_at":"2012-05-19T07:06:10Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"version":"e730170a9599696a9d776f8bb5028b35f937b6de","committed_at":"2012-05-19T07:04:31Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","committed_at":"2012-05-19T07:00:58Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}}]}
|
||||
|
||||
GET /gists/2729810/star {} null
|
||||
404
|
||||
[('status', '404 Not Found'), ('x-ratelimit-remaining', '4975'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"99914b932bd37a50b983c5e7c90ae93b"'), ('date', 'Sat, 19 May 2012 07:22:29 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{}
|
||||
|
||||
PUT /gists/2729810/star {} null
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4974'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:22:29 GMT')]
|
||||
|
||||
|
||||
GET /gists/2729810/star {} null
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4973'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:22:30 GMT')]
|
||||
|
||||
|
||||
DELETE /gists/2729810/star {} null
|
||||
204
|
||||
[('status', '204 No Content'), ('x-ratelimit-remaining', '4972'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:22:30 GMT')]
|
||||
|
||||
|
||||
GET /gists/2729810/star {} null
|
||||
404
|
||||
[('status', '404 Not Found'), ('x-ratelimit-remaining', '4971'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"99914b932bd37a50b983c5e7c90ae93b"'), ('date', 'Sat, 19 May 2012 07:22:31 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user