分享 excid3 弄的一个添加模块的网站 https://railsbytes.com 还有点意思

jicheng1014 · 2020年06月12日 · 2305 次阅读

其实原理就是共享写的一些常用的 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
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号