diff --git a/ReadMe.md b/ReadMe.md index 43916ad8..c223e20a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,18 +13,10 @@ What's new? [![Build Status](https://travis-ci.org/jacquev6/PyGithub.png?branch=master)](https://travis-ci.org/jacquev6/PyGithub) -[Version 1.11.1](https://github.com/jacquev6/PyGithub/issues?milestone=21&state=closed) (February 9th, 2013) (London edition) ------------------------------------------------------------------------------------------------------------------------------ +[Version 1.12.0](https://github.com/jacquev6/PyGithub/issues?milestone=22&state=closed) (February 17th, 2013) +------------------------------------------------------------------------------------------------------------- -* Fix [bug](https://github.com/jacquev6/PyGithub/issues/139#issuecomment-13280121) in lazy completion. Thank you [ianozsvald](https://github.com/ianozsvald) for pinpointing it - -[Version 1.11.0](https://github.com/jacquev6/PyGithub/issues?milestone=19&state=closed) (February 7th, 2013) ------------------------------------------------------------------------------------------------------------- - -* Fix bug in PaginatedList without url parameters. Thank you [llimllib](https://github.com/llimllib) for the [contribution](https://github.com/jacquev6/PyGithub/pull/133) -* [Implement](https://github.com/jacquev6/PyGithub/issues/130) `NamedUser.get_keys` -* [Support PubSubHub](https://github.com/jacquev6/PyGithub/issues/129): `Repository.subscribe_to_hub` and `Repository.unsubscribe_from_hub` -* [Publish the oauth scopes](https://github.com/jacquev6/PyGithub/issues/134) in Github.oauth_scopes, thank you [ bilderbuchi](https://github.com/ bilderbuchi) for asking +* [Implement](https://github.com/jacquev6/PyGithub/issues/140) `Repository.get_gir_contents`. Thank you [ksookocheff-va](https://github.com/ksookocheff-va) for asking Previous versions ----------------- diff --git a/doc/ReferenceOfApis.md b/doc/ReferenceOfApis.md index 24fa1306..aca35ecd 100644 --- a/doc/ReferenceOfApis.md +++ b/doc/ReferenceOfApis.md @@ -208,7 +208,7 @@ API `/repos/:user/:repo/compare/:base...:head` API `/repos/:user/:repo/contents/:path` ======================================= -* GET: `Repository.get_contents` +* GET: `Repository.get_contents` or `Repository.get_file_contents` or `Repository.get_dir_contents` API `/repos/:user/:repo/contributors` ===================================== diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 4546c633..903caf36 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -1243,7 +1243,10 @@ Contents -------- * `get_readme( [ref] )`: `ContentFile` * `ref`: string -* `get_contents( path, [ref] )`: `ContentFile` +* `get_file_contents( path, [ref] )` or `get_contents( path, [ref] )`: `ContentFile` + * `path`: string + * `ref`: string +* `get_dir_contents( path, [ref] )`: list of `ContentFile` * `path`: string * `ref`: string * `get_archive_link( archive_format, [ref] )`: string diff --git a/github/ContentFile.py b/github/ContentFile.py index 4f43188c..ba82a48a 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -16,35 +16,47 @@ import github.GithubObject -class ContentFile(github.GithubObject.BasicGithubObject): +class ContentFile(github.GithubObject.GithubObject): @property def content(self): + self._completeIfNotSet(self._content) return self._NoneIfNotSet(self._content) @property def encoding(self): + self._completeIfNotSet(self._encoding) return self._NoneIfNotSet(self._encoding) @property def name(self): + self._completeIfNotSet(self._name) return self._NoneIfNotSet(self._name) @property def path(self): + self._completeIfNotSet(self._path) return self._NoneIfNotSet(self._path) @property def sha(self): + self._completeIfNotSet(self._sha) return self._NoneIfNotSet(self._sha) @property def size(self): + self._completeIfNotSet(self._size) return self._NoneIfNotSet(self._size) @property def type(self): + self._completeIfNotSet(self._type) return self._NoneIfNotSet(self._type) + @property + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) + def _initAttributes(self): self._content = github.GithubObject.NotSet self._encoding = github.GithubObject.NotSet @@ -76,3 +88,6 @@ class ContentFile(github.GithubObject.BasicGithubObject): if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Repository.py b/github/Repository.py index 97523f1b..69380aa7 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -591,6 +591,9 @@ class Repository(github.GithubObject.GithubObject): ) def get_contents(self, path, ref=github.GithubObject.NotSet): + return self.get_file_contents(path, ref) + + def get_file_contents(self, path, ref=github.GithubObject.NotSet): assert isinstance(path, (str, unicode)), path assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url_parameters = dict() @@ -604,6 +607,23 @@ class Repository(github.GithubObject.GithubObject): ) return github.ContentFile.ContentFile(self._requester, data, completed=True) + def get_dir_contents(self, path, ref=github.GithubObject.NotSet): + assert isinstance(path, (str, unicode)), path + assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref + url_parameters = dict() + if ref is not github.GithubObject.NotSet: + url_parameters["ref"] = ref + headers, data = self._requester.requestJsonAndCheck( + "GET", + self.url + "/contents" + path, + url_parameters, + None + ) + return [ + github.ContentFile.ContentFile(self._requester, attributes, completed=attributes["type"]!="file") # Lazy completion only makes sense for files. See discussion here: https://github.com/jacquev6/PyGithub/issues/140#issuecomment-13481130 + for attributes in data + ] + def get_contributors(self): return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index 4691d080..6a603d12 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -64,3 +64,4 @@ from Issue131 import * from Issue133 import * from Issue134 import * from Issue139 import * +from Issue140 import * diff --git a/github/tests/Issue140.py b/github/tests/Issue140.py new file mode 100644 index 00000000..d207083a --- /dev/null +++ b/github/tests/Issue140.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/PyGithub + +# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . + +import Framework +import github + + +class Issue140(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/140 + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_repo("twitter/bootstrap") + + def testGetDirContentsThenLazyCompletionOfFile(self): + contents = self.repo.get_dir_contents("/js") + self.assertEqual(len(contents), 15) + n = 0 + for content in contents: + if content.path == "js/bootstrap-affix.js": + self.assertEqual(len(content.content), 4722) # Lazy completion + n += 1 + elif content.path == "js/tests": + self.assertEqual(content.content, None) # No completion at all + n += 1 + self.assertEqual(n, 2) + + def testGetFileContents(self): + contents = self.repo.get_file_contents("/js/bootstrap-affix.js") + self.assertEqual(contents.encoding, "base64") + self.assertEqual(len(contents.content), 4722) diff --git a/github/tests/ReplayData/Issue140.setUp.txt b/github/tests/ReplayData/Issue140.setUp.txt new file mode 100644 index 00000000..3b76f79b --- /dev/null +++ b/github/tests/ReplayData/Issue140.setUp.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /repos/twitter/bootstrap {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4977'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '5618'), ('server', 'GitHub.com'), ('last-modified', 'Sat, 16 Feb 2013 17:39:19 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1bae4e11b2e038d9086f79ccf6828879"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 16 Feb 2013 17:59:00 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"id":2126244,"name":"bootstrap","full_name":"twitter/bootstrap","owner":{"login":"twitter","id":50278,"avatar_url":"https://secure.gravatar.com/avatar/2f4a8254d032a8ec5e4c48d461e54fcc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png","gravatar_id":"2f4a8254d032a8ec5e4c48d461e54fcc","url":"https://api.github.com/users/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization"},"private":false,"html_url":"https://github.com/twitter/bootstrap","description":"Sleek, intuitive, and powerful front-end framework for faster and easier web development.","fork":false,"url":"https://api.github.com/repos/twitter/bootstrap","forks_url":"https://api.github.com/repos/twitter/bootstrap/forks","keys_url":"https://api.github.com/repos/twitter/bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/bootstrap/teams","hooks_url":"https://api.github.com/repos/twitter/bootstrap/hooks","issue_events_url":"https://api.github.com/repos/twitter/bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/bootstrap/events","assignees_url":"https://api.github.com/repos/twitter/bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/bootstrap/tags{/tag}","blobs_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/bootstrap/languages","stargazers_url":"https://api.github.com/repos/twitter/bootstrap/stargazers","contributors_url":"https://api.github.com/repos/twitter/bootstrap/contributors","subscribers_url":"https://api.github.com/repos/twitter/bootstrap/subscribers","subscription_url":"https://api.github.com/repos/twitter/bootstrap/subscription","commits_url":"https://api.github.com/repos/twitter/bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/bootstrap/issues/comments/{number}","contents_url":"https://api.github.com/repos/twitter/bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/bootstrap/merges","archive_url":"https://api.github.com/repos/twitter/bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/bootstrap/downloads","issues_url":"https://api.github.com/repos/twitter/bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/bootstrap/labels{/name}","created_at":"2011-07-29T21:19:00Z","updated_at":"2013-02-16T17:39:19Z","pushed_at":"2013-02-16T10:49:39Z","git_url":"git://github.com/twitter/bootstrap.git","ssh_url":"git@github.com:twitter/bootstrap.git","clone_url":"https://github.com/twitter/bootstrap.git","svn_url":"https://github.com/twitter/bootstrap","homepage":"http://twitter.github.com/bootstrap","size":2524,"watchers_count":44894,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":12535,"mirror_url":null,"open_issues_count":56,"forks":12535,"open_issues":56,"watchers":44894,"master_branch":"master","default_branch":"master","permissions":{"admin":false,"push":false,"pull":true},"network_count":12535,"organization":{"login":"twitter","id":50278,"avatar_url":"https://secure.gravatar.com/avatar/2f4a8254d032a8ec5e4c48d461e54fcc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png","gravatar_id":"2f4a8254d032a8ec5e4c48d461e54fcc","url":"https://api.github.com/users/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization"}} + diff --git a/github/tests/ReplayData/Issue140.testGetDirContents.txt b/github/tests/ReplayData/Issue140.testGetDirContents.txt new file mode 100644 index 00000000..5cc31edc --- /dev/null +++ b/github/tests/ReplayData/Issue140.testGetDirContents.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /repos/twitter/bootstrap/contents/js {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '10514'), ('server', 'GitHub.com'), ('last-modified', 'Sat, 16 Feb 2013 17:39:19 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1bae4e11b2e038d9086f79ccf6828879"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 16 Feb 2013 17:40:25 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"sha":"e0722690bd73b3195d87577aab3bba151a85f7e0","size":232,"name":".jshintrc","path":"js/.jshintrc","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/.jshintrc","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/e0722690bd73b3195d87577aab3bba151a85f7e0","html_url":"https://github.com/twitter/bootstrap/blob/master/js/.jshintrc","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/.jshintrc","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/e0722690bd73b3195d87577aab3bba151a85f7e0","html":"https://github.com/twitter/bootstrap/blob/master/js/.jshintrc"}},{"sha":"7595fdb06771c324e1c3e0a166fdeafa1933e0f5","size":3483,"name":"bootstrap-affix.js","path":"js/bootstrap-affix.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js"}},{"sha":"b5627984e4ca3b49ae63943aa9f0204c266c65af","size":2524,"name":"bootstrap-alert.js","path":"js/bootstrap-alert.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-alert.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5627984e4ca3b49ae63943aa9f0204c266c65af","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-alert.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5627984e4ca3b49ae63943aa9f0204c266c65af","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js"}},{"sha":"045927b6ba732ada14dbf5c0ec296623b37a5121","size":2841,"name":"bootstrap-button.js","path":"js/bootstrap-button.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-button.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/045927b6ba732ada14dbf5c0ec296623b37a5121","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-button.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-button.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/045927b6ba732ada14dbf5c0ec296623b37a5121","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-button.js"}},{"sha":"604552012b170bc20579c13d724883c253dd152a","size":6053,"name":"bootstrap-carousel.js","path":"js/bootstrap-carousel.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-carousel.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/604552012b170bc20579c13d724883c253dd152a","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-carousel.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/604552012b170bc20579c13d724883c253dd152a","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js"}},{"sha":"7bbad8e43aba9a778fa54650237f7acb96e783c9","size":4735,"name":"bootstrap-collapse.js","path":"js/bootstrap-collapse.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-collapse.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7bbad8e43aba9a778fa54650237f7acb96e783c9","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-collapse.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-collapse.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7bbad8e43aba9a778fa54650237f7acb96e783c9","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-collapse.js"}},{"sha":"ec86cf0d709577fc840a64123993dc69c6ae292a","size":4198,"name":"bootstrap-dropdown.js","path":"js/bootstrap-dropdown.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-dropdown.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/ec86cf0d709577fc840a64123993dc69c6ae292a","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-dropdown.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-dropdown.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/ec86cf0d709577fc840a64123993dc69c6ae292a","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-dropdown.js"}},{"sha":"b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","size":6638,"name":"bootstrap-modal.js","path":"js/bootstrap-modal.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-modal.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-modal.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js"}},{"sha":"0e7774bf668c75a7b93989a1146fbb8822d5489d","size":3115,"name":"bootstrap-popover.js","path":"js/bootstrap-popover.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-popover.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/0e7774bf668c75a7b93989a1146fbb8822d5489d","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-popover.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-popover.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/0e7774bf668c75a7b93989a1146fbb8822d5489d","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-popover.js"}},{"sha":"dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","size":4655,"name":"bootstrap-scrollspy.js","path":"js/bootstrap-scrollspy.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-scrollspy.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-scrollspy.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-scrollspy.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-scrollspy.js"}},{"sha":"bd77eb5c358074801f20de0f46b1e2e9d1b1247b","size":3496,"name":"bootstrap-tab.js","path":"js/bootstrap-tab.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tab.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/bd77eb5c358074801f20de0f46b1e2e9d1b1247b","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tab.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tab.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/bd77eb5c358074801f20de0f46b1e2e9d1b1247b","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tab.js"}},{"sha":"981319077e9bdb4ea0dcbee50dfe5715a54b4c51","size":9694,"name":"bootstrap-tooltip.js","path":"js/bootstrap-tooltip.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tooltip.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/981319077e9bdb4ea0dcbee50dfe5715a54b4c51","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tooltip.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/981319077e9bdb4ea0dcbee50dfe5715a54b4c51","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js"}},{"sha":"64f275778094043dc871f94ceacadbe7f74f9734","size":1756,"name":"bootstrap-transition.js","path":"js/bootstrap-transition.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-transition.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/64f275778094043dc871f94ceacadbe7f74f9734","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-transition.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-transition.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/64f275778094043dc871f94ceacadbe7f74f9734","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-transition.js"}},{"sha":"960f2af85a7ced44c4e3190255ee3092c3665bbb","size":8320,"name":"bootstrap-typeahead.js","path":"js/bootstrap-typeahead.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-typeahead.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/960f2af85a7ced44c4e3190255ee3092c3665bbb","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-typeahead.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/960f2af85a7ced44c4e3190255ee3092c3665bbb","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js"}},{"sha":"f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","size":0,"name":"tests","path":"js/tests","type":"dir","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/tests","git_url":"https://api.github.com/repos/twitter/bootstrap/git/trees/f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","html_url":"https://github.com/twitter/bootstrap/tree/master/js/tests","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/tests","git":"https://api.github.com/repos/twitter/bootstrap/git/trees/f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","html":"https://github.com/twitter/bootstrap/tree/master/js/tests"}}] + diff --git a/github/tests/ReplayData/Issue140.testGetDirContentsThenLazyCompletionOfFile.txt b/github/tests/ReplayData/Issue140.testGetDirContentsThenLazyCompletionOfFile.txt new file mode 100644 index 00000000..b94b938a --- /dev/null +++ b/github/tests/ReplayData/Issue140.testGetDirContentsThenLazyCompletionOfFile.txt @@ -0,0 +1,10 @@ +https GET api.github.com None /repos/twitter/bootstrap/contents/js {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4976'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '10514'), ('server', 'GitHub.com'), ('last-modified', 'Sat, 16 Feb 2013 17:39:19 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1bae4e11b2e038d9086f79ccf6828879"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 16 Feb 2013 17:59:08 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"sha":"e0722690bd73b3195d87577aab3bba151a85f7e0","size":232,"name":".jshintrc","path":"js/.jshintrc","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/.jshintrc","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/e0722690bd73b3195d87577aab3bba151a85f7e0","html_url":"https://github.com/twitter/bootstrap/blob/master/js/.jshintrc","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/.jshintrc","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/e0722690bd73b3195d87577aab3bba151a85f7e0","html":"https://github.com/twitter/bootstrap/blob/master/js/.jshintrc"}},{"sha":"7595fdb06771c324e1c3e0a166fdeafa1933e0f5","size":3483,"name":"bootstrap-affix.js","path":"js/bootstrap-affix.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js"}},{"sha":"b5627984e4ca3b49ae63943aa9f0204c266c65af","size":2524,"name":"bootstrap-alert.js","path":"js/bootstrap-alert.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-alert.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5627984e4ca3b49ae63943aa9f0204c266c65af","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-alert.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5627984e4ca3b49ae63943aa9f0204c266c65af","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js"}},{"sha":"045927b6ba732ada14dbf5c0ec296623b37a5121","size":2841,"name":"bootstrap-button.js","path":"js/bootstrap-button.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-button.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/045927b6ba732ada14dbf5c0ec296623b37a5121","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-button.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-button.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/045927b6ba732ada14dbf5c0ec296623b37a5121","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-button.js"}},{"sha":"604552012b170bc20579c13d724883c253dd152a","size":6053,"name":"bootstrap-carousel.js","path":"js/bootstrap-carousel.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-carousel.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/604552012b170bc20579c13d724883c253dd152a","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-carousel.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/604552012b170bc20579c13d724883c253dd152a","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js"}},{"sha":"7bbad8e43aba9a778fa54650237f7acb96e783c9","size":4735,"name":"bootstrap-collapse.js","path":"js/bootstrap-collapse.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-collapse.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7bbad8e43aba9a778fa54650237f7acb96e783c9","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-collapse.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-collapse.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7bbad8e43aba9a778fa54650237f7acb96e783c9","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-collapse.js"}},{"sha":"ec86cf0d709577fc840a64123993dc69c6ae292a","size":4198,"name":"bootstrap-dropdown.js","path":"js/bootstrap-dropdown.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-dropdown.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/ec86cf0d709577fc840a64123993dc69c6ae292a","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-dropdown.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-dropdown.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/ec86cf0d709577fc840a64123993dc69c6ae292a","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-dropdown.js"}},{"sha":"b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","size":6638,"name":"bootstrap-modal.js","path":"js/bootstrap-modal.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-modal.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-modal.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/b5ffa95b3b7639607a279d06b3e5e1c584acb5b4","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-modal.js"}},{"sha":"0e7774bf668c75a7b93989a1146fbb8822d5489d","size":3115,"name":"bootstrap-popover.js","path":"js/bootstrap-popover.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-popover.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/0e7774bf668c75a7b93989a1146fbb8822d5489d","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-popover.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-popover.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/0e7774bf668c75a7b93989a1146fbb8822d5489d","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-popover.js"}},{"sha":"dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","size":4655,"name":"bootstrap-scrollspy.js","path":"js/bootstrap-scrollspy.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-scrollspy.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-scrollspy.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-scrollspy.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/dff9a3b37518c2ccf6f0fbe23b327860cb6fee08","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-scrollspy.js"}},{"sha":"bd77eb5c358074801f20de0f46b1e2e9d1b1247b","size":3496,"name":"bootstrap-tab.js","path":"js/bootstrap-tab.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tab.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/bd77eb5c358074801f20de0f46b1e2e9d1b1247b","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tab.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tab.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/bd77eb5c358074801f20de0f46b1e2e9d1b1247b","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tab.js"}},{"sha":"981319077e9bdb4ea0dcbee50dfe5715a54b4c51","size":9694,"name":"bootstrap-tooltip.js","path":"js/bootstrap-tooltip.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tooltip.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/981319077e9bdb4ea0dcbee50dfe5715a54b4c51","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-tooltip.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/981319077e9bdb4ea0dcbee50dfe5715a54b4c51","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js"}},{"sha":"64f275778094043dc871f94ceacadbe7f74f9734","size":1756,"name":"bootstrap-transition.js","path":"js/bootstrap-transition.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-transition.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/64f275778094043dc871f94ceacadbe7f74f9734","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-transition.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-transition.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/64f275778094043dc871f94ceacadbe7f74f9734","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-transition.js"}},{"sha":"960f2af85a7ced44c4e3190255ee3092c3665bbb","size":8320,"name":"bootstrap-typeahead.js","path":"js/bootstrap-typeahead.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-typeahead.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/960f2af85a7ced44c4e3190255ee3092c3665bbb","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-typeahead.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/960f2af85a7ced44c4e3190255ee3092c3665bbb","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js"}},{"sha":"f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","size":0,"name":"tests","path":"js/tests","type":"dir","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/tests","git_url":"https://api.github.com/repos/twitter/bootstrap/git/trees/f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","html_url":"https://github.com/twitter/bootstrap/tree/master/js/tests","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/tests","git":"https://api.github.com/repos/twitter/bootstrap/git/trees/f1ad7515dc05d0e2bc60f7c292e4f2134dcd91cf","html":"https://github.com/twitter/bootstrap/tree/master/js/tests"}}] + +https GET api.github.com None /repos/twitter/bootstrap/contents/js/bootstrap-affix.js {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4975'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '5532'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 08 Feb 2013 06:13:13 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"23daa8e0f42915d5ce84a6a117122afa"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 16 Feb 2013 17:59:15 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"sha":"7595fdb06771c324e1c3e0a166fdeafa1933e0f5","size":3483,"name":"bootstrap-affix.js","path":"js/bootstrap-affix.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js"},"content":"LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09\nPT09PT09PT09PT09PT09PQogKiBib290c3RyYXAtYWZmaXguanMgdjIuMy4w\nCiAqIGh0dHA6Ly90d2l0dGVyLmdpdGh1Yi5jb20vYm9vdHN0cmFwL2phdmFz\nY3JpcHQuaHRtbCNhZmZpeAogKiA9PT09PT09PT09PT09PT09PT09PT09PT09\nPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqIENvcHlyaWdo\ndCAyMDEyIFR3aXR0ZXIsIEluYy4KICoKICogTGljZW5zZWQgdW5kZXIgdGhl\nIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7\nCiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBs\naWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KICogWW91IG1heSBvYnRhaW4gYSBj\nb3B5IG9mIHRoZSBMaWNlbnNlIGF0CiAqCiAqIGh0dHA6Ly93d3cuYXBhY2hl\nLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAogKgogKiBVbmxlc3MgcmVxdWly\nZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcs\nIHNvZnR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gb2Zmc2V0OiAwCiAgfQoKCiAvKiBBRkZJWCBOTyBDT05GTElD\nVAogICogPT09PT09PT09PT09PT09PT0gKi8KCiAgJC5mbi5hZmZpeC5ub0Nv\nbmZsaWN0ID0gZnVuY3Rpb24gKCkgewogICAgJC5mbi5hZmZpeCA9IG9sZAog\nICAgcmV0dXJuIHRoaXMKICB9CgoKIC8qIEFGRklYIERBVEEtQVBJCiAgKiA9\nPT09PT09PT09PT09PSAqLwoKICAkKHdpbmRvdykub24oJ2xvYWQnLCBmdW5j\ndGlvbiAoKSB7CiAgICAkKCdbZGF0YS1zcHk9ImFmZml4Il0nKS5lYWNoKGZ1\nbmN0aW9uICgpIHsKICAgICAgdmFyICRzcHkgPSAkKHRoaXMpCiAgICAgICAg\nLCBkYXRhID0gJHNweS5kYXRhKCkKCiAgICAgIGRhdGEub2Zmc2V0ID0gZGF0\nYS5vZmZzZXQgfHwge30KCiAgICAgIGRhdGEub2Zmc2V0Qm90dG9tICYmIChk\nYXRhLm9mZnNldC5ib3R0b20gPSBkYXRhLm9mZnNldEJvdHRvbSkKICAgICAg\nZGF0YS5vZmZzZXRUb3AgJiYgKGRhdGEub2Zmc2V0LnRvcCA9IGRhdGEub2Zm\nc2V0VG9wKQoKICAgICAgJHNweS5hZmZpeChkYXRhKQogICAgfSkKICB9KQoK\nCn0od2luZG93LmpRdWVyeSk7\n","encoding":"base64"} + diff --git a/github/tests/ReplayData/Issue140.testGetFileContents.txt b/github/tests/ReplayData/Issue140.testGetFileContents.txt new file mode 100644 index 00000000..0fdf3913 --- /dev/null +++ b/github/tests/ReplayData/Issue140.testGetFileContents.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /repos/twitter/bootstrap/contents/js/bootstrap-affix.js {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '5532'), ('server', 'GitHub.com'), ('last-modified', 'Fri, 08 Feb 2013 06:13:13 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"23daa8e0f42915d5ce84a6a117122afa"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sat, 16 Feb 2013 17:47:30 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"sha":"7595fdb06771c324e1c3e0a166fdeafa1933e0f5","size":3483,"name":"bootstrap-affix.js","path":"js/bootstrap-affix.js","type":"file","url":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git_url":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html_url":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js","_links":{"self":"https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js","git":"https://api.github.com/repos/twitter/bootstrap/git/blobs/7595fdb06771c324e1c3e0a166fdeafa1933e0f5","html":"https://github.com/twitter/bootstrap/blob/master/js/bootstrap-affix.js"},"content":"LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09\nPT09PT09PT09PT09PT09PQogKiBib290c3RyYXAtYWZmaXguanMgdjIuMy4w\nCiAqIGh0dHA6Ly90d2l0dGVyLmdpdGh1Yi5jb20vYm9vdHN0cmFwL2phdmFz\nY3JpcHQuaHRtbCNhZmZpeAogKiA9PT09PT09PT09PT09PT09PT09PT09PT09\nPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqIENvcHlyaWdo\ndCAyMDEyIFR3aXR0ZXIsIEluYy4KICoKICogTGljZW5zZWQgdW5kZXIgdGhl\nIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7\nCiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBs\naWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KICogWW91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