Module: TicGitNG::Command::Assign
- Defined in:
- lib/ticgit-ng/command/assign.rb
Overview
Assigns a ticket to someone
Usage: ti assign (assign checked out ticket to current user) ti assign 1 (assign ticket to current user) ti assign -c 1 (assign ticket to current user and checkout the ticket) ti assign -u name (assign ticket to specified user) ti assign -u name 1 (assign specified ticket to specified user)
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
24 25 26 |
# File 'lib/ticgit-ng/command/assign.rb', line 24 def execute handle_ticket_assign end |
#handle_ticket_assign ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ticgit-ng/command/assign.rb', line 27 def handle_ticket_assign tic.ticket_checkout(.checkout) if .checkout if ARGV.length == 1 #ti assign tic_id=nil elsif ARGV.length == 2 #ti assign {ticid} tic_id=ARGV[1] elsif ARGV.length == 3 #ti assign -u/-c {user/ticid} if .user tic_id=nil else tic_id=.checkout end end tic.ticket_assign((.user rescue nil), tic_id) end |
#parser(opts) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ticgit-ng/command/assign.rb', line 12 def parser(opts) opts. = "Usage: ti assign [options] [ticket_id]\n"+ "Note: to assign to nobody: ti assign -u ''" opts.on_head( "-u USER", "--user USER", "Assign the ticket to this user"){|v| .user = v } opts.on_head( "-c TICKET", "--checkout TICKET", "Checkout this ticket"){|v| .checkout = v } end |