开发者

where to put custom install, e.g. rails g myapp:install

开发者 https://www.devze.com 2023-01-18 19:12 出处:网络
I\'ve seen people use this to install apps: rails g someapp:inst开发者_运维问答all This is a custom generation correct?

I've seen people use this to install apps:

rails g someapp:inst开发者_运维问答all

This is a custom generation correct? Where is the code to :install usually put or have to be put?


I think you would write a rake task, usually located in lib/tasks/; the filename would look like this: someapp_install.rake

And its contents like this:

namespace :someapp do 

  desc "This installs my awesome app"
  task :install => :environment do

    # Code that does install stuff goes here...

  end

end
0

精彩评论

暂无评论...
验证码 换一张
取 消