aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/mirror_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/mirror_command.rb')
-rw-r--r--lib/rubygems/commands/mirror_command.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rubygems/commands/mirror_command.rb b/lib/rubygems/commands/mirror_command.rb
index 74f6970e9e..fc4f086ad3 100644
--- a/lib/rubygems/commands/mirror_command.rb
+++ b/lib/rubygems/commands/mirror_command.rb
@@ -60,10 +60,16 @@ Multiple sources and destinations may be specified.
if get_from.scheme.nil? then
get_from = get_from.to_s
elsif get_from.scheme == 'file' then
- get_from = get_from.to_s[5..-1]
+ # check if specified URI contains a drive letter (file:/D:/Temp)
+ get_from = get_from.to_s
+ get_from = if get_from =~ /^file:.*[a-z]:/i then
+ get_from[6..-1]
+ else
+ get_from[5..-1]
+ end
end
- open File.join(get_from, "Marshal.#{Gem.marshal_version}.Z"), "rb" do |y|
+ open File.join(get_from.to_s, "Marshal.#{Gem.marshal_version}.Z"), "rb" do |y|
sourceindex_data = Zlib::Inflate.inflate y.read
open File.join(save_to, "Marshal.#{Gem.marshal_version}"), "wb" do |out|
out.write sourceindex_data