内联rubygems,类似webpackJS - Inlining ruby gems, similiar to webpack in JS

- 此内容更新于:2016-02-01
主题:

我为Sketchup开发插件,运行自己的嵌入ruby解释器(2.0.0)。这使得使用宝石更加复杂,尤其是那些需要DevKit,这根本不存在。我有围绕这些问题使用下载预编译宝石(例如Nogokiri)和使用它们专门安装或使用纯ruby版本的宝石(如json/ruby)和动态下载它,如果必要的。然而,在被介绍给JS世界和它的优秀模块打包机webpack,我开始想念它的强大的功能在ruby世界,特别是在我的情况。拥有这样一个打包机检测、包装和内联rubygems我需要将是一个很好的选择停止担心如果宝石下载正确(如果用户离线呢?),将消除安装时在第一次使用,让我更加熟悉使用外部库放在第一位。看看打包机之后,似乎更像是一个解决方案来管理依赖于我的(或其他开发人员)机器而不是为我描述的用例。这样的事情存在吗?如果不是,它甚至有可能吗?

原文:

I'm developing plugins for Sketchup, which runs its own embedded ruby interpreter (2.0.0). This makes using gems a bit more complicated, especially those who need DevKit, which doesn't exist.

I've got around those issues with either using downloadable pre-compiled gems (Nogokiri for example) and using them specifically to install or using pure-ruby versions of a gem (like json/ruby) and download it on the fly if necessary.

However, after being introduced to the JS world and it's excellent module bundler webpack, I've started to miss its powerful features in the ruby world, especially in my situation. Having such a bundler to detect, pack and inline the ruby gems I need would be an excellent option to stop worrying if the gem downloaded correctly (what if the user is offline?), would remove the install-time during the first use, and make me much more comfortable with using a external library in the first place.

After a look at Bundler, it seems more like a solution to manage dependencies on my (or other developers) machine and not for the use case I described.

Does something like this exist? If not, is it even possible?

网友:

(原文:bundle help package)

楼主:@Jordan,没有命令行安装我可以使用打包机的宝石。显然是有指定gemfiles内联的方法,但我发现没什么不实际使用打包机在嵌入式环境中安装。

(原文:@Jordan, there is no command line I can use to install the gems from bundler. There apparently is a way to specify gemfiles inline, but I found nothing to not actually using bundler install inside an embedded environment.)

网友:也检查gemstash。

(原文:Also check gemstash.)