【发布时间】:2014-05-07 19:31:43
【问题描述】:
我有一个 ruby 应用程序和一个插件。每个人都在自己的工作区中,有一些相互独立的控制台命令。我想通过在原始应用程序的工作区中以某种方式实例化插件来使用插件的命令。以下示例说明了我的要求。我们将不胜感激有关如何实现这一目标的一些指导。
cd main_app
main_app -h
The following are main_app commands:
-a # does apple for main app
-b # does basket for main app
-set_ws # sets/ enables the work space of specified plugin (need to implement this).
cd ../plugin_app
plugin_app -h
The following are plugin_app commands:
-c # does cat for plugin_app
-d # does dog for plugin_app
I would like to implement something of this sort:
cd main_app
main_app -set_ws plugin_app
main_app -h
The following are main_app commands:
-a # does apple for main app
-b # does basket for main app
-set_ws # sets/ enables the work space of specified plugin.
The following are plugin_app commands:
-c # does cat for plugin_app
-d # does dog for plugin_app
【问题讨论】:
-
请花时间编辑您的问题,使其更具可读性。看起来有重复的部分,令人困惑。这应该在 Rails 下运行,还是在普通的 Ruby 下运行?
-
任何一个都可以。如果 Rails 包含此功能,我可以切换到它。
标签: ruby-on-rails ruby plugins console command