From 7d19271ccd2c1e6c944774a42cb35bccfc569a4d Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Thu, 9 Jan 2025 10:54:25 +0100 Subject: [PATCH] Improving the export of results --- .../BlBResultsExporter.class.st | 3 +- .../BlBResultsTemplates.class.st | 62 ++++++------------- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/src/BlocBenchs-Core/BlBResultsExporter.class.st b/src/BlocBenchs-Core/BlBResultsExporter.class.st index 4881150..eab8b2a 100644 --- a/src/BlocBenchs-Core/BlBResultsExporter.class.st +++ b/src/BlocBenchs-Core/BlBResultsExporter.class.st @@ -55,7 +55,8 @@ BlBResultsExporter >> exportResults [ self ensureResults. self ensureGroups. - outputDirectory ensureCreateDirectory. + outputDirectory ensureDeleteAll. + templates copyAllResourcesTo: outputDirectory. self generateIndex ] diff --git a/src/BlocBenchs-Core/BlBResultsTemplates.class.st b/src/BlocBenchs-Core/BlBResultsTemplates.class.st index bc5ccd5..33e49f8 100644 --- a/src/BlocBenchs-Core/BlBResultsTemplates.class.st +++ b/src/BlocBenchs-Core/BlBResultsTemplates.class.st @@ -1,6 +1,9 @@ Class { #name : #BlBResultsTemplates, #superclass : #Object, + #instVars : [ + 'templatesDirectory' + ], #category : #'BlocBenchs-Core-Exporter' } @@ -32,56 +35,31 @@ BlBResultsTemplates class >> equalsIcon [ ' ] +{ #category : #copying } +BlBResultsTemplates >> copyAllResourcesTo: aDirectory [ + + (templatesDirectory / 'resources') copyAllTo: aDirectory +] + { #category : #accessing } BlBResultsTemplates >> header [ - ^ ' - - - - - - {{pageTitle}} - -' + ^ (templatesDirectory / 'header.html') contents ] { #category : #accessing } BlBResultsTemplates >> index [ - ^ ' - - - {{> header }} - -

{{pageTitle}}

- - - - - - {{#imageVersions}} - - {{/imageVersions}} - - - - {{#benchs}} - - - {{#versionTicks}} - - {{/versionTicks}} - - {{/benchs}} - -
Bench Label{{.}}
{{caseLabel}}{{#.}} - {{{.}}} - {{/.}} -
- - -' + ^ (templatesDirectory / 'index.html') contents +] + +{ #category : #initialization } +BlBResultsTemplates >> initialize [ + + super initialize. + + templatesDirectory := (IceRepository registry detect: [ :e | + e name = 'BlocBenchs' ]) location / 'templates'. ] { #category : #'as yet unclassified' }