Class: Fastlane::Helper::ChangelogGeneratorRender

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(releases, labels, params) ⇒ ChangelogGeneratorRender

Returns a new instance of ChangelogGeneratorRender.



6
7
8
9
10
# File 'lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb', line 6

def initialize(releases, labels, params)
  @releases = releases
  @labels = labels
  @params = params
end

Instance Attribute Details

#labelsObject

Returns the value of attribute labels.



4
5
6
# File 'lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb', line 4

def labels
  @labels
end

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb', line 4

def params
  @params
end

#releasesObject

Returns the value of attribute releases.



4
5
6
# File 'lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb', line 4

def releases
  @releases
end

Instance Method Details

#to_markdownObject



12
13
14
15
16
17
# File 'lib/fastlane/plugin/changelog_generator/helper/changelog_generator_render.rb', line 12

def to_markdown
  template = params[:template] || File.read(params[:template_path])
  markdown = ERB.new(template, 0, '-').result(binding).strip.concat("\n")
  File.write(params[:output_path], markdown) if params[:output_path]
  markdown
end