sshkey 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sshkey.rb CHANGED
@@ -136,7 +136,7 @@ class SSHKey
136
136
  def initialize(private_key, options = {})
137
137
  @passphrase = options[:passphrase]
138
138
  @comment = options[:comment] || ""
139
- self.directives = options[:directives]
139
+ self.directives = options[:directives] || []
140
140
  begin
141
141
  @key_object = OpenSSL::PKey::RSA.new(private_key, passphrase)
142
142
  @type = "rsa"
@@ -253,7 +253,7 @@ class SSHKey
253
253
  end
254
254
 
255
255
  def directives=(directives)
256
- @directives = Array[directives].flatten
256
+ @directives = Array[directives].flatten.compact
257
257
  end
258
258
  attr_reader :directives
259
259
 
@@ -1,3 +1,3 @@
1
1
  class SSHKey
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
data/test/sshkey_test.rb CHANGED
@@ -203,6 +203,8 @@ EOF
203
203
  end
204
204
 
205
205
  def test_public_key_directives
206
+ assert_equal [], SSHKey.generate.directives
207
+
206
208
  @key1.directives = "no-pty"
207
209
  assert_equal ["no-pty"], @key1.directives
208
210
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: