# File lib/rhc/commands/sshkey.rb, line 47 def add(name, key) begin file = File.open(key) rescue Errno::ENOENT => e raise ::RHC::KeyFileNotExistentException.new("File '#{key}' does not exist.") rescue Errno::EACCES => e raise ::RHC::KeyFileAccessDeniedException.new("Access denied to '#{key}'.") end type, content, comment = file.gets.chomp.split rest_client.add_key(name, content, type) results { say "SSH key #{key} has been added as '#{name}'" } 0 end