Class: Ubiquitously::Command::User

Inherits:
Base show all
Defined in:
lib/ubiquitously/commands/user.rb

Defined Under Namespace

Modules: Opts

Instance Attribute Summary

Attributes inherited from Base

#attributes, #services

Instance Method Summary collapse

Methods inherited from Base

#configure, #initialize, #main_folder, run, #show, #write

Constructor Details

This class inherits a constructor from Ubiquitously::Command::Base

Instance Method Details

#parse_options(args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ubiquitously/commands/user.rb', line 9

def parse_options(args)
  option_parser = OptionParser.new do |o|
    o.extend Ubiquitously::Opts
    
    o.banner = "Usage: u.me [command] [service(s)] [options]\n" +
               "\n" +
               "Supported Commands:\n#{SUPPORTED_COMMANDS.sort.join(', ')}"
  
    o.section "Getting started:" do
      tutorial
    end
    
    o.section "Authorization options:" do
      username
      password
      consumer_key
      consumer_secret
      access_token
      password
    end
  
    o.section "Common options:" do
      trace
      data
      host
      quiet
      disable_ssl
      request_method
      help
    end
  end

  option_parser.parse!(args)
end

#runObject



5
6
7
# File 'lib/ubiquitously/commands/user.rb', line 5

def run
  Ubiquitously::User.new(attributes).(services)
end