Skip to content

Commit

Permalink
Bumping with commit message feels like git command.
Browse files Browse the repository at this point in the history
  • Loading branch information
gizipp committed Jul 17, 2016
1 parent 6ee9dfa commit df04e2b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -40,11 +40,15 @@ If you don't want to run the `bundle` command after bumping, add the `--no-bundl

bump patch --no-bundle

### --commit-message [MSG]
If you want to append additional information to the commit message, pass it in using the `--commit-message [MSG]` option.
### --commit-message [MSG], -m [MSG]
If you want to append additional information to the commit message, pass it in using the `--commit-message [MSG]` or `-m [MSG]` option.

bump patch --commit-message [no-ci]

or

bump patch -m [no-cli]

### Rake

```Ruby
Expand Down
2 changes: 1 addition & 1 deletion bin/bump
Expand Up @@ -17,7 +17,7 @@ Usage:
Options:
BANNER
opts.on("--no-commit", "Do not make a commit.") { options[:commit] = false }
opts.on("--commit-message [MSG]", "Append MSG to the commit message.") {|msg| options[:commit_message] = msg }
opts.on("-m","--commit-message [MSG]", "Append MSG to the commit message.") {|msg| options[:commit_message] = msg }
opts.on("--no-bundle", "Do not bundle.") { options[:bundle] = false }
opts.on("--tag", "Create git tag from version (only if commit is true).") { options[:tag] = true }
opts.on("-h", "--help","Show this.") { puts opts; exit }
Expand Down
20 changes: 20 additions & 0 deletions spec/bump_spec.rb
Expand Up @@ -45,6 +45,26 @@
`git status`.should include "nothing to commit"
end

it "should append commit message if --commit-message flag was given" do
write_gemspec
`git add #{gemspec}`

bump("patch --commit-message 'Commit message.'")

`git log -1 --pretty=format:'%s'`.should include "Commit message."
`git status`.should include "nothing to commit"
end

it "should append commit message if -m flag gas given" do
write_gemspec
`git add #{gemspec}`

bump("patch -m 'Commit message.'")

`git log -1 --pretty=format:'%s'`.should include "Commit message."
`git status`.should include "nothing to commit"
end

it "should not commit if --no-commit flag was given" do
write_gemspec
`git add #{gemspec}`
Expand Down

0 comments on commit df04e2b

Please sign in to comment.