Skip to content

Commit

Permalink
Issue #4: now that the rubber's hitting the road, it looks like TDCom…
Browse files Browse the repository at this point in the history
…mandLine is needed
  • Loading branch information
dalehenrich committed Jun 6, 2023
1 parent 7ae35ae commit 2c3db42
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 82 deletions.
84 changes: 84 additions & 0 deletions bin/todeIt.solo
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env superdoit_solo
options
{
}
%
Usage
-----
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] [-v | --verbose] \
--registry=<registry-name> <stone-name>

DESCRIPTION
This script is designed to run in the stone of interest and picks up the stone
information from the .GDKStoneSpec.ston file in the stone directory.

OPTIONS
-h, --help display usage message
-D, --debug bring up topaz debugger in the event of a script error
--debugGem If terminal is connected to stdout, bring up debugger. If not,
dump stack to stdout and wait for topaz to attach using topaz
DEBUGGEM command.

EXAMPLES
$basename --help
$basename -D
$basename --debugGem
$basename "3+4"
-----
%
specs
[
RwLoadSpecificationV2 {
#projectName : 'GsDevKit_stones',
#projectSpecFile : 'rowan/project.ston',
#componentNames : [
'Core',
'Solo'
],
#platformProperties : {
'gemstone' : {
'allusers' : {
#defaultSymbolDictName : 'Globals'
}
}
},
#comment : ''
},
RwLoadSpecificationV2 {
#projectName : 'GsCommands',
#projectSpecFile : 'rowan/project.ston',
#diskUrl : '$GEMSTONE/examples/GsCommands/projectsHome/GsCommands',
#componentNames : [
'Commands'
],
#platformProperties : {
'gemstone' : {
'allusers' : {
#defaultSymbolDictName : 'UserGlobals'
}
}
},
#comment : ''
}
]
%
doit
| registryClass stoneSpec sessionDescription |
self preDoitSpecLoad: [:spec |
spec projectName = 'GsCommands'
ifTrue: [ spec projectsHome: '$GEMSTONE/examples/GsCommands/projectsHome' ]
ifFalse: [ spec projectsHome: self dirname asFileReference parent parent ] ].
registryClass := (self globalNamed: 'GDKRegistry').
self positionalArgs size = 0
ifTrue: [ self error: 'a tODE command must be entered on command line' ]
ifFalse: [
| specFile |
specFile := FileLocator workingDirectory asFileReference / '.GDKStoneSpec.ston'.
stoneSpec := (self globalNamed: 'GDKAbstractRegistryStore') fromPath: specFile ifAbsent: [] ].
sessionDescription := (self globalNamed: 'TDSessionDescription')
fromFile: stoneSpec todeHome asFileReference / 'sys' / 'local' / 'sessions' / stoneSpec stoneName.
(self globalNamed: 'TDShell')
sessionDescription: sessionDescription
evaluate: '3+4'
debugMode: self debug
%
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instance creation
fromFile: filePath
filePath asFileReference
readStreamDo: [ :fileStream |
| contents |
contents := fileStream contents.
^ STON fromString: contents ]

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
ston
fromSton: stonReader
stonReader
parseMapDo: [ :instVarName :value |
[ self instVarNamed: instVarName put: value ]
on: Error
do: [ :ignored |
"If the instance variable for a TDsessionDescription is missing ... it is for a good reason ... keep on truckin' ... if it's critical let's find out during execution rather than during import"
] ]
| allInstanceVariableNames |
allInstanceVariableNames := self stonInstVarNames.
stonReader
parseMapDo: [ :instVarName :value |
[
self
instVarAt: (allInstanceVariableNames indexOf: instVarName asSymbol)
put: value ]
on: Error
do: [ :ignored |
"If the instance variable for a TDsessionDescription is missing ... it is for a good reason ... keep on truckin' ... if it's critical let's find out during execution rather than during import"
] ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ston
stonInstVarNames
| oc |
oc := self class allInstVarNames asOrderedCollection.
oc removeAll: self excludedInstVarNames.
^ oc
^ self class allInstVarNames asOrderedCollection
3 changes: 0 additions & 3 deletions src/GsDevKit_stones-Tode.package/TDShell.class/class/open..st

This file was deleted.

5 changes: 0 additions & 5 deletions src/GsDevKit_stones-Tode.package/TDShell.class/class/open.st

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
evaluator engine
previousHistory
| editor windowMorph |
self history size = 0
ifTrue: [ ^ self ].
historyIndex > history size ifTrue: [ historyIndex := history size].
self
installHistoryEntry: (history at: historyIndex)
windowMorph: self shellWindow paneMorphs first.
historyIndex := (historyIndex - 1 max: 1) min: history size
self history size = 0
ifTrue: [ ^ self ].
historyIndex > history size
ifTrue: [ historyIndex := history size ].
self
installHistoryEntry: (history at: historyIndex)
windowMorph: self shellWindow paneMorphs first.
historyIndex := (historyIndex - 1 max: 1) min: history size

0 comments on commit 2c3db42

Please sign in to comment.