Class: GitReleaseNotes::JiraReleaseNotes

Inherits:
Object
  • Object
show all
Defined in:
lib/git_release_notes/jira_release_notes.rb

Instance Method Summary collapse

Constructor Details

#initialize(jira_adapter, git_adapter) ⇒ JiraReleaseNotes

Returns a new instance of JiraReleaseNotes.



3
4
5
6
# File 'lib/git_release_notes/jira_release_notes.rb', line 3

def initialize(jira_adapter, git_adapter)
  @jira_adapter = jira_adapter
  @git_adapter = git_adapter
end

Instance Method Details

#jira_tickets_from_commit(project_prefix, commit) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/git_release_notes/jira_release_notes.rb', line 8

def jira_tickets_from_commit(project_prefix, commit)
  git_messages = @git_adapter.messages_for_pattern(commit,jira_issue_pattern(project_prefix))
  messages = git_messages.map do |m|
    issue = IssueEntry.new
    issue.issue_no = m[:key]
    issue.git_message = m[:git_message]
    issue_fill_from_jira(issue)
    issue
  end
  messages
end