开发者

Copying files from a Rails plugin into the application upon plugin install

开发者 https://www.devze.com 2022-12-23 18:08 出处:网络
When someone installs this plugin, I would like a file to be copied into the config/initializers directory of t开发者_Python百科he app.I could do this in install.rb by copying a template file that res

When someone installs this plugin, I would like a file to be copied into the config/initializers directory of t开发者_Python百科he app. I could do this in install.rb by copying a template file that resides somewhere in the plugin. Another option would be to require the user to run a generator after install. I know rspec-rails makes you run a generator after you install it, is that the recommended behavior?

And is there anything wrong with copying files into the application in install.rb?

Thanks!

Lou


Does the user need to manually tweak the file? If so, then I would use a generator with parameters. If not, I would prefer that you do it with install.rb. My $.02

0

精彩评论

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