io.streams.string ui.tools.operations quotations strings arrays
prettyprint words vocabs sorting sets classes math alien urls
splitting ascii combinators.short-circuit alarms words.symbol
-system ;
+system summary ;
IN: tools.scaffold
SYMBOL: developer-name
ERROR: vocab-name-contains-separator path ;
ERROR: vocab-name-contains-dot path ;
ERROR: no-vocab vocab ;
+ERROR: bad-developer-name name ;
+
+M: bad-developer-name summary
+ drop "Developer name must be a string." ;
<PRIVATE
] if ;
: scaffold-authors ( vocab-root vocab -- )
- "authors.txt" vocab-root/vocab/file>path scaffolding? [
- [ developer-name get ] dip utf8 set-file-contents
+ developer-name get [
+ dup string? [ bad-developer-name ] unless
+ "authors.txt" vocab-root/vocab/file>path scaffolding? [
+ utf8 set-file-contents
+ ] [
+ 2drop
+ ] if
] [
- drop
- ] if ;
+ 2drop
+ ] if* ;
: lookup-type ( string -- object/string ? )
"new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail