ruby - Guard running only the first watcher that matches -
is there way prevent guard run watchers match file structure first one?
i need instantiate different object if file copied in root folder has specific structure or not. instance, if file name matches \d{2}-\d{6}_\d{5}_\d+_\d+.csv need instances object while other .cvs files object b.
as first attempt trying use negative lookbehind due lookbehind limitations looks cannot that. so, i'm trying force guard execute first watcher matches.
my guardfile looks like
guard :my_csv_files watch(%r{^\d{2}-\d{6}_\d{5}_\d+_\d+.csv$}) end guard :others_csv_files watch(%r{^.+.csv$}) end thanks
this has been available while, never documented. (until today).
there's :first_match option, want:
https://github.com/guard/guard/wiki/guardfile-dsl---configuring-guard#guard
Comments
Post a Comment