Support for aproximating Grafoscopio notebook's creation timestamps from the commits in the Fossil repository where they're published.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-04-18 09:45:03 -05:00
parent 006b8c6663
commit 298601dbc5
2 changed files with 14 additions and 5 deletions

View File

@ -19,7 +19,7 @@ BaselineOfMiniDocs >> baseline: spec [
loads: #('Minimal' 'Core' 'Tests' 'Islands'); loads: #('Minimal' 'Core' 'Tests' 'Islands');
repository: 'github://moosetechnology/PetitParser:v3.x.x/src' repository: 'github://moosetechnology/PetitParser:v3.x.x/src'
]. ].
"self xmlParserHTML: spec." self fossil: spec.
"Packages" "Packages"
spec spec
package: 'MiniDocs' with: [ spec requires: #('Mustache' 'Tealight' "'XMLParserHTML'") ]; package: 'MiniDocs' with: [ spec requires: #('Mustache' 'Tealight' "'XMLParserHTML'") ];
@ -29,6 +29,15 @@ BaselineOfMiniDocs >> baseline: spec [
] ]
{ #category : #accessing }
BaselineOfMiniDocs >> fossil: spec [
| repo |
repo := ExoRepo new
repository: 'https://code.tupale.co/Offray/Fossil'.
repo load.
spec baseline: 'Fossil' with: [ spec repository: 'gitlocal://', repo local fullName ]
]
{ #category : #accessing } { #category : #accessing }
BaselineOfMiniDocs >> semanticVersion [ BaselineOfMiniDocs >> semanticVersion [
^ '0.2.0' ^ '0.2.0'

View File

@ -121,7 +121,7 @@ GrafoscopioNode >> earliestCreationDate [
self nodesWithCreationDates ifNotEmpty: [ self nodesWithCreationDates ifNotEmpty: [
earliest := self nodesWithCreationDates first created] earliest := self nodesWithCreationDates first created]
ifEmpty: [ earliest := self earliestRepositoryTimestamp]. ifEmpty: [ earliest := self earliestRepositoryTimestamp - 3 hours].
self nodesWithCreationDates do: [:node | self nodesWithCreationDates do: [:node |
node created <= earliest ifTrue: [ earliest := node created ] ]. node created <= earliest ifTrue: [ earliest := node created ] ].
^ earliest ^ earliest
@ -129,15 +129,15 @@ GrafoscopioNode >> earliestCreationDate [
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> earliestRepositoryTimestamp [ GrafoscopioNode >> earliestRepositoryTimestamp [
| remote fossilHost docSegments repo | | remote fossilHost docSegments repo checkinInfo |
remote := self remoteLocations first asUrl. remote := self remoteLocations first asUrl.
fossilHost := 'https://mutabit.com/repos.fossil'. fossilHost := 'https://mutabit.com/repos.fossil'.
(remote asString includesSubstring: fossilHost) ifFalse: [ ^ false ]. (remote asString includesSubstring: fossilHost) ifFalse: [ ^ false ].
docSegments := remote segments copyFrom: 5 to: remote segments size. docSegments := remote segments copyFrom: 5 to: remote segments size.
repo := FossilRepo new repo := FossilRepo new
remote: (remote scheme, '://', remote host, '/', remote segments first, '/', remote segments second). remote: (remote scheme, '://', remote host, '/', remote segments first, '/', remote segments second).
^ repo checkinInfo := repo firstCheckinFor: ('/' join: docSegments).
firstCheckinFor: ('/' join: docSegments) ^ DateAndTime fromUnixTime: (checkinInfo at: 'timestamp')
] ]
{ #category : #accessing } { #category : #accessing }