-
Notifications
You must be signed in to change notification settings - Fork 0
New configuration DSL #4
Copy link
Copy link
Closed
Description
Currently there's a branch new-configuration with a simple DSL in it. Looks like this:
log_level "INFO"
spooked false
watch {"lib", "spec"}
map {
{"^(spec)/(spec_helper%.moon)": (a,b) -> "spec"}
{"^spec/(.*)%.moon": (a,b) -> "spec/#{a}.moon"}
{"^lib/(.*)%.moon": (a,b) -> "spec/#{a}_spec.moon"}
}
notifier "path/to/notifier.moon"
-- or
notifier {
start: (changed_file, mapped_file) -> do_stuff
finish: (status, changed_file, mapped_file) -> do_stuff
}
command "./spook -f spec/support/run_busted.lua"While that surely works, perhaps it might be useful to go a bit further (before merging)?
A more advanced option might be:
log_level "INFO"
spooked false
watch "lib spec" ->
command "./spook -f spec/support/run_busted.lua"
map "^(spec)/(spec_helper%.moon)": (a,b) -> "spec"
map "^spec/(.*)%.moon": (a,b) -> "spec/#{a}.moon"
map "^lib/(.*)%.moon": (a,b) -> "spec/#{a}_spec.moon"
watch "playground" ->
command "./spook -f"
map "^playground/(.*)%.moon": (a) -> "playground/#{a}.moon"
notifier "path/to/notifier.moon"
-- or
notifier {
start: (changed_file, mapped_file) -> do_stuff
finish: (status, changed_file, mapped_file) -> do_stuff
}
-- or maybe
notifier ->
start (changed_file, mapped_file) -> do_stuff
finish (status, changed_file, mapped_file) -> do_stuff
command "./spook -f spec/support/run_busted.lua"Might also want to think some more on sane defaults... should there be a default command? Is it meaningful to provide different notifiers per watch statement?
Could some be implemented while keeping watches simple for now while later they could support custom notifiers (without having to - again - change the Spookfile format and force anyone using this to change theirs, i.e backward compatible). Not that anyone but me is using spook afaik :-).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels