Giter VIP home page Giter VIP logo

bump's Introduction

Gem Version

A gem to bump versions of gems and chef-cookbooks.

  • bumps version major / minor / patch / pre
  • bundles
  • commits changes

Installation

gem install bump

Usage

Show current version

bump current

0.1.2

Bump (major, minor, patch, pre)

bump patch

Bump version 0.1.2 to 0.1.3

Show next version

bump show-next patch

0.1.3

Show version file path

bump file

lib/foo/version.rb

Options

--no-commit

Do not commit after bumping.

bump patch --no-commit

--tag

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

--no-bundle

Do not run bundle command after bumping.

bump patch --no-bundle

--replace-in

Bump the version in additional files.

bump patch --replace-in Readme.md

--commit-message [MSG], -m [MSG]

Append additional information to the commit message.

bump patch --commit-message "Something extra"

or

bump patch -m "Something extra"

--changelog

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

--edit-changelog

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

Rake

# 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

Ruby

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'

Supported locations

  • VERSION file with 1.2.3
  • gemspec with gem.version = "1.2.3" or Gem:Specification.new "gem-name", "1.2.3" do
  • lib/**/version.rb file with VERSION = "1.2.3"
  • metadata.rb with version "1.2.3"
  • VERSION = "1.2.3" in lib/**/*.rb

Author

Gregory
License: MIT

bump's People

Contributors

gregorym avatar grosser avatar salzig avatar jasonkarns avatar goyalmunish avatar robcarruthers avatar revolter avatar jvanderhoof avatar olleolleolle avatar ysv avatar apanzerj avatar aried3r avatar dadah89 avatar modsognir avatar hauleth avatar abangratz avatar bethesque avatar randome avatar bukharih avatar mscoutermarsh avatar bergholdt avatar dnd avatar amatsuda avatar davefp avatar gizipp avatar jasonwbarnett avatar hidr0 avatar tamgrosser avatar tobias-grasse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.