Module: TicGitNG::Command::Recent

Defined in:
lib/ticgit-ng/command/recent.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ticgit-ng/command/recent.rb', line 8

def execute
  # "args[0]" seems to be superfluous.  It's usage
  # is undocumented, and supplying an argument
  # doesn't seem to do anything.
  #
  # Im guessing the purpose of args[0] was to provide a
  # specific ticket_id whos history would be looked up
  # intead of looking up the history for all tickets.
  #
  # #FIXME Reimplement that functionality and updte
  # docs to match
  tic.ticket_recent(args[0]).each do |commit|
    sha = commit.sha[0, 7]
    date = commit.date.strftime("%m/%d %H:%M")
    message = commit.message

    puts "#{sha}  #{date}\t#{message}"
  end
end

#parser(opts) ⇒ Object



4
5
6
# File 'lib/ticgit-ng/command/recent.rb', line 4

def parser(opts)
  opts.banner = 'Usage: ti recent'
end