Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在对Guardfile以外的文件进行更改时重新加载Guardfile_Ruby_Guard - Fatal编程技术网

Ruby 在对Guardfile以外的文件进行更改时重新加载Guardfile

Ruby 在对Guardfile以外的文件进行更改时重新加载Guardfile,ruby,guard,Ruby,Guard,目前 我正在将一些额外的代码加载到我的保护文件中(通过require),并且我还希望在某些必需的文件更改时重新加载 我想我真的只是在寻找一个插件,但这似乎是我要尝试复活。有没有更好的方法来实现这一点?您可以在Guardfile中尝试类似的方法(使用): @扎克:最新的文档位于(用法)和(技术)。是一种DSL方法,您应该能够在Guardfile matcher中使用。但是我应该在哪个Guardfile插件下声明该matcher?(我是不是误解了DSL?似乎所有东西都需要在一个保护区内:某个块)嗯,

目前

我正在将一些额外的代码加载到我的保护文件中(通过
require
),并且我还希望在某些必需的文件更改时重新加载


我想我真的只是在寻找一个插件,但这似乎是我要尝试复活。有没有更好的方法来实现这一点?

您可以在Guardfile中尝试类似的方法(使用):


@扎克:最新的文档位于(用法)和(技术)。

是一种DSL方法,您应该能够在Guardfile matcher中使用。但是我应该在哪个Guardfile插件下声明该matcher?(我是不是误解了DSL?似乎所有东西都需要在一个保护区内:某个块)嗯,我想我看了一个旧版本的文档,因为我无法让它在
监视
块中工作。
guard :shell do
  watch(%r{path/to/your/required/files}) { Guard.evaluator.reevaluate_guardfile }
end