简体   繁体   English

将 Rails Gem / Engine 转换为应用程序

[英]Convert a Rails Gem / Engine to an application

The rails engines feature is pretty good, and I have watched the Railcasts and read the Rails documentation on it. rails 引擎功能非常好,我看过 Railcasts 并阅读了有关它的 Rails 文档。 I can see how you can access or override all the relevant components in the engine.我可以看到您如何访问或覆盖引擎中的所有相关组件。

However, say I wanted to drastically modify the engine's code, is it possible to convert the engine back into a normal Rails app, and then take it from there.但是,假设我想彻底修改引擎的代码,是否可以将引擎转换回普通的 Rails 应用程序,然后从那里获取它。 Is there anything else involved other than copying the directories in the gem over an empty application directory?除了将 gem 中的目录复制到一个空的应用程序目录中之外,还有其他任何事情吗?

I am looking at this engine:我在看这个引擎:

https://github.com/ging/social_stream https://github.com/ging/social_stream

Yeah you can, just go to https://github.com/rails/rails & hit the fork button to fork the repository to your github account (assuming you already have one setup).是的,您可以,只需转到https://github.com/rails/rails并点击 fork 按钮将存储库分叉到您的 github 帐户(假设您已经有一个设置)。 Afterwards, clone the forked project to your local machine with:然后,使用以下命令将分叉的项目克隆到本地计算机:

git clone your_forked_repository_url.git 

If you don't feel the need to fork your own version run:如果您觉得不需要 fork 自己的版本,请运行:

git clone git://github.com/rails/rails.git

At this point you can make modifications to your heart's content.此时,您可以修改您的心脏内容。 To use a local copy of the gem in a rails application add the following to your Gemfile (replacing the old rails gem):要在 rails 应用程序中使用 gem 的本地副本,请将以下内容添加到您的 Gemfile(替换旧的 rails gem):

gem "rails", :path => "/somewhere/your_rails_project"

All of this and more is highlighted in http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html所有这些以及更多内容都在http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html 中突出显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM