24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/grubber/command.rb', line 24
def auth
config = Grubber::Config.load
say("\nGrubber requires Yelp API v2 credentials")
say("To learn more go to: http://www.yelp.com/developers")
if config.has_auth?
say("\nYelp authentication already set:")
say("Consumer Key: #{config.consumer_key}")
say("Consumer Secret: #{config.consumer_secret}\n")
say("Token Key: #{config.token_key}\n")
say("Token Sec: #{config.token_secret}\n")
overwrite = ask('Overwrite? (y,n)')
return unless overwrite.downcase == 'y'
end
c_key = ask("\nConsumer Key: ")
c_sec = ask('Consumer Secret: ')
t_key = ask('Token Key: ')
t_sec = ask('Token Sec: ')
if Grubber::Config.update_auth(c_key, c_sec, t_key, t_sec)
say("Complete!", :green)
else
say("Failed", :red)
end
end
|