查看了一点关于制作gem包的,但是都是那种简单的打包。
我想要弄明白这个问题:如何制作一个Gem包,然后bundle install后能在rails程序内加入一个controller以及几个相应的页面。
黄舟2017-04-22 08:58:28
Your requirement needs to be called Rails::Generator
,想想看 rails generate
Isn’t this how the command works?
In fact, there are many ready-made Gems that you can use as a reference. Most of them bundle install
完了之后还要运行命令,比如说 rake xxx:install
或者 rake xxx:generate
will do this.
Recommend one to you: https://github.com/ryanb/nifty-generators, pay attention to the lib
generators below.