Repackaging general utilities for working with Markup files.
This commit is contained in:
parent
a28ca6ca51
commit
b88862e7c1
23
src/Markdeep/MarkupFile.class.st
Normal file
23
src/Markdeep/MarkupFile.class.st
Normal 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
|
||||
]
|
Loading…
Reference in New Issue
Block a user