100
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCMockDependency
|
|
4 |
instanceVariableNames:'name children hasResolution'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
654
|
7 |
category:'SCM-Monticello-Mocks'
|
100
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCMockDependency class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
fromTree: anArray
|
|
14 |
^ self new initializeWithTree: anArray
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCMockDependency methodsFor:'accessing'!
|
|
18 |
|
|
19 |
children
|
|
20 |
^ children collect: [:ea | self class fromTree: ea]
|
|
21 |
!
|
|
22 |
|
|
23 |
initializeWithTree: expr
|
|
24 |
expr isSymbol
|
246
|
25 |
ifTrue: [name := expr.
|
|
26 |
children := Array new.
|
|
27 |
hasResolution := true.]
|
|
28 |
ifFalse: [name := expr first.
|
100
|
29 |
expr second isSymbol
|
246
|
30 |
ifTrue: [hasResolution := false.
|
|
31 |
children := Array new]
|
|
32 |
ifFalse: [hasResolution := true.
|
|
33 |
children := expr second]]
|
100
|
34 |
!
|
|
35 |
|
|
36 |
name
|
|
37 |
^ name
|
|
38 |
! !
|
|
39 |
|
|
40 |
!MCMockDependency methodsFor:'comparing'!
|
|
41 |
|
|
42 |
= other
|
|
43 |
^ self name = other name
|
|
44 |
!
|
|
45 |
|
|
46 |
hash
|
|
47 |
^ self name hash
|
|
48 |
! !
|
|
49 |
|
|
50 |
!MCMockDependency methodsFor:'mocks'!
|
|
51 |
|
|
52 |
mockVersionInfo
|
|
53 |
^ MCVersionInfo
|
|
54 |
name: self name
|
|
55 |
id: (self uuidForName: name)
|
|
56 |
message: ''
|
|
57 |
date: nil
|
|
58 |
time: nil
|
|
59 |
author: ''
|
|
60 |
ancestors: #()
|
|
61 |
!
|
|
62 |
|
|
63 |
uuidForName: aName
|
|
64 |
| nm id |
|
|
65 |
nm := aName asString.
|
|
66 |
id := '00000000-0000-0000-0000-0000000000'
|
|
67 |
, (nm size = 1 ifTrue: [nm , '0'] ifFalse: [nm]).
|
|
68 |
^UUID fromString: id
|
|
69 |
! !
|
|
70 |
|
|
71 |
!MCMockDependency methodsFor:'resolving'!
|
|
72 |
|
|
73 |
hasResolution
|
|
74 |
^ hasResolution
|
|
75 |
!
|
|
76 |
|
|
77 |
resolve
|
|
78 |
^ self hasResolution
|
|
79 |
ifTrue: [MCVersion new
|
|
80 |
setPackage: MCSnapshotResource mockPackage
|
|
81 |
info: self mockVersionInfo
|
|
82 |
snapshot: MCSnapshotResource current snapshot
|
|
83 |
dependencies: self children]
|
|
84 |
ifFalse: [nil]
|
|
85 |
! !
|
|
86 |
|
|
87 |
!MCMockDependency class methodsFor:'documentation'!
|
|
88 |
|
|
89 |
version
|
654
|
90 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCMockDependency.st,v 1.4 2012-09-11 21:24:20 cg Exp $'
|
246
|
91 |
!
|
|
92 |
|
|
93 |
version_CVS
|
654
|
94 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCMockDependency.st,v 1.4 2012-09-11 21:24:20 cg Exp $'
|
246
|
95 |
!
|
|
96 |
|
|
97 |
version_SVN
|
|
98 |
^ '§Id: MCMockDependency.st 5 2010-08-29 07:30:29Z vranyj1 §'
|
100
|
99 |
! !
|