puttygen 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1a1405fcd3ef3f8ad240265156cc51db2088afb
4
- data.tar.gz: bad5f100007b4f7bd152428ea86cb00cb804b22f
3
+ metadata.gz: 5f987485a84419b06590467ca9f6ebba8a06b743
4
+ data.tar.gz: c0c1bb5e450985ff6acdf9fd138df6d0080fdded
5
5
  SHA512:
6
- metadata.gz: 210ea02f30adca1369dd70e60106de86dc34486f71e36058c69bde98a2bcba728779f4b046bceb4f80e6c5e9232c97171940696e27bd6ac18e20a1e1a3029614
7
- data.tar.gz: 131a6274d0b4a628f3684970f5e4a07877ad2127765abe791d2c0e4b9831558b736c6770b2067adca4a1fe0392bbfabb22162828428cd98c83166b82beec6bf3
6
+ metadata.gz: 61a6c42125e9b9888bb1e0c4bacdeb36a6c716e7f16207ad2b0f4e42a759e4c19c9dbbb9a237fd007218d599113f9a013f32edc83b4539193c13c1ca9852d5de
7
+ data.tar.gz: 90e8b5b740b862f60d3fb2980bab065aa761d9d310aba0d1d5bc84efe07991d5050abc9577ea3f0916f23736c9bfee6d02a9e46880576cc6bd4d262dc1df0884
@@ -32,7 +32,7 @@ module Puttygen
32
32
  # @param output_format [Symbol] output format of private key to generate, one of +:putty+, +:openssh+ or +:sshcom+
33
33
  # @return [String] private key contents
34
34
  def self.convert_private_key(private_key_path, output_format: :putty)
35
- outfile = Dir::Tmpname.make_tmpname(Dir.tmpdir, nil)
35
+ outfile = build_temp_filename
36
36
  outflag = PRIVATE_OUTPUT_FORMATS.fetch(output_format, 'private')
37
37
  out, status = Open3.capture2e("puttygen #{private_key_path} -q -O #{outflag} -o #{outfile}")
38
38
  process_exit_status(out, status)
@@ -62,7 +62,7 @@ module Puttygen
62
62
  # @param public_format [Symbol] output format of public key to generate, one of +:standard+, +:openssh+ or +:sshcom+
63
63
  # @return [Keypair] public and private keys
64
64
  def self.generate_keypair(type: :rsa, bits: 2048, comment: nil, passphrase: nil, private_format: :putty, public_format: :standard)
65
- outfile = Dir::Tmpname.make_tmpname(Dir.tmpdir, nil)
65
+ outfile = build_temp_filename
66
66
  outflag = PRIVATE_OUTPUT_FORMATS.fetch(private_format, 'private')
67
67
  line = "puttygen -q -t #{type} -b #{bits} -C '#{comment}' -O #{outflag} -o #{outfile}"
68
68
 
@@ -102,4 +102,9 @@ module Puttygen
102
102
  end
103
103
  end
104
104
 
105
+ def self.build_temp_filename
106
+ name = Dir::Tmpname.make_tmpname('/', nil)
107
+ File.join(Dir.tmpdir, name).to_s
108
+ end
109
+
105
110
  end
@@ -1,3 +1,3 @@
1
1
  module Puttygen
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puttygen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Veys