更改 Rake 文件任务先决条件中的路径



我有一个硬编码的文件任务

file 'feed.json' => 'lib/feed.rb'

如何使用匹配模式

file '*.json' => 'lib/$1.rb' # Like this (this is pseudocode)

这能解决问题吗?

source_files = Rake::FileList.new("lib/*.md")
task :default => :json
task :json => source_files.ext(".rb")
rule ".json" => ".rb" do |t|
# here what you need to be done
end

对Wacht来说,这个视频可能会有所帮助。

最新更新