Class: Changelog::Notifier::GitCommitAuthorFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/changelog/notifier/git_commit_author_fetcher.rb

Overview

Fetches a Git commit author from the current commit.

Class Method Summary collapse

Class Method Details

.fetch(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/changelog/notifier/git_commit_author_fetcher.rb', line 11

def self.fetch(options = {})
  output = options[:capistrano].capture(
    "git --git-dir=#{options[:path] || '.'} log -1 --pretty=format:'%an'"
  )

  return nil if output.empty?

  output.gsub(/(^\'|'$)/, '')
end