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

jicheng1014 · June 12, 2020 · 2306 hits

其实原理就是共享写的一些常用的 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
No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.