rubygems/rubygems — pull request #603 by seamusabshere (2013-07-20 17:42:30+00:00)
Title: Add Gem::Specification#allowed_hosts, a whitelist of hosts a gem may be pushed to

Defaults to nil, meaning any host is allowed. Includes tests.

Note that I had to change 2 tests in test_gem_commands_push_command.rb, namely test_execute and test_execute_host; they exploited the fact that gem push previously did not always attempt to load a gem's specification (it only loaded the gemspec if no host was specified). I used existing test helpers to fix those 2 tests.

I figure @rykov of @gemfury will appreciate this.