[Pharo-project] Now you can use Fuel with FileSystem
Mariano Martinez Peck
marianopeck at gmail.com
Sat Jan 7 17:25:13 EST 2012
Hi guys. Now you can use FileSystem streams for Fuel. Fuel only needs one
small package 'FuelFileSystem' which has just 3 extension methods, and
that's all ;)
There is also 'FuelFileSystemTests' which let's you run all fuel tests
using FS. If you want to do that, change FLSerializationTest >> setUp to
send #useFileSystemFileStream rather than #useStandardFileStream and
(ConfigurationOfFuel project version: #bleedingEdge) load: 'withFS'.
| sourceArray loadedArray serializer stream materializer |
with: 'a string'
with: [ Transcript show: 'a string' ].
"Create a file and serialize on it"
stream := (FSLocator imageDirectory / 'example.fuel') writeStream.
serializer := FLSerializer newDefault.
serializer serialize: sourceArray on: stream.
"Load from the file"
stream := (FSLocator imageDirectory / 'example.fuel') readStream.
materializer := FLMaterializer newDefault.
loadedArray := (materializer materializeFrom: stream) root.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev