Module: Ubiquitously::Command::User::Opts

Defined in:
lib/ubiquitously/commands/user.rb

Instance Method Summary collapse

Instance Method Details

#consumer_keyObject



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|
    options.consumer_key = key ? key : CLI.prompt_for('Consumer key')
  end
end

#consumer_secretObject



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|
    options.consumer_secret = secret ? secret : CLI.prompt_for('Consumer secret')
  end
end

#helpObject



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

#passwordObject



78
79
80
81
82
# File 'lib/ubiquitously/commands/user.rb', line 78

def password
  on('-p', '--password', "Your token secret") do |secret|
    options.password = secret
  end
end

#quietObject



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|
    options.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

#tutorialObject



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

#usernameObject



72
73
74
75
76
# File 'lib/ubiquitously/commands/user.rb', line 72

def username
  on('-u', '--username [name]', 'Your access token') do |name|
    options.username = name
  end
end