Class: ConventionalChangelog::Writer

Inherits:
File
  • Object
show all
Defined in:
lib/conventional_changelog/writer.rb

Direct Known Subclasses

ByDateWriter, ByVersionWriter

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ Writer

Returns a new instance of Writer.



3
4
5
6
# File 'lib/conventional_changelog/writer.rb', line 3

def initialize(file_name)
  @previous_body = File.open(file_name, "a+").read
  super file_name, "w"
end

Instance Method Details

#write!(options) ⇒ Object



8
9
10
11
# File 'lib/conventional_changelog/writer.rb', line 8

def write!(options)
  write_new_lines options
  self.puts @previous_body
end