Reading (Memory FS)
store := FileSystem memory root.
(store / 'Somewhere') ensureCreateDirectory.
(store / 'Somewhere' / 'Something.class.st')
ensureDelete;
writeStreamDo: [ :stream | stream << 'Class {
#name : #Something,
#superclass : #Object,
#category : #Somewhere
}
{ #category : #initialization }
Something >> initialize [
super initialize
]' ].
reader := TonelReader on: store fileName: 'Somewhere'.
reader snapshot install.
Reading from string
(MCSnapshot fromDefinitions: (TonelParser parseStream: 'Class {
#name : #Something,
#superclass : #Object,
#category : #Somewhere
}
{ #category : #initialization }
Something >> initialize [
super initialize
]' readStream)) install
Writing (Memory FS)
store := FileSystem memory root.
TonelWriter fileOut: 'SomeMorph' asPackage mcWorkingCopy on: store.