其实原理就是共享写的一些常用的 template 文件
我刚用的 添加 annotate, 还蛮简单的
rails app:template LOCATION="https://railsbytes.com/script/Vqqsqg"
等效于
gem_group :development do
gem 'annotate'
end
if yes?("Would you like to annotate all your models, tests, fixtures, and factories?")
run("annotate")
else
if yes?("Would you like to annotate just your models?")
run("annotate --models")
end
if yes?("Would you like to annotate just your routes?")
run("annotate --routes")
end
end
if yes?("Would you like to annotate every time you run db:migrate?")
run("rails g annotate:install")
end