2020-12-18 17:54:09 +00:00
|
|
|
"
|
|
|
|
I model common operations made with several markup files.
|
|
|
|
"
|
|
|
|
Class {
|
|
|
|
#name : #MarkupFile,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'file'
|
|
|
|
],
|
|
|
|
#category : #'Grafoscopio-Utils'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #persistence }
|
|
|
|
MarkupFile class >> exportAsFileOn: aFileReferenceOrFileName containing: text [
|
|
|
|
| file |
|
|
|
|
file := aFileReferenceOrFileName asFileReference.
|
|
|
|
file ensureDelete.
|
|
|
|
file exists ifFalse: [ file ensureCreateFile ].
|
|
|
|
file writeStreamDo: [ :stream |
|
|
|
|
stream nextPutAll: text withInternetLineEndings].
|
|
|
|
self inform: 'Exported as: ', String cr, file fullName.
|
|
|
|
^ file
|
|
|
|
]
|