Writes the .gemspec specification (in Ruby) to the gem home’s specifications
directory.
# File lib/rubygems/installer.rb, line 445
def write_spec
File.open spec_file, 'w' do |file|
spec.installed_by_version = Gem.rubygems_version
file.puts spec.to_ruby_for_cache
file.fsync rescue nil # for filesystems without fsync(2)
end
end