Sha256: d9a40ca755cfd2c6fbca8b737e9cefc718afb59e5ed2c3f153f42a4d53591143
Contents?: true
Size: 572 Bytes
Versions: 3
Compression:
Stored size: 572 Bytes
Contents
module GitSafe class SshTempfile attr_reader :private_key_string, :private_key_temp_file def initialize(private_key_string) @private_key_string = private_key_string @private_key_temp_file = create_private_key_tmp_file end def safe_unlink_private_key_tmp_file private_key_temp_file&.unlink end def create_private_key_tmp_file tf = Tempfile.new('git-ssh-wrapper') tf << private_key_string tf.puts('') # required for openssh keys tf.chmod(0600) tf.flush tf.close tf end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
git-safe-0.3.0 | lib/git-safe/ssh_tempfile.rb |
git-safe-0.2.0 | lib/git-safe/ssh_tempfile.rb |
git-safe-0.1.0 | lib/git-safe/ssh_tempfile.rb |