From 298601dbc5665926bc53d57dc08ec2806590344d Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 18 Apr 2023 09:45:03 -0500 Subject: [PATCH] Support for aproximating Grafoscopio notebook's creation timestamps from the commits in the Fossil repository where they're published. --- src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st | 11 ++++++++++- src/MiniDocs/GrafoscopioNode.class.st | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st b/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st index 4466999..330379c 100644 --- a/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st +++ b/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st @@ -19,7 +19,7 @@ BaselineOfMiniDocs >> baseline: spec [ loads: #('Minimal' 'Core' 'Tests' 'Islands'); repository: 'github://moosetechnology/PetitParser:v3.x.x/src' ]. - "self xmlParserHTML: spec." + self fossil: spec. "Packages" spec 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 } BaselineOfMiniDocs >> semanticVersion [ ^ '0.2.0' diff --git a/src/MiniDocs/GrafoscopioNode.class.st b/src/MiniDocs/GrafoscopioNode.class.st index d4bc35c..fdd2396 100644 --- a/src/MiniDocs/GrafoscopioNode.class.st +++ b/src/MiniDocs/GrafoscopioNode.class.st @@ -121,7 +121,7 @@ GrafoscopioNode >> earliestCreationDate [ self nodesWithCreationDates ifNotEmpty: [ earliest := self nodesWithCreationDates first created] - ifEmpty: [ earliest := self earliestRepositoryTimestamp]. + ifEmpty: [ earliest := self earliestRepositoryTimestamp - 3 hours]. self nodesWithCreationDates do: [:node | node created <= earliest ifTrue: [ earliest := node created ] ]. ^ earliest @@ -129,15 +129,15 @@ GrafoscopioNode >> earliestCreationDate [ { #category : #accessing } GrafoscopioNode >> earliestRepositoryTimestamp [ - | remote fossilHost docSegments repo | + | remote fossilHost docSegments repo checkinInfo | remote := self remoteLocations first asUrl. fossilHost := 'https://mutabit.com/repos.fossil'. (remote asString includesSubstring: fossilHost) ifFalse: [ ^ false ]. docSegments := remote segments copyFrom: 5 to: remote segments size. repo := FossilRepo new remote: (remote scheme, '://', remote host, '/', remote segments first, '/', remote segments second). - ^ repo - firstCheckinFor: ('/' join: docSegments) + checkinInfo := repo firstCheckinFor: ('/' join: docSegments). + ^ DateAndTime fromUnixTime: (checkinInfo at: 'timestamp') ] { #category : #accessing }