Class: ConventionalChangelog::Writer
- Inherits:
-
File
- Object
- File
- ConventionalChangelog::Writer
- Defined in:
- lib/conventional_changelog/writer.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(file_name) ⇒ Writer
constructor
A new instance of Writer.
- #write!(options) ⇒ Object
Constructor Details
#initialize(file_name) ⇒ Writer
Returns a new instance of Writer.
19 20 21 22 23 24 25 |
# File 'lib/conventional_changelog/writer.rb', line 19 def initialize(file_name) FileUtils.touch file_name super file_name, 'r+' @new_body = StringIO.new @previous_body = read end |
Instance Method Details
#write!(options) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/conventional_changelog/writer.rb', line 27 def write!() build_new_lines seek 0 write @new_body.string write @previous_body end |