Module: Ubiquitously::Command::User::Opts
- Defined in:
- lib/ubiquitously/commands/user.rb
Instance Method Summary collapse
- #consumer_key ⇒ Object
- #consumer_secret ⇒ Object
- #help ⇒ Object
- #password ⇒ Object
- #quiet ⇒ Object
- #section(heading, &block) ⇒ Object
- #tutorial ⇒ Object
- #username ⇒ Object
Instance Method Details
#consumer_key ⇒ Object
60 61 62 63 64 |
# File 'lib/ubiquitously/commands/user.rb', line 60 def consumer_key on('-c', '--consumer-key [key]', "Your consumer key (required)") do |key| .consumer_key = key ? key : CLI.prompt_for('Consumer key') end end |
#consumer_secret ⇒ Object
66 67 68 69 70 |
# File 'lib/ubiquitously/commands/user.rb', line 66 def consumer_secret on('-s', '--consumer-secret [secret]', "Your consumer secret (required)") do |secret| .consumer_secret = secret ? secret : CLI.prompt_for('Consumer secret') end end |
#help ⇒ Object
102 103 104 105 106 107 |
# File 'lib/ubiquitously/commands/user.rb', line 102 def help on_tail("-h", "--help", "Show this message") do CLI.puts self exit end end |
#password ⇒ Object
78 79 80 81 82 |
# File 'lib/ubiquitously/commands/user.rb', line 78 def password on('-p', '--password', "Your token secret") do |secret| .password = secret end end |
#quiet ⇒ Object
96 97 98 99 100 |
# File 'lib/ubiquitously/commands/user.rb', line 96 def quiet on('-q', '--quiet', 'Suppress all output (default: output is printed to STDOUT)') do |quiet| .output = StringIO.new end end |
#section(heading, &block) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/ubiquitously/commands/user.rb', line 46 def section(heading, &block) separator "" separator heading instance_eval(&block) end |
#tutorial ⇒ Object
53 54 55 56 57 58 |
# File 'lib/ubiquitously/commands/user.rb', line 53 def tutorial on('-T', '--tutorial', "Narrative overview of how to get started using Ubiquitously.me") do CLI.puts IO.read("README.markdown") exit end end |
#username ⇒ Object
72 73 74 75 76 |
# File 'lib/ubiquitously/commands/user.rb', line 72 def username on('-u', '--username [name]', 'Your access token') do |name| .username = name end end |