Class: MinaRevisioneer::ChangeLog

Inherits:
MessageExtractor show all
Defined in:
lib/mina_revisioneer/change_log.rb

Overview

Uses the first line of each commit message as entries to the changelog

can be configured by setting

:revisioneer_inclusion

for inclusiong (whitelisting) and

:revisioneer_exclusion

for exlusion (blacklisting)

Instance Attribute Summary

Attributes inherited from MessageExtractor

#api_token, #binding, #host

Instance Method Summary collapse

Methods inherited from MessageExtractor

#initialize, #last_deploy, #last_deploy_date, #last_deploy_sha, #number_of_new_commits, #repo, #sha

Constructor Details

This class inherits a constructor from MinaRevisioneer::MessageExtractor

Instance Method Details

#messagesObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mina_revisioneer/change_log.rb', line 10

def messages
  walker = Rugged::Walker.new(repo)
  walker.push sha
  walker.hide last_deploy_sha if last_deploy_sha
  messages = walker.each.to_a.map { |commit|
    commit.message.lines.first.strip
  }
  messages.select! { |line| line =~ revisioneer_inclusion } if revisioneer_inclusion
  messages.reject! { |line| line =~ revisioneer_exclusion } if revisioneer_exclusion
  messages
end

#revisioneer_exclusionObject



26
27
28
# File 'lib/mina_revisioneer/change_log.rb', line 26

def revisioneer_exclusion
  eval "revisioneer_exclusion", binding
end

#revisioneer_inclusionObject



22
23
24
# File 'lib/mina_revisioneer/change_log.rb', line 22

def revisioneer_inclusion
  eval "revisioneer_inclusion", binding
end