2020-05-02 13:28:13 +00:00
|
|
|
Class {
|
|
|
|
#name : #MarkupFile,
|
|
|
|
#superclass : #Object,
|
|
|
|
#instVars : [
|
|
|
|
'file'
|
|
|
|
],
|
|
|
|
#category : #'Grafoscopio-Utils'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #persistence }
|
2020-06-08 21:08:39 +00:00
|
|
|
MarkupFile class >> exportAsFileOn: aFileReferenceOrFileName containing: contents [
|
|
|
|
| file |
|
|
|
|
file := aFileReferenceOrFileName asFileReference.
|
|
|
|
file exists ifFalse: [ file ensureCreateFile ].
|
|
|
|
file writeStreamDo: [ :stream |
|
2020-05-02 13:28:13 +00:00
|
|
|
stream nextPutAll: contents ].
|
2020-06-08 21:08:39 +00:00
|
|
|
self inform: 'Exported as: ', String cr, file fullName
|
2020-05-02 13:28:13 +00:00
|
|
|
]
|