lib/commands/abstract_command.rb in gemcutter-0.1.2 vs lib/commands/abstract_command.rb in gemcutter-0.1.3

- old
+ new

@@ -1,10 +1,12 @@ require 'rubygems/local_remote_options' class Gem::AbstractCommand < Gem::Command include Gem::LocalRemoteOptions + URL = "http://gemcutter.org" + def api_key Gem.configuration[:gemcutter_key] end def gemcutter_url @@ -78,16 +80,18 @@ @proxy_class || Net::HTTP end # @return [URI, nil] the HTTP-proxy as a URI if set; +nil+ otherwise def http_proxy - proxy = Gem.configuration[:http_proxy] + proxy = Gem.configuration[:http_proxy] || ENV['http_proxy'] || ENV['HTTP_PROXY'] return nil if proxy.nil? || proxy == :no_proxy URI.parse(proxy) end def ask_for_password(message) - password = ui.ask_for_password(message) + system "stty -echo" + password = ask(message) + system "stty echo" ui.say("\n") password end end