Perhaps groups will work for you?
# In your Guardfile group :focus do guard :ruby do watch('file_to_focus_on.rb') end end
I know that you mentioned that you do not want to change the Guardfile, but you need to add a group just once, not every time you switch from viewing a project to a focused set and vice versa.
Of course, if you need to focus on the changes in the fileset, you will need to change the arguments to watch (and possibly add more observers), but I suppose you will need to specify them somewhere, and this seems like a good place like any .
Alternatively, if you really do not want to list the files that you need to focus on in Guard File, you can get: a focus group read in the list of files from a separate file or environment variable, as suggested by David above . Guardfile is just ruby (with access to the security DSL), so it's easy to read a file or ENV variable.
exbinary
source share