67
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCPatcher
|
|
4 |
instanceVariableNames:'definitions'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Patching'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCPatcher class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
apply: aPatch to: aSnapshot
|
|
14 |
| loader |
|
|
15 |
loader _ self snapshot: aSnapshot.
|
|
16 |
aPatch applyTo: loader.
|
|
17 |
^ loader patchedSnapshot
|
|
18 |
!
|
|
19 |
|
|
20 |
snapshot: aSnapshot
|
|
21 |
^ self new initializeWithSnapshot: aSnapshot
|
|
22 |
! !
|
|
23 |
|
|
24 |
!MCPatcher methodsFor:'as yet unclassified'!
|
|
25 |
|
|
26 |
addDefinition: aDefinition
|
|
27 |
definitions add: aDefinition
|
|
28 |
!
|
|
29 |
|
|
30 |
initializeWithSnapshot: aSnapshot
|
|
31 |
definitions _ MCDefinitionIndex definitions: aSnapshot definitions
|
|
32 |
!
|
|
33 |
|
|
34 |
modifyDefinition: baseDefinition to: targetDefinition
|
|
35 |
self addDefinition: targetDefinition
|
|
36 |
!
|
|
37 |
|
|
38 |
patchedSnapshot
|
|
39 |
^ MCSnapshot fromDefinitions: definitions definitions
|
|
40 |
!
|
|
41 |
|
|
42 |
removeDefinition: aDefinition
|
|
43 |
definitions remove: aDefinition
|
|
44 |
! !
|
|
45 |
|
|
46 |
!MCPatcher class methodsFor:'documentation'!
|
|
47 |
|
|
48 |
version
|
|
49 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.1 2006-11-22 13:12:35 cg Exp $'
|
|
50 |
! !
|