|
1 "{ Package: 'stx:goodies/cypress' }" |
|
2 |
|
3 Object subclass:#CypressModel |
|
4 instanceVariableNames:'name properties' |
|
5 classVariableNames:'' |
|
6 poolDictionaries:'' |
|
7 category:'Cypress-New-Model' |
|
8 ! |
|
9 |
|
10 !CypressModel class methodsFor:'documentation'! |
|
11 |
|
12 documentation |
|
13 " |
|
14 An abstract class to model packages, classes and methods. |
|
15 |
|
16 [author:] |
|
17 Jan Vrany <jan.vrany@fit.cvut.cz> |
|
18 |
|
19 [instance variables:] |
|
20 |
|
21 [class variables:] |
|
22 |
|
23 [see also:] |
|
24 |
|
25 " |
|
26 ! ! |
|
27 |
|
28 !CypressModel methodsFor:'accessing'! |
|
29 |
|
30 name |
|
31 ^ name |
|
32 ! |
|
33 |
|
34 name:something |
|
35 name := something. |
|
36 ! |
|
37 |
|
38 package |
|
39 "Returns a CypressPackage which the receiver belongs to" |
|
40 |
|
41 ^self subclassResponsibility |
|
42 |
|
43 "Created: / 10-09-2012 / 23:42:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
44 ! |
|
45 |
|
46 properties |
|
47 ^ properties |
|
48 ! ! |
|
49 |
|
50 !CypressModel methodsFor:'reading & writing'! |
|
51 |
|
52 readFrom: filename |
|
53 "Initializes the receiver from directory/file named 'filename'" |
|
54 |
|
55 self subclassResponsibility |
|
56 |
|
57 "Created: / 11-09-2012 / 00:18:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
58 ! |
|
59 |
|
60 writeTo: filename notice: copyrightNotice |
|
61 "Writes the receiver into directory/file named 'filename' |
|
62 with given copyrightNotice" |
|
63 |
|
64 self subclassResponsibility |
|
65 |
|
66 "Created: / 11-09-2012 / 00:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67 ! ! |
|
68 |
|
69 !CypressModel methodsFor:'reading & writing - private'! |
|
70 |
|
71 writePropertiesTo: directory notice: copyrightNotice |
|
72 | props propertyFile | |
|
73 |
|
74 props := self properties. |
|
75 props isEmpty ifTrue:[ ^ self ]. |
|
76 propertyFile := directory / 'properties.ston'. |
|
77 propertyFile writingFileDo:[:s| |
|
78 props copy; |
|
79 at: '_cypress_copyright' put: copyrightNotice; |
|
80 writeCypressJsonOn: s forHtml: false indent: 0. |
|
81 ] |
|
82 |
|
83 "Created: / 11-09-2012 / 00:24:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
84 ! ! |
|
85 |
|
86 !CypressModel class methodsFor:'documentation'! |
|
87 |
|
88 version_SVN |
|
89 ^ '$Id:: $' |
|
90 ! ! |