Make gem version with autoicrement build number.
set_version *vers, git: false, message: 'Build #%<version>s', tag: false
vers
— version numbers: major, minor, patch; and beta-flag — String or Symbol like 'alpha', 'beta', 'pre', 'rc' etc.git:
— named parameter — boolean. If set totrue
, method will check where gemspec is under git control, addgemvers
-file to git, and commit withmessage
.message:
— template for git commit message, can use named placeholders::version
— result full version;:major
,:minor
,:patch
and:beta
— parameters of calling;:build
— build number.
tag:
— iftrue
and git enabled it is adding tag named by version.
Gem::Specification.new do |g|
# some settings
# g.files = [. . .]
# important! files _must_ be set _before_ set_version call
g.set_version 1, 0, 0, 'beta'
end
See example in gemspec.