DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Remove Older Gem Versions
// description of your code here
This code removes all but the most recent version of each ruby gem in your system.
EOL_SEPARATOR = "\n"
gems = `gem list`.split(EOL_SEPARATOR)
gems.each do |g|
gem_name = g.split("(").first
cmd = "gem cleanup #{gem_name}"
system(cmd)
end






Comments
Snippets Manager replied on Tue, 2007/06/05 - 11:43am