gpt4 book ai didi

Ruby Guard Watch 的运行速度非常慢

转载 作者:太空宇宙 更新时间:2023-11-03 17:10:29 26 4
gpt4 key购买 nike

我使用的是最新版本的 Guard 和 Guard-Haml。我的根目录中有 7 张 map ,我将 Haml 文件存储在两个不同的目录中。一个在/templates/haml 中,一个在/haml 中。 haml文件的总和小于10。

在其他 5 个 map 中,我有大约 17 000 个文件。我已将守卫配置为仅在/haml 和/templates/haml map 中观察变化。在我开始使用 bundle exec guard 后它工作正常,但过了一会儿它变得很慢。从我对文件进行更改开始大约 30 秒后,它会重新编译文件。

这是我的保护文件

require 'haml/helpers'
require 'haml/filters'
require 'haml/filters/php'

guard :haml, input: 'www/templates/haml', output: 'www/templates', :haml_options => { :escape_attrs => false } do
watch %r{^www/templates/haml/.+(\.haml)$}
end

guard :haml, input: 'www/haml', output: 'www/', :haml_options => { :escape_attrs => false } do
watch %r{^www/haml/.+(\.haml)$}
end

我能做些什么来加快速度,因为它确实减慢了我的开发速度。向下。

最佳答案

我发现我可以使用 ignore 命令 并忽略所有我不想让 guard 查看的目录。示例:

ignore([%r{^node_modules/*}])

Link to more details about this

关于Ruby Guard Watch 的运行速度非常慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25141231/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com