summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
commit64847a9cfe467b808ca5e8148dfa85a059198963 (patch)
treeb21ca4404f92f1fe269347a8d624cf188e7fbc97 /lib/rubygems/commands
parentdf2762fb1aaa82577b4e3e8df67cc56b7aefdfb8 (diff)
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.rb14
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