aboutsummaryrefslogtreecommitdiffstats
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
commitdb74541efec489c62310ab85091b28bb360e79c8 (patch)
tree168c17fc9415c483722c7eb31ecdd63eac8771be /lib/rubygems/dependency_installer.rb
parentcae4fb76dcc6810a38ad67301fb764b8b7e5c5ca (diff)
downloadruby-db74541efec489c62310ab85091b28bb360e79c8.tar.gz
Update to RubyGems 0.9.5
git-svn-id: svn+ssh://ci.ruby-lang.org/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 49afc76c79..e189e800a0 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