A gem to bump versions of gems and chef-cookbooks.
- bumps version major / minor / patch / pre
- bundles
- commits changes
gem install bump
bump current
0.1.2
bump patch
Bump version 0.1.2 to 0.1.3
bump show-next patch
0.1.3
bump file
lib/foo/version.rb
Do not commit after bumping.
bump patch --no-commit
Will add a git tag like v1.2.3
(if the current project is a git repository and --no-commit
has not been given).
bump patch --tag
The --tag-prefix
option can change the tag prefix:
bump patch --tag --tag-prefix v- # tag as v-1.2.3
bump patch --tag --tag-prefix "" # tag as 1.2.3
Do not run bundle
command after bumping.
bump patch --no-bundle
Bump the version in additional files.
bump patch --replace-in Readme.md
Append additional information to the commit message.
bump patch --commit-message "Something extra"
or
bump patch -m "Something extra"
Updates CHANGELOG.md
when bumping.
This requires a heading (starting with ##
) that includes the previous version and a heading above that, for example:
### Next
- Added bar
### v0.0.0 - 2019-12-24
- Added foo
Updates CHANGELOG.md when bumping (see above), and
opens the changelog in an editor specified in $EDITOR
(or vi
),
then waits for the editor to be closed and continues.
EDITOR="subl -n -w" bump patch --edit-changelog
# Rakefile
require "bump/tasks"
#
# do not always tag the version
# Bump.tag_by_default = false
#
# bump the version in additional files
# Bump.replace_in_default = ["Readme.md"]
#
# Maintain changelog:
# Bump.changelog = true
# Opens the changelog in an editor when bumping
# Bump.changelog = :editor
rake bump:current # display current version
rake bump:show-next INCREMENT=minor # display next minor version
rake bump:file # display version file path
# bumping using defaults for `COMMIT`, `TAG`, and `BUNDLE`
rake bump:major
rake bump:patch
rake bump:minor
rake bump:pre
# bumping with option(s)
rake bump:patch TAG=false BUNDLE=false # commit, but don't tag or run `bundle`
rake bump:patch TAG=true TAG_PREFIX=v- # tag with a prefix 'v-' ex. the tag will look like v-0.0.1
rake bump:patch COMMIT=false TAG=false # don't commit, don't tag
rake bump:minor BUNDLE=false # don't run `bundle`
rake bump:minor COMMIT_MESSAGE="release it" # custom commit message, appended to version
require "bump"
Bump::Bump.current # -> "1.2.3"
Bump::Bump.next_version("patch") # -> "1.2.4"
Bump::Bump.file # -> "lib/foo/version.rb"
Bump::Bump.run("patch") # -> version changed
Bump::Bump.run("patch", tag: true, tag_prefix: 'v-') # -> version changed with tagging with '-v' as prefix
Bump::Bump.run("patch", commit: false, bundle:false, tag:false) # -> version changed with options
Bump::Bump.run("patch", commit_message: '[no ci]') # -> creates a commit message with 'v1.2.3 [no ci]' instead of default: 'v1.2.3'
VERSION
file with1.2.3
gemspec
withgem.version = "1.2.3"
orGem:Specification.new "gem-name", "1.2.3" do
lib/**/version.rb
file withVERSION = "1.2.3"
metadata.rb
withversion "1.2.3"
VERSION = "1.2.3"
inlib/**/*.rb
Gregory
License: MIT