Class: Shacho::Credential

Inherits:
Object
  • Object
show all
Defined in:
lib/shacho/credential.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/shacho/credential.rb', line 3

def email
  @email
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/shacho/credential.rb', line 3

def password
  @password
end

Instance Method Details

#prompt(name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/shacho/credential.rb', line 5

def prompt(name)
  puts "Enter your Heroku credentials for #{name}."
  print "Email: "
  @email = STDIN.gets.chomp
  print "Password: "
  @password = STDIN.gets.chomp        
end

#write(filename) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/shacho/credential.rb', line 13

def write(filename)
  credentials_filename = "#{filename}/credentials"
  FileUtils.touch(credentials_filename)
  File.open(credentials_filename, 'w') do |f|
    f.write("#{@email}\n#{@password}")
  end
end