Class: Apadmi::Grout::GenerateReleaseNotesAction

Inherits:
Object
  • Object
show all
Defined in:
lib/apadmi/grout/actions/generate_release_notes_action/generate_release_notes_action.rb

Overview

Finds and returns a list of all the issues who's ids exist in the given changelog

Instance Method Summary collapse

Constructor Details

#initialize(classifier) ⇒ GenerateReleaseNotesAction

Returns a new instance of GenerateReleaseNotesAction.

Parameters:



10
11
12
# File 'lib/apadmi/grout/actions/generate_release_notes_action/generate_release_notes_action.rb', line 10

def initialize(classifier)
  @classifier = classifier
end

Instance Method Details

#run(config) ⇒ Object

Parameters:



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/apadmi/grout/actions/generate_release_notes_action/generate_release_notes_action.rb', line 15

def run(config)
  moved = @classifier.classify(config.moved_issues)
  release = @classifier.classify(config.release_issues)

  CustomMustache.render(
    config.templates.document_template,
    config: config,
    rendered_moved_issues: render_classified_issues(config.templates.list_template, moved),
    rendered_release_issues: render_classified_issues(config.templates.list_template, release)
  ).strip
end