17865
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2006 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 |
"
|
17859
|
12 |
"{ Package: 'stx:libbasic' }"
|
|
13 |
|
|
14 |
Object subclass:#ConfigurableFeatures
|
|
15 |
instanceVariableNames:''
|
|
16 |
classVariableNames:'LoadedFeatures'
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'System-Support'
|
|
19 |
!
|
|
20 |
|
|
21 |
!ConfigurableFeatures class methodsFor:'documentation'!
|
|
22 |
|
17865
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2006 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 |
|
17859
|
37 |
documentation
|
|
38 |
"
|
|
39 |
being tired of finding '(Smalltalk at:someClass) notNil' all over the place,
|
|
40 |
start to concentrate feature queries to this single class, which might get more
|
|
41 |
feature methods via extensions.
|
|
42 |
Thus, to correctly ask for a feature being present, use:
|
|
43 |
ConfigurableFeature includesFeature:featureName
|
|
44 |
or
|
|
45 |
ConfigurableFeature knownFeatures
|
|
46 |
to ask for a list of features.
|
|
47 |
|
|
48 |
Caveat: just started; more will be moved to this place as time goes by
|
|
49 |
"
|
|
50 |
! !
|
|
51 |
|
|
52 |
!ConfigurableFeatures class methodsFor:'queries'!
|
|
53 |
|
|
54 |
allFeatures
|
|
55 |
"a list of features which are present in that smalltalk configuration"
|
|
56 |
|
|
57 |
^ self knownFeatures select:[:each | self includesFeature:each]
|
|
58 |
|
|
59 |
"
|
|
60 |
ConfigurableFeatures allFeatures
|
|
61 |
"
|
|
62 |
|
|
63 |
"Created: / 07-09-2011 / 10:50:31 / cg"
|
|
64 |
!
|
|
65 |
|
|
66 |
includesFeature:featureName
|
|
67 |
|querySelector|
|
|
68 |
|
|
69 |
querySelector := ('has',featureName asUppercaseFirst) asSymbol.
|
|
70 |
^ self perform:querySelector ifNotUnderstood:false.
|
|
71 |
|
|
72 |
"
|
|
73 |
ConfigurableFeatures includesFeature:#SubversionSupport
|
|
74 |
"
|
|
75 |
|
|
76 |
"Created: / 07-09-2011 / 10:49:08 / cg"
|
|
77 |
!
|
|
78 |
|
|
79 |
knownFeatures
|
|
80 |
"a list of known features; some of them might not be present in that smalltalk configuration"
|
|
81 |
|
|
82 |
^ self class methodDictionary keys
|
|
83 |
collect:[:each |
|
|
84 |
(each startsWith:'has') ifTrue:[
|
|
85 |
each copyFrom:4
|
|
86 |
] ifFalse:[
|
|
87 |
nil
|
|
88 |
].
|
|
89 |
]
|
|
90 |
thenSelect:[:nm | nm notNil]
|
|
91 |
|
|
92 |
"
|
|
93 |
ConfigurableFeatures allFeatures
|
|
94 |
"
|
|
95 |
|
|
96 |
"Created: / 07-09-2011 / 10:51:26 / cg"
|
|
97 |
! !
|
|
98 |
|
|
99 |
!ConfigurableFeatures class methodsFor:'queries-features'!
|
|
100 |
|
17909
|
101 |
hasCVSSupport
|
|
102 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
103 |
^ (Smalltalk at: #'CVSSourceCodeManager' ifAbsent:nil) notNil
|
|
104 |
|
|
105 |
"
|
|
106 |
ConfigurableFeatures hasCVSSupport
|
|
107 |
"
|
|
108 |
|
|
109 |
"Created: / 03-01-2012 / 15:36:54 / cg"
|
|
110 |
!
|
|
111 |
|
|
112 |
hasCVSSupportEnabled
|
17910
|
113 |
^ self hasSCMSupportEnabledFor:#'CVSSourceCodeManager'
|
17909
|
114 |
|
|
115 |
"Created: / 03-01-2012 / 15:42:16 / cg"
|
|
116 |
!
|
|
117 |
|
|
118 |
hasDataBaseSourceCodeManagerSupport
|
|
119 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
120 |
^ (Smalltalk at: #'DataBaseSourceCodeManager' ifAbsent:nil) notNil
|
|
121 |
|
|
122 |
"
|
|
123 |
ConfigurableFeatures hasDataBaseSourceCodeManagerSupport
|
|
124 |
"
|
|
125 |
|
|
126 |
"Created: / 03-01-2012 / 15:36:03 / cg"
|
|
127 |
!
|
|
128 |
|
|
129 |
hasDataBaseSourceCodeManagerSupportEnabled
|
17910
|
130 |
^ self hasSCMSupportEnabledFor:#'DataBaseSourceCodeManager'
|
17909
|
131 |
|
|
132 |
"Created: / 03-01-2012 / 15:36:12 / cg"
|
|
133 |
!
|
|
134 |
|
|
135 |
hasFileBasedSourceCodeManagerSupport
|
|
136 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
137 |
^ (Smalltalk at: #'FileBasedSourceCodeManager' ifAbsent:nil) notNil
|
|
138 |
|
17907
|
139 |
"
|
|
140 |
ConfigurableFeatures hasFileBasedSourceCodeManagerSupport
|
|
141 |
"
|
|
142 |
|
|
143 |
"Created: / 21-12-2011 / 17:07:21 / cg"
|
|
144 |
!
|
|
145 |
|
|
146 |
hasFileBasedSourceCodeManagerSupportEnabled
|
17910
|
147 |
^ self hasSCMSupportEnabledFor:#'FileBasedSourceCodeManager'
|
17907
|
148 |
|
|
149 |
"Created: / 21-12-2011 / 17:07:08 / cg"
|
|
150 |
!
|
|
151 |
|
17910
|
152 |
hasMercurialSupport
|
|
153 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
154 |
^ (Smalltalk at: #'MercurialSourceCodeManager' ifAbsent:nil) notNil
|
|
155 |
|
|
156 |
"
|
|
157 |
ConfigurableFeatures hasMercurialSupport
|
|
158 |
"
|
|
159 |
|
|
160 |
"Created: / 18-01-2012 / 10:58:07 / cg"
|
|
161 |
!
|
|
162 |
|
|
163 |
hasMercurialSupportEnabled
|
|
164 |
^ self hasSCMSupportEnabledFor:#'MercurialSourceCodeManager'
|
|
165 |
|
|
166 |
"
|
|
167 |
self hasMercurialSupportEnabled
|
|
168 |
"
|
|
169 |
|
|
170 |
"Created: / 18-01-2012 / 10:58:12 / cg"
|
|
171 |
!
|
|
172 |
|
17909
|
173 |
hasMonticelloSupport
|
|
174 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
175 |
^ (Smalltalk at: #'MonticelloSourceCodeManager' ifAbsent:nil) notNil
|
|
176 |
|
|
177 |
"
|
|
178 |
ConfigurableFeatures hasMonticelloSupport
|
|
179 |
"
|
|
180 |
|
|
181 |
"Created: / 03-01-2012 / 15:44:32 / cg"
|
|
182 |
!
|
|
183 |
|
|
184 |
hasMonticelloSupportEnabled
|
17910
|
185 |
^ self hasSCMSupportEnabledFor:#'MonticelloSourceCodeManager'
|
17909
|
186 |
|
|
187 |
"Created: / 03-01-2012 / 15:44:39 / cg"
|
|
188 |
!
|
|
189 |
|
|
190 |
hasPerforceSupport
|
|
191 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
192 |
^ (Smalltalk at: #'PerforceSourceCodeManager' ifAbsent:nil) notNil
|
|
193 |
|
|
194 |
"
|
|
195 |
ConfigurableFeatures hasPerforceSupport
|
|
196 |
"
|
17859
|
197 |
|
17909
|
198 |
"Created: / 03-01-2012 / 15:43:42 / cg"
|
|
199 |
!
|
|
200 |
|
|
201 |
hasPerforceSupportEnabled
|
17910
|
202 |
^ self hasSCMSupportEnabledFor:#'PerforceSourceCodeManager'
|
17909
|
203 |
|
|
204 |
"Created: / 03-01-2012 / 15:43:28 / cg"
|
|
205 |
!
|
|
206 |
|
17910
|
207 |
hasSCMSupportEnabledFor:aSourceCodeManagerClassName
|
|
208 |
|scm|
|
|
209 |
|
|
210 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
|
211 |
scm := Smalltalk at:aSourceCodeManagerClassName ifAbsent:nil.
|
|
212 |
|
|
213 |
^ scm notNil
|
|
214 |
and:[ scm isLoaded
|
|
215 |
and:[ scm shownInBrowserMenus ]]
|
|
216 |
|
|
217 |
"Created: / 18-01-2012 / 10:55:58 / cg"
|
|
218 |
!
|
|
219 |
|
17909
|
220 |
hasSubversionSupport
|
|
221 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator
|
17910
|
222 |
^ (Smalltalk at: #'SVN::SVNSourceCodeManager' ifAbsent:nil) notNil
|
17859
|
223 |
|
|
224 |
"
|
|
225 |
ConfigurableFeatures hasSubversionSupport
|
|
226 |
"
|
|
227 |
|
|
228 |
"Created: / 07-09-2011 / 10:40:40 / cg"
|
|
229 |
!
|
|
230 |
|
|
231 |
hasSubversionSupportEnabled
|
17910
|
232 |
^ self hasSCMSupportEnabledFor:#'SVNSourceCodeManager'
|
17859
|
233 |
|
|
234 |
"Created: / 07-09-2011 / 10:41:33 / cg"
|
|
235 |
! !
|
|
236 |
|
|
237 |
!ConfigurableFeatures class methodsFor:'documentation'!
|
|
238 |
|
|
239 |
version
|
17910
|
240 |
^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.5 2012/01/18 10:00:40 cg Exp $'
|
17859
|
241 |
!
|
|
242 |
|
|
243 |
version_CVS
|
17910
|
244 |
^ 'Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.5 2012/01/18 10:00:40 cg Exp '
|
17865
|
245 |
!
|
|
246 |
|
|
247 |
version_SVN
|
17910
|
248 |
^ '$Id: ConfigurableFeatures.st 10758 2012-01-19 10:06:02Z vranyj1 $'
|
17865
|
249 |
! !
|
17892
|
250 |
|
17907
|
251 |
|
17909
|
252 |
|
17910
|
253 |
|