0
上。例如 https://github.com/locomotivecms/wagon/blob/master/Rakefile#L23耙子上「desc'描述」背後的魔術是什麼?
desc 'build the gem and release it to rubygems.org'
task release: :gem do
sh "gem push pkg/locomotivecms_wagon-#{gemspec.version}.gem"
end
當我跑rake --task
,它返回說明。
rake clobber_package # Remove package products
rake gem # Build the gem file locomotivecms_wagon-2.2.0.beta1.gem
rake package # Build all the packages
rake release # build the gem and release it to rubygems.org
rake repackage # Force a rebuild of the package files
rake spec # Run RSpec code examples
rake spec:integration # Run RSpec code examples
rake spec:unit # Run RSpec code examples
但我不明白他們怎麼可以採取描述,不是每次描述被調用時都被替換嗎?他們如何知道具體的描述屬於特定的任務?
感謝@mudasobwa的解釋。 – vigo