Module: AuthorizedKeys::Key::Components

Defined in:
lib/authorized_keys/key.rb

Constant Summary collapse

OPTIONS =
'(.*?)\\s*'
CONTENT =
'(ssh-(?:dss|rsa)\\s.*?)'
COMMENT =
'(?:\\s+(.*))?'

Class Method Summary collapse

Class Method Details

.extract(key_string) ⇒ Object



41
42
43
# File 'lib/authorized_keys/key.rb', line 41

def self.extract(key_string)
  key_string.scan(/^#{OPTIONS}#{CONTENT}#{COMMENT}$/).flatten.map(&:to_s)
end