XUtils

ex_guard

ExGuard is a mix command to handle events on file system modifications.


ExGuard

ExGuard is a mix command to handle events on file system modifications, ExGuard heavily borrowed ideas/art works from Ruby Guard

ExGuard

Build Status Hex.pm Docs Hex.pm Deps Status Hex.pm

Why ExGuard and not mix-test.watch or eye_drops or XYZ

It’s just a matter of taste!

With ExGuard you can run multiple commands and the config looks nice.

use ExGuard.Config

guard("elixir test", run_on_start: true)
|> command("mix test --color")
#only run related phoenix test when a file changes
|> watch({~r{lib/(?<lib_dir>.+_web)/(?<dir>.+)/(?<file>.+).ex$}i, fn m -> "test/#{m["lib_dir"]}/#{m["dir"]}/#{m["file"]}_test.exs" end})
# only if the above pattern doesn't match try to match all elixir/erlang source 
|> watch(~r{\.(erl|ex|exs|eex|xrl|yrl)\z}i)
|> ignore(~r{deps})
|> notification(:off) #Disabled it and using ex_unit_notifier instead

guard("elm test", run_on_start: true)
|> command("elm-test assets/tests/")
|> watch(~r{\.(elm)\z}i)
|> ignore(~r{elm-stuff})
|> notification(:auto)

Articles

  • coming soon...