End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Security.write
write(pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER)
lib/rubygems/security.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/security.rb, line 610
def self.write(pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER)
path = File.expand_path path
File.open path, 'wb', permissions do |io|
if passphrase and cipher
io.write pemmable.to_pem cipher, passphrase
else
io.write pemmable.to_pem
end
end
path
end
Writes pemmable, which must respond to to_pem to path with the given permissions. If passed cipher and passphrase those arguments will be passed to to_pem.