lib/commands/upgrade.rb in qrush-gemcutter-0.0.2 vs lib/commands/upgrade.rb in qrush-gemcutter-0.0.3
- old
+ new
@@ -46,11 +46,16 @@
request = Net::HTTP::Get.new(url.path)
request.basic_auth email, password
response = Net::HTTP.new(url.host, url.port).start { |http| http.request(request) }
- Gem.configuration[:gemcutter_key] = response.body
- Gem.configuration.write
+ case response
+ when Net::HTTPSuccess
+ Gem.configuration[:gemcutter_key] = response.body
+ Gem.configuration.write
+ else
+ say response.body
+ end
end
end
Gem::CommandManager.instance.register_command :upgrade