Created
April 19, 2012 02:17
-
-
Save pochi/2417918 to your computer and use it in GitHub Desktop.
Fetch gem file from Gemfile.lock for can not connect gem server.
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
# coding: utf-8 | |
# ex) ruby gem_fetcher.rb #{TARGET_Gemfile.lock} | |
INSTALL_REGEXP = /^ ([a-zA-Z].+) ¥((.+)¥)$/ | |
open(ARGV[0]).each_line do |line| | |
if match_data = INSTALL_REGEXP.match(line).to_a and !match_data.empty? | |
gem_file_name = match_data[1] | |
gem_versin = match_data.last | |
system "gem fetch #{gem_file_name} -v #{gem_version}" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment