This has better performance, since it's creating one SQL request instead of two with pluck.
Gem::Package provide a way to load the spec from the .gem file, so the pusher should use that. On rubygems 2.3+ that method start receiving any IO and not just a file. As we are on that version, we can use that method. This changes one small behaviour though. Now the pusher will only be able to load_spec for gems that include a data.tar.gz . Gem pushes without a data will not be accepted anymore. see https://github.com/rubygems/rubygems/blob/f24c244308266970fdfdee85f5cba8532c936b79/lib/rubygems/package.rb#L663-L666
This reverts commit e81a297.