"{ Package: 'stx:goodies/monticello' }"
Object subclass:#MCPackage
instanceVariableNames:'name'
classVariableNames:''
poolDictionaries:''
category:'Monticello-Base'
!
!MCPackage class methodsFor:'as yet unclassified'!
named: aString
^ self new name: aString
! !
!MCPackage methodsFor:'as yet unclassified'!
= other
^ other species = self species and: [other name sameAs: name]
!
hasWorkingCopy
^ MCWorkingCopy registry includesKey: self
!
hash
^ name asLowercase hash
!
name
^ name
!
name: aString
name _ aString
!
packageInfo
^ PackageInfo named: name
!
printOn: aStream
super printOn: aStream.
aStream
nextPut: $(;
nextPutAll: name;
nextPut: $)
!
snapshot
| packageInfo definitions categories |
packageInfo := self packageInfo.
definitions := OrderedCollection new.
categories := packageInfo systemCategories.
categories isEmpty ifFalse: [ definitions add: (MCOrganizationDefinition categories: categories) ].
packageInfo methods do: [:ea | definitions add: ea asMethodDefinition] displayingProgress: 'Snapshotting methods...'.
(packageInfo respondsTo: #overriddenMethods) ifTrue:
[packageInfo overriddenMethods
do: [:ea | definitions add:
(packageInfo changeRecordForOverriddenMethod: ea) asMethodDefinition]
displayingProgress: 'Searching for overrides...'].
packageInfo classes do: [:ea | definitions addAll: ea classDefinitions] displayingProgress: 'Snapshotting classes...'.
(packageInfo respondsTo: #hasPreamble) ifTrue: [
packageInfo hasPreamble ifTrue: [definitions add: (MCPreambleDefinition from: packageInfo)].
packageInfo hasPostscript ifTrue: [definitions add: (MCPostscriptDefinition from: packageInfo)].
packageInfo hasPreambleOfRemoval ifTrue: [definitions add: (MCRemovalPreambleDefinition from: packageInfo)].
packageInfo hasPostscriptOfRemoval ifTrue: [definitions add: (MCRemovalPostscriptDefinition from: packageInfo)]].
^ MCSnapshot fromDefinitions: definitions
!
storeOn: aStream
aStream
nextPutAll: 'MCPackage';
space; nextPutAll: 'named: '; store: name.
!
unload
^ self workingCopy unload
!
workingCopy
^ MCWorkingCopy forPackage: self.
! !
!MCPackage class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.1 2006-11-22 13:19:56 cg Exp $'
! !