-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extensions and tooling to support transient, invariant and non-persistent GS64 options in Tonel #121
Merged
Merged
Add extensions and tooling to support transient, invariant and non-persistent GS64 options in Tonel #121
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a0748df
Add extensions and tooling to support transient, invariant and non-pe…
gcotelli 148d1d3
Add how to
gcotelli 82e3604
Add inspector extensions to see gs_options
gcotelli 726ace4
Apply suggestions from code review
gcotelli 43a95e0
Fix formatting
gcotelli 9230fe9
Fix markdown lint
gcotelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
gcotelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] |
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' } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.