Class: CommitFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/changelogger/commit_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(commit) ⇒ CommitFormatter

Returns a new instance of CommitFormatter.



4
5
6
# File 'lib/changelogger/commit_formatter.rb', line 4

def initialize(commit)
  @commit = commit
end

Instance Method Details

#formatObject



8
9
10
11
12
13
# File 'lib/changelogger/commit_formatter.rb', line 8

def format
  "  - " +
    @commit.committed_date.strftime("%Y/%m/%d: ") +
    @commit.message.split(/\n/).first +
    " (" + @commit.author.name + ")"
end