Class: Lita::Handlers::GitBranchSwitcher

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/git_branch_switcher.rb

Instance Method Summary collapse

Instance Method Details

#current_branchObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/lita/handlers/git_branch_switcher.rb', line 12

def current_branch
  g = Git.open(config.repository_path)
  log = g.log.first
  "[%{branch}] %{date} %{author} %{message}" % {
    branch: g.current_branch,
    date: log.author.date,
    author: log.author.name,
    message: log.message.lines.first,
  }
end