Class: LongTweet::Setup
- Inherits:
-
Object
- Object
- LongTweet::Setup
- Defined in:
- lib/long_tweet/setup.rb
Instance Method Summary collapse
Instance Method Details
#ask(question) ⇒ Object
5 6 7 8 |
# File 'lib/long_tweet/setup.rb', line 5 def ask question puts question gets.strip end |
#run ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/long_tweet/setup.rb', line 10 def run @consumer_key = ask 'What is your consumer key?' @consumer_secret = ask 'What is your consumer secret?' @oauth_token = ask 'What is your oauth token?' @oauth_token_secret = ask 'What is your oauth secret?' set_credentials puts 'All done!' end |
#set_credentials ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/long_tweet/setup.rb', line 19 def set_credentials GeneralStore.create '~/.long_tweet' do |gs| gs.consumer_key = @consumer_key gs.consumer_secret = @consumer_secret gs.oauth_token = @oauth_token gs.oauth_token_secret = @oauth_token_secret end end |