ruby-on-rails - ruby on rails 的gem包如何制作
ringa_lee
ringa_lee 2017-04-22 08:56:28
0
1
777

查看了一点关于制作gem包的,但是都是那种简单的打包。
我想要弄明白这个问题:如何制作一个Gem包,然后bundle install后能在rails程序内加入一个controller以及几个相应的页面。

ringa_lee
ringa_lee

ringa_lee

reply all(1)
黄舟

Your requirement needs to be called Rails::Generator,想想看 rails generateIsn’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 libgenerators below.

In addition, if you are not very urgent to open source, for example, you only need to do it on a small scale, you can do it without Gem. Just take a look at Creating and Customizing Rails Generators & Templates in Rails Guides. Of course, this is also the same for writing Gem. helpful.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template