Class: Keepachangelog::YamlPrinter

Inherits:
Printer
  • Object
show all
Defined in:
lib/keepachangelog/printer/yaml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changelog) ⇒ YamlPrinter

Returns a new instance of YamlPrinter.



7
8
9
# File 'lib/keepachangelog/printer/yaml.rb', line 7

def initialize(changelog)
  self.changelog = changelog
end

Instance Attribute Details

#changelogObject

Returns the value of attribute changelog.



5
6
7
# File 'lib/keepachangelog/printer/yaml.rb', line 5

def changelog
  @changelog
end

Instance Method Details

#write(path) ⇒ Object



11
12
13
14
15
# File 'lib/keepachangelog/printer/yaml.rb', line 11

def write(path)
  FileUtils.mkdir_p(path)
  write_meta File.join(path, 'meta.yaml')
  write_versions path, changelog['versions']
end