Synchronizing before testing installation in other image. FIXME: jsonRoot was deleted. Is not needed now, but it could be soon.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-07-06 21:28:17 +00:00
parent 8736889a63
commit 848f2ca765

View File

@ -38,12 +38,13 @@ FossilRepo >> capabilities [
{ #category : #querying }
FossilRepo >> checkinsFor: relativeFilePath [
"I get all histotical checkins information for a full file name, wich includes relative path
in the repository (i.e: 'Doc/Es/Tutoriales/tutorial.ston' or 'index.html's)"
(self jsonWikiDataFor: relativeFilePath) = self ifTrue: [
in the repository (i.e: 'Doc/Es/Tutoriales/tutorial.ston' or 'index.html')"
| payload |
payload := (self jsonDataFor: relativeFilePath) at: 'payload' ifAbsent: [
self inform:
'WARNING! Key not found, verify the file name you are looking in this repository'.
^ self ].
^ (((self jsonWikiDataFor: relativeFilePath) at: 'payload') at: 'checkins')
^ payload at: 'checkins'
]
{ #category : #wiki }
@ -58,23 +59,15 @@ FossilRepo >> fetchPage: pageName [
{ #category : #utility }
FossilRepo >> jsonDataFor: anUrlSegment [
^ ZnClient new
get: (self jsonRoot addPathSegment: anUrlSegment);
contents.
]
{ #category : #utility }
FossilRepo >> jsonRoot [
"I define the root of the JSON API for all repo querying and modifiying operations"
^ self remote addPathSegment: 'json'.
^ NeoJSONReader fromString: (self jsonStringFor: anUrlSegment)
]
{ #category : #querying }
FossilRepo >> jsonStringFor: aFileName [
| queryForJSONData |
queryForJSONData := self remote addPathSegments: #('json' 'finfo').
queryForJSONData queryAt: 'name' put: aFileName.
| baseUrl queryForJSONData |
baseUrl := self remote addPathSegments: #('json' 'finfo').
queryForJSONData := baseUrl queryAt: 'name' put: aFileName.
^ (ZnEasy get: queryForJSONData) contents.
]