tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,19 @@
|
|||
dict := Dictionary new.
|
||||
configFile asFilename readingLinesDo:[:line |
|
||||
(line isEmpty or:[ line startsWithAnyOf:#('#' ';') ]) ifFalse:[
|
||||
s := line readStream.
|
||||
(s skipSeparators; atEnd) ifFalse:[
|
||||
|optionName values|
|
||||
optionName := s upToSeparator.
|
||||
values := (s upToEnd asCollectionOfSubstringsSeparatedBy:$,)
|
||||
collect:[:each | each withoutSeparators]
|
||||
thenSelect:[:vals | vals notEmpty].
|
||||
dict at:optionName asLowercase put:(values isEmpty
|
||||
ifTrue:[true]
|
||||
ifFalse:[
|
||||
values size == 1
|
||||
ifTrue:[values first]
|
||||
ifFalse:[values]]).
|
||||
]
|
||||
].
|
||||
]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
dict keysAndValuesDo:[:eachOption :eachValue |
|
||||
someObject
|
||||
perform:(eachOption,':') asSymbol with:eachValue
|
||||
ifNotUnderstood: [ self error: 'unknown option: ', eachOption ]
|
||||
]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
fullname := dict at: 'fullname' ifAbsent:false.
|
||||
needspeeling := dict at: 'needspeeling' ifAbsent:false.
|
||||
favouritefruit := dict at: 'favouritefruit' ifAbsent:false.
|
||||
otherfamily := dict at: 'otherfamily' ifAbsent:false.
|
||||
seedsremoved := dict at: 'seedsremoved' ifAbsent:false.
|
||||
Loading…
Add table
Add a link
Reference in a new issue