author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 07 Sep 2015 15:37:41 +0100 | |
branch | jv |
changeset 1002 | 54b4906215ca |
parent 790 | beb50bd00335 |
permissions | -rw-r--r-- |
63 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
4 |
|
63 | 5 |
Object subclass:#MCDefinitionIndex |
6 |
instanceVariableNames:'definitions' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
618 | 9 |
category:'SCM-Monticello-Patching' |
63 | 10 |
! |
11 |
||
790 | 12 |
!MCDefinitionIndex class methodsFor:'documentation'! |
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
I'm a simple container of MCDefinitions which can be added or removed. |
|
17 |
" |
|
18 |
! ! |
|
63 | 19 |
|
253 | 20 |
!MCDefinitionIndex class methodsFor:'initialization'! |
21 |
||
22 |
new |
|
23 |
^self basicNew initialize |
|
24 |
! ! |
|
25 |
||
63 | 26 |
!MCDefinitionIndex class methodsFor:'as yet unclassified'! |
27 |
||
28 |
definitions: aCollection |
|
29 |
^ self new addAll: aCollection |
|
30 |
! ! |
|
31 |
||
32 |
!MCDefinitionIndex methodsFor:'as yet unclassified'! |
|
33 |
||
34 |
add: aDefinition |
|
35 |
definitions at: aDefinition description put: aDefinition |
|
36 |
! |
|
37 |
||
38 |
addAll: aCollection |
|
39 |
aCollection do: [:ea | self add: ea] |
|
40 |
! |
|
41 |
||
42 |
definitionLike: aDefinition ifPresent: foundBlock ifAbsent: errorBlock |
|
43 |
| definition | |
|
253 | 44 |
definition := definitions at: aDefinition description ifAbsent: []. |
63 | 45 |
^ definition |
46 |
ifNil: errorBlock |
|
47 |
ifNotNil: [foundBlock value: definition] |
|
48 |
! |
|
49 |
||
50 |
definitions |
|
51 |
^ definitions values |
|
52 |
! |
|
53 |
||
54 |
initialize |
|
253 | 55 |
super initialize. |
56 |
definitions := Dictionary new |
|
63 | 57 |
! |
58 |
||
59 |
remove: aDefinition |
|
60 |
definitions removeKey: aDefinition description ifAbsent: [] |
|
61 |
! ! |
|
62 |
||
63 |
!MCDefinitionIndex class methodsFor:'documentation'! |
|
64 |
||
65 |
version |
|
790 | 66 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $' |
253 | 67 |
! |
68 |
||
69 |
version_CVS |
|
790 | 70 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $' |
253 | 71 |
! |
72 |
||
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
73 |
version_HG |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
74 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
75 |
^ '$Changeset: <not expanded> $' |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
76 |
! |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
77 |
|
253 | 78 |
version_SVN |
790 | 79 |
^ '$Id: MCDefinitionIndex.st,v 1.5 2013-05-15 11:57:02 cg Exp $' |
63 | 80 |
! ! |
790 | 81 |