summaryrefslogtreecommitdiffstats
path: root/lib/rubygems/dependency_installer.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-20 05:56:43 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-20 05:56:43 +0000
commitd8c6c9bf404f1b0d6f70f7f20605c80e46fbd3ed (patch)
tree168c17fc9415c483722c7eb31ecdd63eac8771be /lib/rubygems/dependency_installer.rb
parenteb31d95c8d0d8bf8f15538a44fddb3f5317fe66b (diff)
downloadruby-d8c6c9bf404f1b0d6f70f7f20605c80e46fbd3ed.tar.gz
ruby-d8c6c9bf404f1b0d6f70f7f20605c80e46fbd3ed.tar.xz
ruby-d8c6c9bf404f1b0d6f70f7f20605c80e46fbd3ed.zip
Update to RubyGems 0.9.5
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_installer.rb')
-rw-r--r--lib/rubygems/dependency_installer.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index 49afc76c7..e189e800a 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -124,12 +124,25 @@ class Gem::DependencyInstaller
case scheme
when 'http' then
unless File.exist? local_gem_path then
- say "Downloading gem #{gem_file_name}" if
- Gem.configuration.really_verbose
+ begin
+ say "Downloading gem #{gem_file_name}" if
+ Gem.configuration.really_verbose
+
+ remote_gem_path = source_uri + "gems/#{gem_file_name}"
+
+ gem = Gem::RemoteFetcher.fetcher.fetch_path remote_gem_path
+ rescue Gem::RemoteFetcher::FetchError
+ raise if spec.original_platform == spec.platform
- remote_gem_path = source_uri + "gems/#{gem_file_name}"
+ alternate_name = "#{spec.name}-#{spec.version}-#{spec.original_platform}.gem"
- gem = Gem::RemoteFetcher.fetcher.fetch_path remote_gem_path
+ say "Failed, downloading gem #{alternate_name}" if
+ Gem.configuration.really_verbose
+
+ remote_gem_path = source_uri + "gems/#{alternate_name}"
+
+ gem = Gem::RemoteFetcher.fetcher.fetch_path remote_gem_path
+ end
File.open local_gem_path, 'wb' do |fp|
fp.write gem