From 169fd2246ed839870bf954a491730e1747841e33 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 22 Apr 2019 20:15:48 +0000 Subject: [PATCH] Factoring serialization to external files. --- repository/Grafoscopio-Utils/GrafoscopioUtils.class.st | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st index 2c2a564..e162ed0 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st @@ -60,7 +60,15 @@ GrafoscopioUtils class >> ensureCreateDirectory: fileNameWithRelativePath into: { #category : #persistence } GrafoscopioUtils class >> exportAsSton: anObject on: aFileReference [ - "comment stating purpose of message" + aFileReference exists ifTrue: [ aFileReference ensureDelete ]. + aFileReference ensureCreateFile. + aFileReference writeStreamDo: [ :stream | + (STON writer on: stream) + newLine: String crlf; + prettyPrint: true; + keepNewLines: true; + nextPut: anObject ]. + ]