I have been trying to find out dependencies for a ruby-gem. I know that gem dependency command will let me know about the dependencies of the gem. But I want to do more than that. I also want to know the dependencies of those gems generated by gem dependency command. I mean, I want to find out all the gems till the last one, on which my gem is depending.
Any pointers will be appreciated. Thanks in advance.
Note: The idea is to build something like https://www.gemlou.pe/
for example will give you a list like
that Include reverse dependencies in the output
More on
$ gem dependency
http://guides.rubygems.org/command-reference/#gem_dependencyupdate
According to the research I have done on web, and after having asked about this subject to my colleagues and others I went to conclusion, that there is no way one can currently use
$ gem dependency
to find out the complete recursive list of a gem dependencies.Writing a ruby gem similar to one that you have indicated in your updated question should not be very complicated. I believe one can do this by writing a simple recursive loop and by fetching gem information, perhaps in a desirable format.
I think I give up on this about this subject, but somebody could start a bounty for somebody else (not me) who could think of "the best way to get recursive gem dependencies" other than https://www.gemlou.pe which I think is nice.
following class will recursively get gem dependencies (note its proof of concept so it does not do anything fancy, but its a good starting point). for documentation please refer rubydocs: Gem::Dependency and Gem::Specification
you can use it programatically in your app or from ruby console: