-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from ba-st/gs64_tools
Add extensions and tooling to support transient, invariant and non-persistent GS64 options in Tonel
- Loading branch information
Showing
10 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# How to support GS64 class options | ||
|
||
GemStone/S 64 includes some options during class creation that change the | ||
behavior of instances of that class. | ||
|
||
Rowan has support to specify these options using the Tonel format | ||
by filling the `gs_options` metadata in the class creation section. However, | ||
Pharo will be default remove this metadata when committing code, which loses these | ||
options. To avoid this behavior and retain the options, load the `Tool` group | ||
and send in the class `initialize` message one of the following messages: | ||
|
||
- `makeInstancesDbTransient` | ||
- `makeInstancesInvariant` | ||
- `makeInstancesNonPersistent` | ||
|
||
This will configure the options as class properties in Pharo, which will then be | ||
used by the Tonel Writer to set these options to the metadata. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Extension { #name : 'Behavior' } | ||
|
||
{ #category : '*Buoy-Development-Tools' } | ||
Behavior >> inspectionGs64Options: builder [ | ||
|
||
<inspectorPresentationOrder: 916 title: 'GS64 Options'> | ||
^ builder newTable | ||
addColumn: ( SpStringTableColumn title: 'Option' evaluated: [ :option | option ] ); | ||
items: ( self propertyAt: #gs_options ); | ||
yourself | ||
] | ||
|
||
{ #category : '*Buoy-Development-Tools' } | ||
Behavior >> inspectionGs64OptionsContext: aContext [ | ||
|
||
aContext active: ( self hasProperty: #gs_options ) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Extension { #name : 'TonelWriterV3' } | ||
|
||
{ #category : '*Buoy-Development-Tools' } | ||
TonelWriterV3 >> typeClassDefinitionOf: aClassDefinition [ | ||
|
||
| definition | | ||
definition := OrderedDictionary new. | ||
self | ||
at: #name put: aClassDefinition className in: definition; | ||
at: #superclass put: aClassDefinition superclassName in: definition. | ||
aClassDefinition type = #normal ifFalse: [ self at: #type put: aClassDefinition type in: definition ]. | ||
aClassDefinition hasTraitComposition ifTrue: [ definition at: #traits put: aClassDefinition traitCompositionString ]. | ||
aClassDefinition hasClassTraitComposition ifTrue: [ definition at: #classTraits put: aClassDefinition classTraitCompositionString ]. | ||
aClassDefinition instVarNames ifNotEmpty: [ :vars | definition at: #instVars put: vars asArray ]. | ||
(aClassDefinition variables | ||
select: #isClassVariable | ||
thenCollect: #name) ifNotEmpty: [ :vars | definition at: #classVars put: vars asArray ]. | ||
(aClassDefinition variables | ||
select: #isPoolImport | ||
thenCollect: #name) ifNotEmpty: [ :vars | definition at: #pools put: vars asArray ]. | ||
aClassDefinition classInstVarNames ifNotEmpty: [ :vars | definition at: #classInstVars put: vars asArray ]. | ||
self setPackageInfoOf: aClassDefinition in: definition. | ||
"Write gs_options if available as class properties" | ||
(aClassDefinition actualClass propertyAt: #gs_options) ifNotNil: [ :options | definition at: #gs_options put: options ]. | ||
^ self toSTON: definition | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : #'Buoy-Development-Tools' } | ||
Package { #name : 'Buoy-Development-Tools' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
source/Buoy-Metaprogramming-Pharo-Extensions/PharoPlatform.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
source/Buoy-Metaprogramming-Pharo-Extensions/Symbol.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : #'Buoy-Metaprogramming-Pharo-Extensions' } | ||
Package { #name : 'Buoy-Metaprogramming-Pharo-Extensions' } |