Is it possible to file out a class hierarchy ?
From a playground or nautilus is is possible to file out a class and all of its subclasses into one file out? The subclasses are in different packages, which I think is a confounding factor.
Thanks Paul
You could evaluate YourClass allSubclassesDo: #fileOut 2016-11-17 18:16 GMT+01:00 PAUL DEBRUICKER <pdebruic@gmail.com>:
From a playground or nautilus is is possible to file out a class and all of its subclasses into one file out? The subclasses are in different packages, which I think is a confounding factor.
Thanks
Paul
| aStream aClass | aStream := '' writeStream. aClass := FTFilter. FTFilter fileOutOn: aStream. FTFilter allSubclassesDo: [ :cls | cls fileOutOn: aStream ]. "(ChunkFileFormatParser for: aStream contents readStream) parseChunks" ------------------------------- Best regards, Henrik -----Original Message----- From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of PAUL DEBRUICKER Sent: Thursday, November 17, 2016 6:16 PM To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Subject: [Pharo-users] Is it possible to file out a class hierarchy ?
From a playground or nautilus is is possible to file out a class and all of its subclasses into one file out? The subclasses are in different packages, which I think is a confounding factor.
Thanks Paul
Thanks to you both. This is what I ended up with: |class file stream| class:=MyClass . file:=(class name asString, '-hierarchy.st') asFileReference. stream:=file writeStream. class fileOutOn:stream. class allSubclassesDo: [ :cls | cls fileOutOn: stream. ]. stream close. Henrik Nergaard-2 wrote
| aStream aClass |
aStream := '' writeStream. aClass := FTFilter.
FTFilter fileOutOn: aStream. FTFilter allSubclassesDo: [ :cls | cls fileOutOn: aStream ].
"(ChunkFileFormatParser for: aStream contents readStream) parseChunks"
-------------------------------
Best regards, Henrik
-----Original Message----- From: Pharo-users [mailto:
pharo-users-bounces@.pharo
] On Behalf Of PAUL DEBRUICKER Sent: Thursday, November 17, 2016 6:16 PM To: Any question about pharo is welcome <
pharo-users@.pharo
> Subject: [Pharo-users] Is it possible to file out a class hierarchy ?
From a playground or nautilus is is possible to file out a class and all of its subclasses into one file out? The subclasses are in different packages, which I think is a confounding factor.
Thanks
Paul
-- View this message in context: http://forum.world.st/Is-it-possible-to-file-out-a-class-hierarchy-tp4923493... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (4)
-
Denis Kudriashov -
Henrik Nergaard -
PAUL DEBRUICKER -
Paul DeBruicker