Module: GitSafe::PrivateKeyFile
- Included in:
- Git
- Defined in:
- lib/git-safe/private_key_file.rb
Instance Method Summary collapse
- #safe_unlink_private_key_tmp_file ⇒ Object
- #ssh_cmd ⇒ Object
- #ssh_private_key_file_path ⇒ Object
- #ssh_tempfile ⇒ Object
Instance Method Details
#safe_unlink_private_key_tmp_file ⇒ Object
24 25 26 |
# File 'lib/git-safe/private_key_file.rb', line 24 def safe_unlink_private_key_tmp_file ssh_tempfile&.safe_unlink_private_key_tmp_file end |
#ssh_cmd ⇒ Object
3 4 5 6 |
# File 'lib/git-safe/private_key_file.rb', line 3 def ssh_cmd return '' unless ssh_private_key_file_path "GIT_SSH_COMMAND=\"ssh -i #{ssh_private_key_file_path} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no\" " end |
#ssh_private_key_file_path ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/git-safe/private_key_file.rb', line 8 def ssh_private_key_file_path return unless ssh_private_key if File.exist?(ssh_private_key) logger.info('ssh_private_key key is a file') ssh_private_key else logger.info('ssh_private_key key is a string') ssh_tempfile.private_key_temp_file.path end end |
#ssh_tempfile ⇒ Object
20 21 22 |
# File 'lib/git-safe/private_key_file.rb', line 20 def ssh_tempfile @ssh_tempfile ||= SshTempfile.new(ssh_private_key) end |