Class: GitReleaseNotes::ReleaseNotes

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

Instance Method Summary collapse

Constructor Details

#initialize(project_code, commit) ⇒ ReleaseNotes

Returns a new instance of ReleaseNotes.



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

def initialize(project_code, commit)
  @project_prefix = project_code
  @from_commit = commit
  @git_dir = Dir.pwd
end

Instance Method Details

#get_release_notesObject



25
26
27
28
29
# File 'lib/git_release_notes/release_notes.rb', line 25

def get_release_notes
  ga = GitReleaseNotes::GitAdapter.new(@git_dir)
  ja = GitReleaseNotes::JiraAdapter.new
  rn = GitReleaseNotes::JiraReleaseNotes.new(ja, ga)
end

#jira_project_prefix(project_code) ⇒ Object



13
14
15
# File 'lib/git_release_notes/release_notes.rb', line 13

def jira_project_prefix(project_code)
  @project_prefix = project_code
end

#release_notes_from_commitObject



16
17
18
19
20
21
22
23
# File 'lib/git_release_notes/release_notes.rb', line 16

def release_notes_from_commit
  rn = get_release_notes
  issues = rn.jira_tickets_from_commit(@project_prefix, @from_commit)
  notes  = issues.map do |i|
    i.to_md_string
  end
  notes.join(" \n")
end

#set_git_dir(dir) ⇒ Object



9
10
11
# File 'lib/git_release_notes/release_notes.rb', line 9

def set_git_dir(dir)
  @git_dir = dir
end