103
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCPackage
|
|
4 |
instanceVariableNames:'name'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Base'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCPackage class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
named: aString
|
|
14 |
^ self new name: aString
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCPackage methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
= other
|
|
20 |
^ other species = self species and: [other name sameAs: name]
|
|
21 |
!
|
|
22 |
|
|
23 |
hasWorkingCopy
|
|
24 |
^ MCWorkingCopy registry includesKey: self
|
|
25 |
!
|
|
26 |
|
|
27 |
hash
|
|
28 |
^ name asLowercase hash
|
|
29 |
!
|
|
30 |
|
|
31 |
name
|
|
32 |
^ name
|
|
33 |
!
|
|
34 |
|
|
35 |
name: aString
|
|
36 |
name _ aString
|
|
37 |
!
|
|
38 |
|
|
39 |
packageInfo
|
|
40 |
^ PackageInfo named: name
|
|
41 |
!
|
|
42 |
|
|
43 |
printOn: aStream
|
|
44 |
super printOn: aStream.
|
|
45 |
aStream
|
|
46 |
nextPut: $(;
|
|
47 |
nextPutAll: name;
|
|
48 |
nextPut: $)
|
|
49 |
!
|
|
50 |
|
|
51 |
snapshot
|
|
52 |
| packageInfo definitions categories |
|
|
53 |
packageInfo := self packageInfo.
|
|
54 |
definitions := OrderedCollection new.
|
|
55 |
categories := packageInfo systemCategories.
|
|
56 |
categories isEmpty ifFalse: [ definitions add: (MCOrganizationDefinition categories: categories) ].
|
|
57 |
packageInfo methods do: [:ea | definitions add: ea asMethodDefinition] displayingProgress: 'Snapshotting methods...'.
|
|
58 |
(packageInfo respondsTo: #overriddenMethods) ifTrue:
|
|
59 |
[packageInfo overriddenMethods
|
|
60 |
do: [:ea | definitions add:
|
|
61 |
(packageInfo changeRecordForOverriddenMethod: ea) asMethodDefinition]
|
|
62 |
displayingProgress: 'Searching for overrides...'].
|
|
63 |
packageInfo classes do: [:ea | definitions addAll: ea classDefinitions] displayingProgress: 'Snapshotting classes...'.
|
|
64 |
(packageInfo respondsTo: #hasPreamble) ifTrue: [
|
|
65 |
packageInfo hasPreamble ifTrue: [definitions add: (MCPreambleDefinition from: packageInfo)].
|
|
66 |
packageInfo hasPostscript ifTrue: [definitions add: (MCPostscriptDefinition from: packageInfo)].
|
|
67 |
packageInfo hasPreambleOfRemoval ifTrue: [definitions add: (MCRemovalPreambleDefinition from: packageInfo)].
|
|
68 |
packageInfo hasPostscriptOfRemoval ifTrue: [definitions add: (MCRemovalPostscriptDefinition from: packageInfo)]].
|
|
69 |
^ MCSnapshot fromDefinitions: definitions
|
|
70 |
!
|
|
71 |
|
|
72 |
storeOn: aStream
|
|
73 |
aStream
|
|
74 |
nextPutAll: 'MCPackage';
|
|
75 |
space; nextPutAll: 'named: '; store: name.
|
|
76 |
!
|
|
77 |
|
|
78 |
unload
|
|
79 |
^ self workingCopy unload
|
|
80 |
!
|
|
81 |
|
|
82 |
workingCopy
|
|
83 |
^ MCWorkingCopy forPackage: self.
|
|
84 |
! !
|
|
85 |
|
|
86 |
!MCPackage class methodsFor:'documentation'!
|
|
87 |
|
|
88 |
version
|
|
89 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.1 2006-11-22 13:19:56 cg Exp $'
|
|
90 |
! !
|