2177
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
2028
|
12 |
"{ Package: 'stx:libbasic3' }"
|
|
13 |
|
|
14 |
Object subclass:#VersionInfo
|
|
15 |
instanceVariableNames:'revision binaryRevision user date time fileName'
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'System-SourceCodeManagement'
|
|
19 |
!
|
|
20 |
|
|
21 |
!VersionInfo class methodsFor:'documentation'!
|
|
22 |
|
2177
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
|
35 |
!
|
|
36 |
|
2028
|
37 |
documentation
|
|
38 |
"
|
3655
|
39 |
In ancient times, Class used to return a Dictionary when asked for versionInfo.
|
2028
|
40 |
This has been replaced by instances of this class and subclasses.
|
3655
|
41 |
|
|
42 |
Notice, that subclasses may add more info for specific source repositories
|
|
43 |
(CVSVersionInfo, MonticelloVersionInfo etc.).
|
|
44 |
However, any generic tools/ui should only depend on the values (and getters) found here.
|
2028
|
45 |
|
|
46 |
[author:]
|
|
47 |
cg (cg@AQUA-DUO)
|
|
48 |
"
|
|
49 |
! !
|
|
50 |
|
|
51 |
!VersionInfo methodsFor:'accessing'!
|
|
52 |
|
|
53 |
at:aKey
|
|
54 |
"backward compatible dictionary-like accessing"
|
|
55 |
|
|
56 |
(self respondsTo:aKey) ifTrue:[
|
|
57 |
^ self perform:aKey
|
|
58 |
].
|
|
59 |
^ self errorKeyNotFound:aKey
|
|
60 |
|
|
61 |
"
|
|
62 |
self new at:#binaryRevision
|
|
63 |
self new at:#foo
|
|
64 |
"
|
|
65 |
|
|
66 |
"Modified: / 22-10-2008 / 20:23:31 / cg"
|
|
67 |
!
|
|
68 |
|
|
69 |
at:aKey ifAbsent:replacement
|
|
70 |
"backward compatible dictionary-like accessing"
|
|
71 |
|
|
72 |
(self respondsTo:aKey) ifTrue:[
|
|
73 |
^ (self perform:aKey) ? replacement
|
|
74 |
].
|
|
75 |
^ replacement
|
|
76 |
|
|
77 |
"
|
|
78 |
self new at:#binaryRevision
|
|
79 |
self new at:#foo ifAbsent:#bar
|
|
80 |
"
|
|
81 |
|
|
82 |
"Created: / 22-10-2008 / 20:19:42 / cg"
|
|
83 |
!
|
|
84 |
|
|
85 |
at:aKey put:value
|
|
86 |
"backward compatible dictionary-like accessing"
|
|
87 |
|
|
88 |
(self respondsTo:aKey) ifTrue:[
|
3517
|
89 |
self perform:aKey asMutator with:value.
|
2028
|
90 |
^ value "/ sigh
|
|
91 |
].
|
|
92 |
^ self errorKeyNotFound:aKey
|
|
93 |
|
|
94 |
"
|
|
95 |
self new at:#binaryRevision put:#bar
|
|
96 |
self new at:#foo put:#bar
|
|
97 |
"
|
|
98 |
|
|
99 |
"Created: / 22-10-2008 / 20:20:54 / cg"
|
|
100 |
!
|
|
101 |
|
2667
|
102 |
author
|
|
103 |
^ self user
|
|
104 |
|
|
105 |
"Created: / 21-12-2011 / 23:09:54 / cg"
|
|
106 |
!
|
|
107 |
|
2028
|
108 |
binaryRevision
|
|
109 |
^ binaryRevision
|
|
110 |
!
|
|
111 |
|
|
112 |
binaryRevision:something
|
|
113 |
binaryRevision := something.
|
|
114 |
!
|
|
115 |
|
|
116 |
date
|
|
117 |
^ date
|
|
118 |
!
|
|
119 |
|
|
120 |
date:something
|
|
121 |
date := something.
|
|
122 |
!
|
|
123 |
|
|
124 |
fileName
|
|
125 |
^ fileName
|
|
126 |
!
|
|
127 |
|
|
128 |
fileName:something
|
|
129 |
fileName := something.
|
|
130 |
!
|
|
131 |
|
|
132 |
keysAndValuesDo:aBlock
|
|
133 |
self class instVarNames do:[:nm |
|
|
134 |
aBlock value:(nm asSymbol) value:(self perform:nm asSymbol)
|
|
135 |
].
|
|
136 |
|
|
137 |
"Created: / 22-10-2008 / 20:48:08 / cg"
|
|
138 |
!
|
|
139 |
|
2608
|
140 |
repositoryPathName
|
|
141 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
142 |
|
|
143 |
^ nil "Not known"
|
|
144 |
|
|
145 |
"Modified: / 23-11-2011 / 23:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
146 |
!
|
|
147 |
|
2028
|
148 |
revision
|
|
149 |
^ revision
|
|
150 |
!
|
|
151 |
|
|
152 |
revision:something
|
|
153 |
revision := something.
|
|
154 |
!
|
|
155 |
|
|
156 |
time
|
|
157 |
^ time
|
|
158 |
!
|
|
159 |
|
|
160 |
time:something
|
|
161 |
time := something.
|
|
162 |
!
|
|
163 |
|
2640
|
164 |
timeStamp:aTimestamp
|
2667
|
165 |
date := aTimestamp asDate.
|
|
166 |
time := aTimestamp asTime.
|
2640
|
167 |
|
|
168 |
"Created: / 04-12-2011 / 10:06:02 / cg"
|
|
169 |
!
|
|
170 |
|
2608
|
171 |
timezone
|
|
172 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
173 |
|
|
174 |
^ nil "Not known"
|
|
175 |
|
|
176 |
"Modified: / 23-11-2011 / 13:54:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
177 |
!
|
|
178 |
|
2028
|
179 |
user
|
|
180 |
^ user
|
|
181 |
!
|
|
182 |
|
|
183 |
user:something
|
|
184 |
user := something.
|
|
185 |
! !
|
|
186 |
|
|
187 |
!VersionInfo class methodsFor:'documentation'!
|
|
188 |
|
2177
|
189 |
version_CVS
|
3655
|
190 |
^ '$Header: /cvs/stx/stx/libbasic3/VersionInfo.st,v 1.8 2014-11-28 17:28:19 cg Exp $'
|
2028
|
191 |
! !
|
3517
|
192 |
|