Export of a snapshot with method extensions only fails
The package Moose-TestResources-KGB-P11FullReferee contains only the method extensions. The method TonelWriter>>#writeSnapshot: does following:
self writePackage: (snapshot definitions
detect: #isOrganizationDefinition
ifFound: [ :each | each ]
ifNone: [ self createDefaultOrganizationFrom: (snapshot definitions detect: #isClassDefinition) ]).
The snapshot does contain no organization nor class definition (it contains only 3 method definitions) so the code fails.
I've considered fixing this by looking at the extension name, however that is not good because
- the capitalization can be different (which would result in multiple packages/directories on Linux and different behavior on Windows)
- the extension name can be actually a compound of "packageName-protocolName"
The only place where the package name is still available (in case of all methods being extension methods), is the MCVersionInfo... so maybe
TonelWriter>>writeVersion: aVersion
packageName := aVersion package name.
self writeSnapshot: aVersion snapshot
but this won't work either if someone tries to use writeSnapshot: directly...
@pavel-krivanek btw if you've encountered this problem with Git-Migration, then it is fixed (Git-Migration now adds the necessary definition before fileout). But obviously this needs to be fixed in Tonel too.
related to #59
@peteruhnak not, it was not related to Git-Migration.