Class: Changi::Changelog

Inherits:
Object
  • Object
show all
Defined in:
lib/changi/changelog.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Changelog

Returns a new instance of Changelog.



3
4
5
# File 'lib/changi/changelog.rb', line 3

def initialize config
  @config = config
end

Instance Method Details

#new_entryObject



7
8
9
# File 'lib/changi/changelog.rb', line 7

def new_entry
  entry_set.new_entry
end

#render(demo: false) ⇒ Object



11
12
13
14
15
# File 'lib/changi/changelog.rb', line 11

def render demo: false
  release  = demo ? Release.demo : Release.build
  renderer = Renderer.new @config, entry_set, release
  renderer.render
end

#updateObject



17
18
19
20
21
# File 'lib/changi/changelog.rb', line 17

def update
  updater = @config.updater.new
  updater.update @config.changelog_path, render
  entry_set.destroy_all
end