Repackaging general utilities for working with Markup files.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-27 11:02:39 -05:00
parent a28ca6ca51
commit b88862e7c1
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
"
I model common operations made with several markup files.
"
Class {
#name : #MarkupFile,
#superclass : #Object,
#instVars : [
'file'
],
#category : #Markdeep
}
{ #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 withUnixLineEndings].
self inform: 'Exported as: ', String cr, file fullName.
^ file
]