Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

guard gem run all triggers on start

Tags:

ruby

rspec

guard

How do I trigger a "run_all" for all guards in the Guardfile?

When I run "guard" in the shell, I want it to sort off pretend like all files have changed and trigger all guards.

What's a clean way to do this from the Guardfile?

like image 819
ulver Avatar asked Oct 21 '25 01:10

ulver


2 Answers

Create a guardfile on the root of the app and set the guard config to something like rspec example:

guard 'rspec', :version => 2, :all_on_start => false do
like image 73
rafamvc Avatar answered Oct 23 '25 18:10

rafamvc


This happens for me with no additional configuration. I've noticed that some guards have options to override this behavior. For instance, guard-rspec has the all_on_start option, which you can set to false if you don't want to run your specs when you fire up guard.

As specified in the guard readme, if you are using guard >= 0.7.0, you can press enter to call each guards #run_all method in the order they are listed in the Guardfile. Try that?

like image 43
Derek Prior Avatar answered Oct 23 '25 18:10

Derek Prior



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!