Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 817 Bytes

plain_text.md

File metadata and controls

16 lines (11 loc) · 817 Bytes

RubyGemRelease::Version::PlainText

Reads and updates a file, such as VERSION, that holds only a MAJOR.MINOR.PATCH version and an optional final line ending, which updates keep. Prereleases and VERSION.yml are not supported.

require 'ruby-gem-release/version/plain_text'

version = RubyGemRelease::Version::PlainText.new(path: 'VERSION')
version.read
version.set!('1.2.3')
version.increment!(from: '1.2.3')

path: defaults to VERSION. set! and increment! write and return the new version. increment! bumps the patch, or part: :major or part: :minor. Pass the release version as from: so retries write the same result. Invalid versions raise without writing.

Wrap it in References to update version references in other files during the next development bump.