如何找到依赖于给定宝石的宝石? [英] How do I find gems that depend on a given gem?
问题描述
是否可以搜索所有依赖于某个 rubygem 的 gem?
Is it possible to search for all gems that rely on a certain rubygem?
例如,我想查询 gemcutter 中依赖于测试单元 gem 的所有 gem.
For example, I'd like to ask for all gems in gemcutter that rely on the test-unit gem.
背景:我正在寻找其他 gem 如何处理提到的问题 这里.
Background: I'm looking to see how other gems handle the issue mentioned here.
推荐答案
我遇到了同样的问题,发现这个问题的其他一些建议现在已经失效了.我想出了一个适合我的两步解决方案.
I had the same problem, and found that some of the other suggestions for this question are now defunct. I came up with a 2-step solution that worked for me.
以下 unix-y 脚本将告诉您所有 gem 依赖的 gem:
The following unix-y script will tell you all the gems your gems depend on:
gem list | egrep '^.*[ ]' -o | gem dependency
然后我只是在输出中搜索了罪魁祸首.
Then I just searched for the culprit in the output.
这篇关于如何找到依赖于给定宝石的宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!