Class: Vinz::Clortho::GitHubKeyUploader

Inherits:
Object
  • Object
show all
Defined in:
lib/vinz/clortho/github_key_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(initials, username, password) ⇒ GitHubKeyUploader

Returns a new instance of GitHubKeyUploader.



6
7
8
9
10
# File 'lib/vinz/clortho/github_key_uploader.rb', line 6

def initialize(initials, username, password)
  @manager = GitAuthorsManager.new
  @initials = initials
  @username, @password = username, password
end

Instance Method Details

#upload(title) ⇒ Object



12
13
14
15
# File 'lib/vinz/clortho/github_key_uploader.rb', line 12

def upload(title)
  key = File.open("#{@manager.key_path_for(@initials)}.pub", "r").read
  client.add_key(title, key)
end