File: points.rb

package info (click to toggle)
ticgit 1.0.2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 488 kB
  • sloc: ruby: 2,848; sh: 124; makefile: 16
file content (28 lines) | stat: -rw-r--r-- 562 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module TicGitNG
  module Command
    # Assigns points to a ticket
    #
    # Usage:
    # ti points {1} {points}   (assigns points to a specified ticket)
    module Points
      def parser(opts)
        opts.banner = "ti points [ticket_id] points"
      end

      def execute
        case args.size
        when 1
          new_points = args[0].to_i
        when 2
          tid = args[0]
          new_points = args[1].to_i
        else
          puts usage
          exit 1
        end

        tic.ticket_points(new_points, tid)
      end
    end
  end
end