Class: Fbapp::Drivers::Base
- Inherits:
-
Object
- Object
- Fbapp::Drivers::Base
- Defined in:
- lib/fbapp/drivers/base.rb
Instance Method Summary collapse
Instance Method Details
#get_or_cache_credentials ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fbapp/drivers/base.rb', line 7 def get_or_cache_credentials credfile = File.("~/fbapp") if File.exist?(credfile) email, pass = File.read(credfile).split("\n") else highline = HighLine.new email = highline.ask("Email: ") pass = highline.ask("Password: ") { |q| q.echo = false } File.open(credfile, "w+") do |f| f.puts email f.puts pass end end return [email, pass] end |