class Reposit::CredentialsSetter

Attributes

api_key[RW]
username[RW]

Public Class Methods

new() click to toggle source
# File lib/reposit.rb, line 115
def initialize
  @username, @api_key = "", ""
end
run() click to toggle source
# File lib/reposit.rb, line 119
def self.run
  new.run
end

Public Instance Methods

run() click to toggle source
# File lib/reposit.rb, line 123
def run
  print "GitHub username: "
  self.username = $stdin.gets.chomp
  print "API Key: "
  self.api_key = $stdin.gets.chomp
  write_credentials
end
write_credentials() click to toggle source
# File lib/reposit.rb, line 131
def write_credentials
  File.open(File.expand_path('~') + '/.reposit', 'w+') do |f|
    f.puts username
    f.write api_key
  end
end