Skip to content

Commit

Permalink
Issue #135: finish up the Admin>DoIt submenu ... project summary,…
Browse files Browse the repository at this point in the history
… `gs configuration`, `gs sessionReport` commands added, `gs version` command expanded, `ol` commands refactored for use st api
  • Loading branch information
dalehenrich committed Feb 7, 2015
1 parent 8b497aa commit 922c174
Show file tree
Hide file tree
Showing 42 changed files with 421 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gsManPage
SYNOPSIS
# gs dataDir
gs configuration [--gem|--stone]
gs fileout -d<filesystem-path>|--directory=<filesystem-path>
[--class|--package|--category] <fileout-pair>...
gs halt -m|--almostOutOfMemory=<percent>
Expand All @@ -18,7 +19,8 @@ SYNOPSIS
gs objectFor <object-oop>
gs references @<object-path>
gs sessionDescription
gs version
gs sessionReport
gs version [--client|--gem|--stone]
DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
as yet unclassified
gsSessionReportOn: aStream
System currentSessions
do: [ :idx |
| sessionArray |
sessionArray := System descriptionOfSession: idx.
aStream
nextPutAll: idx asString , ': ';
nextPutAll: 'User: ' , (sessionArray at: 1) userId;
nextPutAll: ' | SerialNumber: ' , (sessionArray at: 9) asString;
nextPutAll: ' | PID: ' , (sessionArray at: 2) asString;
nextPutAll: ' | IP-Adr.: ' , (sessionArray at: 11) asString;
nextPutAll: ' | RefOldestCR: ' , (sessionArray at: 8) asString;
cr ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
gsconfiguration: reportType
reportType == #'gem'
ifTrue: [ ^ System gemConfigurationReport ].
reportType == #'stone'
ifTrue: [ ^ System stoneConfigurationReport ].
self error: 'Unknown reportType (#gem, #stone): ' , reportType printString
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
as yet unclassified
gsconfiguration
"
gs configuration [--gem|--stone]
"

| reportDict reportType |
self
getOptsMixedLongShort:
{#('gem' nil #'none').
#('stone' nil #'none')}.
self options
at: 'gem'
ifPresent: [ :ignored | reportType := #'gem' ]
ifAbsent: [
self options
at: 'stone'
ifPresent: [ :ignored | reportType := #'stone' ]
ifAbsent: [ reportType := #'stone' ] ].
reportDict := self gsconfiguration: reportType.
reportDict edit: self topez.
^ reportDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
as yet unclassified
gssessionReport
"
gs sessionReport
"

| aStream report |
self getOptsMixedLongShort: {}.
aStream := WriteStream on: String new.
self gsSessionReportOn: aStream.
report := aStream contents.
report edit: self topez.
^ report
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
as yet unclassified
gsversion: reportType
reportType == #'client'
ifTrue: [ ^ System clientVersionReport ].
reportType == #'gem'
ifTrue: [ ^ System gemVersionReport ].
reportType == #'stone'
ifTrue: [ ^ System stoneVersionReport ].
self
error:
'Unknown reportType (#client, #gem, #stone): ' , reportType printString
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
as yet unclassified
gsversion
"gs version"
"
gs version [--client|--gem|--stone]
"

^ System gemVersionReport
editUsing: (TDEditorSpec topez: topez editorAspect: #'edit')
| reportDict reportType |
self
getOptsMixedLongShort:
{#('client' nil #'none').
#('gem' nil #'none').
#('stone' nil #'none')}.
self options
at: 'client'
ifPresent: [ :ignored | reportType := #'client' ]
ifAbsent: [
self options
at: 'gem'
ifPresent: [ :ignored | reportType := #'gem' ]
ifAbsent: [
self options
at: 'stone'
ifPresent: [ :ignored | reportType := #'stone' ]
ifAbsent: [ reportType := #'stone' ] ] ].
reportDict := self gsversion: reportType.
reportDict edit: self topez.
^ reportDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ol
olClear
^ self olClear: #() age: nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ol
olClear: priorities
"priorities:
debug
error
fatal
info
interaction
trace
transcript
warn
"

^ self olClear: priorities age: nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ol
olClear: priorities age: aDateAndTimeOrNil
"priorities:
debug
error
fatal
info
interaction
trace
transcript
warn
"

| objectLog |
priorities isEmpty
ifTrue: [
"clear all - most efficient to simply reset the collections"
ObjectLogEntry initialize.
^ true ].
objectLog := ObjectLogEntry objectLog.
objectLog copy
do: [ :entry |
(priorities includes: entry priority)
ifTrue: [
aDateAndTimeOrNil
ifNil: [ objectLog remove: entry ]
ifNotNil: [
objectLog stamp < aDateAndTimeOrNil
ifTrue: [ objectLog remove: entry ] ] ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ol
olView
^ self
olView: [
System commitTransaction.
ObjectLogEntry objectLog ]
reversed: false
label: 'Object log'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ol
olView: objectLogBlock reversed: reversed label: label
^ (TDObjectLogEntryBrowser new
topez: self topez;
reversed: reversed;
objectLogBlock: objectLogBlock;
windowLabel: label;
yourself) open
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,5 @@ olclear
ifPresent: [ :durationExpression | age := DateAndTime now - durationExpression evaluate ].
priorities := args
collect: [ :priorityName | ObjectLogEntry perform: priorityName ].
priorities isEmpty
ifTrue: [
"clear all - most efficient to simply reset the collections"
ObjectLogEntry initialize.
^ true ].
objectLog := ObjectLogEntry objectLog.
objectLog copy
do: [ :entry |
(priorities includes: entry priority)
ifTrue: [
age
ifNil: [ objectLog remove: entry ]
ifNotNil: [
objectLog stamp < age
ifTrue: [ objectLog remove: entry ] ] ] ].
self olClear: priorities age: age.
^ true
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ olview
at: 'age'
ifPresent: [ :durationExpression | age := DateAndTime now - durationExpression evaluate ].
subOptions at: 'pid' ifPresent: [ :arg | pid := arg asNumber ].
(TDObjectLogEntryBrowser new
topez: self topez;
reversed: reversed;
objectLogBlock: [
| objectLog |
System commitTransaction.
objectLog := objectLog := ObjectLogEntry objectLog.
pid
ifNotNil: [ objectLog := objectLog select: [ :each | each pid = pid ] ].
age
ifNotNil: [ objectLog := objectLog select: [ :each | each stamp >= age ] ].
priorities isEmpty
ifFalse: [ objectLog := objectLog select: [ :each | priorities includes: each priority ] ].
objectLog ];
windowLabel: 'Object log ' , subCommand commandLine printString;
yourself) open
self
olView: [
| objectLog |
System commitTransaction.
objectLog := ObjectLogEntry objectLog.
pid
ifNotNil: [ objectLog := objectLog select: [ :each | each pid = pid ] ].
age
ifNotNil: [ objectLog := objectLog select: [ :each | each stamp >= age ] ].
priorities isEmpty
ifFalse: [ objectLog := objectLog select: [ :each | priorities includes: each priority ] ].
objectLog ]
reversed: reversed
label: 'Object log ' , subCommand commandLine printString
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"burestoreManPage" : "dkh 04/20/2014 17:00",
"defaulBackupDirectoryName" : "dkh 04/20/2014 20:51",
"gs" : "dkh 11/10/2013 10:29",
"gsManPage" : "dkh 02/04/2015 11:32",
"gsManPage" : "dkh 02/07/2015 11:17",
"initialize" : "dkh 01/14/2014 18:41",
"installOn:" : "dkh 05/14/2013 11:19",
"lastBackup:" : "dkh 08/02/2013 12:10",
Expand Down Expand Up @@ -42,6 +42,9 @@
"gsMFC" : "dkh 02/06/2015 16:33",
"gsMFC:" : "dkh 02/06/2015 16:31",
"gsMFCDefaultMaxThreads" : "dkh 02/06/2015 16:37",
"gsSessionReportOn:" : "dkh 02/07/2015 11:14",
"gsconfiguration" : "dkh 02/07/2015 10:18",
"gsconfiguration:" : "dkh 02/07/2015 10:19",
"gsfileOutMethods:on:" : "dkh 11/11/2013 14:35",
"gsfileSizeReport" : "dkh 12/31/2014 11:48",
"gsfileout" : "dkh 11/11/2013 16:51",
Expand All @@ -65,9 +68,16 @@
"gsmfc" : "dkh 02/06/2015 16:33",
"gsobjectFor" : "dkh 01/14/2014 17:17",
"gssessionDescription" : "dkh 11/14/2013 16:54",
"gsversion" : "dkh 01/31/2014 14:59",
"gssessionReport" : "dkh 02/07/2015 11:16",
"gsversion" : "dkh 02/07/2015 10:12",
"gsversion:" : "dkh 02/07/2015 10:12",
"olClear" : "dkh 02/07/2015 10:45",
"olClear:" : "dkh 02/07/2015 10:44",
"olClear:age:" : "dkh 02/07/2015 10:44",
"olPriorities" : "dkh 06/03/2014 15:28",
"olclear" : "dkh 06/02/2014 21:37",
"olview" : "dkh 11/30/2014 10:32",
"olView" : "dkh 02/07/2015 10:58",
"olView:reversed:label:" : "dkh 02/07/2015 10:54",
"olclear" : "dkh 02/07/2015 10:44",
"olview" : "dkh 02/07/2015 10:57",
"resolveBackupFilePath" : "dkh 04/26/2014 13:14",
"resolveBackupPath:" : "dkh 02/06/2015 15:57" } }

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
editItMenuAction: listElement selectedText: selectedString
| result |
result := self evaluateString: selectedString.
result edit: listElement topez.
^ true
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ smalltalkMenuActionSpec
^ {#('do it' $d #'doItMenuAction:selectedText:').
#('print it' $p #'printItMenuAction:selectedText:').
#('inspect it' $i #'inspectItMenuAction:selectedText:').
#('edit it' nil #'editItMenuAction:selectedText:').
#('debug it' $D #'debugItMenuAction:selectedText:').
#('profile it' nil #'profileItMenuAction:selectedText:').
#('tode it' $t #'todeItMenuAction:selectedText:')}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"doItLiteralArray" : "dkh 04/28/2014 17:37",
"doItMenuAction:selectedText:" : "dkh 03/30/2014 08:00",
"doItSymbolList" : "dkh 03/24/2014 19:11",
"editItMenuAction:selectedText:" : "dkh 02/07/2015 09:18",
"editMenuActionSpec" : "dkh 03/26/2014 14:23",
"elementSource" : "dkh 12/06/2013 10:52",
"elementSource:clientSourceElement:" : "dkh 06/20/2014 12:12",
Expand All @@ -48,7 +49,7 @@
"searchMenuActionSpec" : "dkh 06/22/2014 12:06",
"sendersOfItMenuAction:selectedText:" : "dkh 06/03/2014 14:23",
"setBlock" : "dkh 06/29/2014 10:16",
"smalltalkMenuActionSpec" : "dkh 08/07/2014 18:15",
"smalltalkMenuActionSpec" : "dkh 02/07/2015 11:33",
"standardMenuActionSpec" : "dkh 04/18/2014 07:18",
"textMenuActionSpec" : "dkh 03/29/2014 12:18",
"theBehavior" : "dkh 02/23/2014 18:42",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitChangedPackagesAndMethods: listElement selectedIndex: index
| projectTool |
projectTool := self topez toolInstanceFor: 'project'.
projectTool projectsummary.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitClearObjectLog: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
gsTool olClear.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitClientVersionReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
(gsTool gsversion: #'client') edit: listElement topez.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitFileSizeReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
gsTool gsfileSizeReport edit: listElement topez.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitGemConfigReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
(gsTool gsconfiguration: #'gem') edit: listElement topez.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitGemVersionReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
(gsTool gsversion: #'gem') edit: listElement topez.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitSessionReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
gsTool gssessionReport.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu actions
doitStoneConfigReport: listElement selectedIndex: index
| gsTool |
gsTool := self topez toolInstanceFor: 'gs'.
(gsTool gsconfiguration: #'stone') edit: listElement topez.
^ true
Loading

0 comments on commit 922c174

Please sign in to comment.