Class: Semvergen::ChangeLogFile
- Inherits:
-
Object
- Object
- Semvergen::ChangeLogFile
- Defined in:
- lib/semvergen/change_log_file.rb
Instance Method Summary collapse
Instance Method Details
#<<(message) ⇒ Object
5 6 7 8 9 |
# File 'lib/semvergen/change_log_file.rb', line 5 def <<() current_change_log = File.exist?(change_log_file) ? File.read(change_log_file) : "" new_change_log = "# Changelog\n\n#{message}" + current_change_log.gsub("# Changelog\n", "") File.open(change_log_file, "w") { |f| f.write new_change_log } end |