gpt4 book ai didi

ruby - 使用 CLEAN rake 任务的正确方法是什么?

转载 作者:数据小太阳 更新时间:2023-10-29 07:41:17 26 4
gpt4 key购买 nike

这就是我在 Rakefile 中尝试做的事情:

require 'rake/clean'
CLEAN = ['coverage']

这是我在日志中看到的:

$ rake
/code/foo/Rakefile:29: warning: already initialized constant CLEAN
/Users/foo/.rvm/gems/ruby-2.1.3/gems/rake-10.3.2/lib/rake/clean.rb:61: warning: previous definition of CLEAN was here

我不喜欢这些警告。什么是正确的方法?

最佳答案

CLEANFileList由预定义的 clean 任务使用。要添加您自己的要清理的文件,请将它们添加到此列表中。您可以使用 include 方法:

require 'rake/clean'
CLEAN.include 'coverage'

现在运行 rake clean 将删除您的文件,以及预定义的临时文件集(如果有已创建的 bean)。

关于ruby - 使用 CLEAN rake 任务的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27303575/

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