What's the best way to list a non-ruby dependency of a gem?

走远了吗. 提交于 2020-01-04 04:31:05

问题


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.


回答1:


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



回答2:


You may want to look at Babushka for describing non-ruby dependencies.

I don't know whether installing the python package in the pre_install hook would be polite behaviour.



来源:https://stackoverflow.com/questions/4964257/whats-the-best-way-to-list-a-non-ruby-dependency-of-a-gem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!