diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-19 21:23:04 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-19 21:23:04 +0000 |
commit | 64847a9cfe467b808ca5e8148dfa85a059198963 (patch) | |
tree | b21ca4404f92f1fe269347a8d624cf188e7fbc97 /lib/rubygems/commands | |
parent | df2762fb1aaa82577b4e3e8df67cc56b7aefdfb8 (diff) | |
download | ruby-64847a9cfe467b808ca5e8148dfa85a059198963.tar.gz |
Importing rubygems @ c2d4131: Deal with platforms that have DLEXT2 == nil. Fixes RF#28867
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/sources_command.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index ce483c0b5e..437fa574d0 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -57,12 +57,16 @@ class Gem::Commands::SourcesCommand < Gem::Command path = Gem::SpecFetcher.fetcher.dir FileUtils.rm_rf path - if not File.exist?(path) then + unless File.exist? path then say "*** Removed specs cache ***" - elsif not File.writable?(path) then - say "*** Unable to remove source cache (write protected) ***" else - say "*** Unable to remove source cache ***" + unless File.writable? path then + say "*** Unable to remove source cache (write protected) ***" + else + say "*** Unable to remove source cache ***" + end + + terminate_interaction 1 end end @@ -78,8 +82,10 @@ class Gem::Commands::SourcesCommand < Gem::Command say "#{source_uri} added to sources" rescue URI::Error, ArgumentError say "#{source_uri} is not a URI" + terminate_interaction 1 rescue Gem::RemoteFetcher::FetchError => e say "Error fetching #{source_uri}:\n\t#{e.message}" + terminate_interaction 1 end end |