這就是我想在我的Rakefile做:什麼是使用CLEAN rake任務的正確方法?
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
我不喜歡這些警告。什麼是正確的方法?
非常感謝,這正是我一直在尋找的! – 2014-12-04 20:58:20
如果'coverage'是一個目錄,並且您想清除其中的所有內容,您還可以將'Rake :: Cleaner.cleanup_files'傳遞給'FileList':'Rake :: Cleaner.cleanup_files(FileList ['coverage/**/* '])' – mbigras 2016-12-31 18:17:17