-
-
Save pvdb/5949636 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
installed_gems = Gem::Dependency.new '', Gem::Requirement.default | |
missing = [] | |
# mind the short-hand, looping over installed gem specs | |
specs = Gem.source_index.search installed_gems | |
specs.each do |spec| | |
gem = Gem::Dependency.new spec.name, spec.version | |
# looping over gem dependencies | |
specs = Gem.source_index.search gem | |
deps = specs.first.runtime_dependencies | |
deps.each do |dep| | |
# check if the dependency is missing | |
specs = Gem.source_index.search dep | |
if specs === [] then | |
missing.push dep | |
end | |
end | |
end | |
print missing.sort.uniq.collect{|spec| "#{spec}\n"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment