Created
June 10, 2012 06:08
-
-
Save cymen/2904087 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/php -q | |
<?php | |
$list = shell_exec("gem list"); | |
foreach (split("\n", $list) as $line) | |
{ | |
$entries = split(" ", $line); | |
$program = $entries[0]; | |
if (strlen($program) == 0) | |
continue; | |
$versions = split(",", substr($line, strpos($line, "(") + 1, strpos($line, ")") - (strpos($line, "(") + 1))); | |
foreach ($versions as $version) | |
{ | |
$version = trim($version); | |
echo "gem install $program -v $version", "\n"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment