为了避免过度开采的风险,我通常首先需要直接纳入申请。 然后,一旦我需要将同一特点运用到另一个项目中,我就检查是否值得把它引入一个假想,或者甚至另立申请,提供一种APIC。
Plugins and Gems are often interchangeable. Gems provides several significant advantages in terms of reusability and maintainability.
On the other side, there are some specific known issue. For instance, a Rails app actually can t load rake tasks defined into a plugin packaged as a Gem.
Almost every Rails plugin can be packaged as a Gem.
For instance, take my tabs_on_rails plugin.
你们可以把它装成一个宝石,具体说明对环境的依赖。 或如你所期望的那样,你可以使用<条码>/插图>指令。
If you want to achieve the same result, make sure to follow the standard Gem layout and provide the init.rb
initialization script required by Rails.
Also, you might want to create an install.rb
and uninstall.rb
file to include the post-install and post-uninstall hooks when the plugin is installed as a standard Rails plugin.
最后但并非最不重要的是,如果你把一个金块作为宝石,你就可以在非石油项目中重新使用,并使用<条码>init.rb文档提供铁路特定初始化。 非种族主义者的申请将完全忽视。