Gem Engine 跟 Gem 的区别

luffycn · 2014年11月20日 · 最后由 luffycn 回复于 2014年11月20日 · 2142 次阅读

看了下 http://guides.rubyonrails.org/engines.html 这篇关于 engine 的介绍

目前的疑惑是什么时候应该用 engine,什么时候用 gem ?

devise 就是 engine,我觉得需要 mount 的就可以作为 engine 吧。

Engine is a gem. Rails is also a gem with many dependency gem.

To see demonstrations of other engines, check out Devise, an engine that provides authentication for its parent applications, or Forem, an engine that provides forum functionality. There's also Spree which provides an e-commerce platform, and RefineryCMS, a CMS engine.

换句话说,engine 更像一个模块。

http://stackoverflow.com/questions/23118472/gem-vs-plugin-vs-engine-in-ruby-on-rails 自己找了这篇文章,某种程度上算是解答我的疑惑了吧

需要 登录 后方可回复, 如果你还没有账号请 注册新账号