列出宝石的非ruby依赖关系的最佳方式是什么? [英] What's the best way to list a non-ruby dependency of a gem?
问题描述
我正在写一篇红宝石,我想使用一个以Python形式发布的开源程序。我没有时间将python程序移植到ruby,我想尽可能自动管理外部依赖项。
我正在考虑使用Gem.pre_install挂钩自动easy_install我感兴趣的python包。
http://rubygems.rubyforge.org/rubygems-update/Gem.html#method-c-pre_install
如果是公认的做法,我会很感激更好的方法或pre_install的支持。
这是一个老问题,但值得回复。对不起,我没有检查与babushka相关的问题的stackoverflow:)如果python包可用作点,那么你可以做这样的事情:
dep'blah.gem'do
需要'something.pip'
结束
dep'something.pip'
然后, babushka blah.gem 会处理安装,包括根据需要安装rubygems和pip。
- Ben
I am writing a ruby gem that I would like to use an open source program distributed as python. I don't have the time to port the python program to ruby, and I want to manage the external dependency as automatically as possible.
I'm thinking of using the Gem.pre_install hook to automatically easy_install the python package I'm interested in.
http://rubygems.rubyforge.org/rubygems-update/Gem.html#method-c-pre_install
I'd appreciate suggestions of better ways, or support of pre_install, if it's the accepted practice.
Quite an old question, but worth a reply. Sorry, I haven't been checking stackoverflow for babushka-related questions :)
If the python package is available as a pip, then you could do something like this:
dep 'blah.gem' do
requires 'something.pip'
end
dep 'something.pip'
Then, babushka blah.gem
would handle the install, including installing rubygems and pip as required.
- Ben
这篇关于列出宝石的非ruby依赖关系的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!