English 中文(简体)
为铁路应用建造一个垃圾箱
原标题:Building a ruby gem for Rails applications

作为铁路开发商,我感到有点 st,问这个问题,但我希望我会学习新的东西,有人会把我带走! 在我的铁路应用中,我(其他民族)每次都使用烟雾,我还使用来自社区或我本人的假肢。

我理解使用宝石对花 the的好处,因为它们是可使用、分散、系统广泛、易于管理和分享等,但我并不真正知道如何为我们的铁路做一杯?

你们是否总是以gin子为开端,把它变成em子,我把这段话的包装视为宝石。 而且,建筑的灰色一米思维在通常的废墟方案中不会很好,它只会对铁路机体有用。 我甚至不敢肯定,如果这样说,鲁拜格姆就只能使用铁路。

我要为我的铁路线设计一个单独的功能。 它将需要增加一个数据库迁移、新的路线,并提供控制者、看法或有用的观察者。 我知道,我可以通过一个插头来实现这一目标,但我只想知道,它作为Ruby Gem做些什么?

最佳回答

为了避免过度开采的风险,我通常首先需要直接纳入申请。 然后,一旦我需要将同一特点运用到另一个项目中,我就检查是否值得把它引入一个假想,或者甚至另立申请,提供一种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文档提供铁路特定初始化。 非种族主义者的申请将完全忽视。

问题回答




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签