class Pocketbeuter::CLI
Constants
- ADD_URL
- AUTH_URL
- GET_URL
- OAUTH_AUTH_URL
- OAUTH_URL
- POCKET_DEV
- SEND_URL
Attributes
config[R]
Public Class Methods
new(*)
click to toggle source
Calls superclass method
# File lib/pocketbeuter/cli.rb, line 20 def initialize(*) @config = Pocketbeuter::ConfigFile.instance super end
Public Instance Methods
createapp()
click to toggle source
# File lib/pocketbeuter/cli.rb, line 26 def createapp say "Good day Sir/Madam before you can use pocketbeuter, you'll first" say "need to register your application. Please follow below steps:" say " 1. Log in into Pocket site." say " 2. Create an Application - complete required fields and click" say " \"CREATE APPLICATION\" button." say " NOTE: application must have unique name (I recommend: <login>/pocketbeuter)," say " add application description and give Add, Modify and Retrieve permissions," say " select platform for your application (i.e. Desktop (other)), and accept" say " license terms" ask " Press any key to open Pocket Create an Application form" say Launchy.open(Pocketbeuter::CLI::POCKET_DEV) account_name = ask "Enter account name [#{ENV['USER']}]:" if account_name.empty? @config.account_name = ENV['USER'] else @config.account_name = account_name end #TODO: handle empty consumer_key @config.consumer_key = ask 'Enter consumer key:' #TODO: handle empty redirect_uri redirect_uri = ask 'Enter redirect uri:' @config.redirect_uri = redirect_uri @config.save_config end