Skip to content

Instantly share code, notes, and snippets.

@dalehenrich
Created July 12, 2016 00:08
Show Gist options
  • Save dalehenrich/be9e7cd439eb5a5a0d9e937cc0a04f86 to your computer and use it in GitHub Desktop.
Save dalehenrich/be9e7cd439eb5a5a0d9e937cc0a04f86 to your computer and use it in GitHub Desktop.
TDScriptLeafNode{#name:'bug',#contents:'[ :topez :objIn :tokens :command |
| opts args |
\"for help: ./bug -h\"
command
getOptsMixedLongShort:
{#(\'help\' $h #\'none\').
#(\'boom\' nil #\'none\').
#(\'clean\' nil #\'none\').
#(\'create\' nil #\'none\').
#(\'install\' nil #\'none\')}
optionsAndArguments: [ :options :operands |
opts := options.
args := operands ].
opts
at: \'help\'
ifAbsent: [
| analysis theColl query |
analysis := Dictionary new.
Smalltalk
at: #\'SampleIndexObject\'
ifAbsent: [ opts at: \'install\' put: nil ].
opts
at: \'install\'
ifPresent: [ :ignored |
\"install supporting code here\"
topez evaluateCommandString: \'/home/gs/bugs/installSampleIndexObject\' ].
opts
at: \'clean\'
ifPresent: [ :ignored |
\"clean up indexes here\"
UserGlobals removeKey: #\'coll\' ifAbsent: [ ].
IndexManager removeAllIndexes ].
opts
at: \'create\'
ifPresent: [ :ignored |
| nsc cls |
nsc := IdentityBag new.
UserGlobals at: #\'coll\' put: nsc.
cls := Smalltalk at: #\'SampleIndexObject\'.
nsc
createEqualityIndexOn: \'value1\' withLastElementClass: SmallInteger;
yourself.
1 to: 500 do: [:ignored |
1 to: 2200 do: [ :index |
| sample |
sample := cls new.
sample
value1: index;
yourself.
nsc add: sample ].
System commit]
].
opts
at: \'boom\'
ifPresent: [ :ignored |
\"recreate bug here\"
].
theColl := UserGlobals at: #\'coll\' ifAbsent: [ Set new ].
query := \'each.value1 <= 1\' asQueryOn: theColl.
analysis
at: \'audit\' put: theColl auditIndexes;
at: \'depMap keys\' put: DependencyList depMapKeys;
at: \'depMap values\' put: DependencyList depMapValues;
at: \'nsc\' put: theColl;
at: \'query\' put: query;
at: \'query result\' put: query queryResult;
at: \'select result\' put: (theColl select: [ :each | each.value1 <= 1 ]);
at: \'shared dependency lists\'
put: SharedDependencyLists allEntries asArray;
yourself.
analysis ]
ifPresent: [ :ignored |
TDManPage
viewManPage:
\'NAME
bug - bug sript utility template
SYNOPSIS
bug [-h|--help]
bug [--install][--clean][--create][--boom]
DESCRIPTION
Reproduce bug.
EXAMPLES
./bug --help
./bug --install
./bug --clean --create --boom; edit
\'
topez: topez ] ]',#creationTime:DateAndTime['2016-05-17T12:30:05.600980043411255-07:00'],#modificationTime:DateAndTime['2016-05-17T16:13:09.609402894973755-07:00']}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment