11
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

bump upを手でやらずにgemでやる

Last updated at Posted at 2016-12-05

bump gem

bump gem は Ruby で bump up を支援してくれるツールです。
CLIとしての用法と、Rake Task としての用法があります。

インストール

$ gem install bump

CLI仕様

command description
current 現在のバージョンを確認
patch パッチバージョンを更新
minor マイナーバージョンを更新
major メジャーバージョンを更新

セマンティック バージョニングにもとづいてバージョンを更新します。
セマンティック バージョニングについては下記を参照ください。

セマンティック バージョニング

デモ - CLI

$ bump current
Current version: 0.1.0
$ bump patch
[master 037cb55] v0.1.1
 1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 0.1.0 to 0.1.1
$ git log --oneline
037cb55 v0.1.1
$ bump current
Current version: 0.1.1
bd9f1d4 test
$ bump minor
[master 0c5659e] v0.2.0
 1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 0.1.1 to 0.2.0
$ git log --oneline
0c5659e v0.2.0
037cb55 v0.1.1
bd9f1d4 test
$ bump current
Current version: 0.2.0
$ bump major
[master c5f6f14] v1.0.0
1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 0.2.0 to 1.0.0
$ git log --oneline
c5f6f14 v1.0.0
0c5659e v0.2.0
037cb55 v0.1.1
bd9f1d4 test

デモ - Rake

spec_helper.rb
require "bump/tasks"
$ rake -T | grep bump
rake bump:current[tag]  # Show current gem version
rake bump:major[tag]    # Bump major part of gem version
rake bump:minor[tag]    # Bump minor part of gem version
rake bump:patch[tag]    # Bump patch part of gem version
rake bump:pre[tag]      # Bump pre part of gem version
rake bump:set           # Sets the version number using the VERSION environment variable
$ rake bump:current
Current version: 1.0.0
$ rake bump:patch
[master 539ab50] v1.0.1
 1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 1.0.0 to 1.0.1
$ rake bump:current
Current version: 1.0.1
$ rake bump:minor
[master 2c43b90] v1.1.0
 1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 1.0.1 to 1.1.0
$ rake bump:current
Current version: 1.1.0
$ rake bump:major
[master e0928c7] v2.0.0
 1 file changed, 1 insertion(+), 1 deletion(-)
Bump version 1.1.0 to 2.0.0
$ rake bump:current
Current version: 2.0.0
$ git log --oneline
e0928c7 v2.0.0
2c43b90 v1.1.0
539ab50 v1.0.1
c5f6f14 v1.0.0
0c5659e v0.2.0
037cb55 v0.1.1
bd9f1d4 test

外部資料

11
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?