Module: Opensource::Owner
Instance Method Summary collapse
Instance Method Details
#get_credentials ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/opensource/owner.rb', line 19 def get_credentials user = {} IO.foreach(File.("~/.osrc")) do |line| current_line = line.strip if !current_line.empty? key, value = current_line.split(':') user[key.strip] = value.strip end end user end |
#set_credentials ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/opensource/owner.rb', line 5 def set_credentials puts "Enter full name: " name = gets.chomp puts "Enter email address: " email = gets.chomp f = File.new(File.("~/.osrc"), "w") f.write <<-CREDENTIALS name: #{name} email: #{email} CREDENTIALS f.close end |