lib/gem/release/cmds/bump.rb in gem-release-2.0.0.dev.3 vs lib/gem/release/cmds/bump.rb in gem-release-2.0.0.dev.4
- old
+ new
@@ -43,10 +43,11 @@
DESCR = {
version: 'Target version: next [major|minor|patch|pre|release] or a given version number [x.x.x]',
commit: 'Create a commit after incrementing gem version',
message: 'Commit message template',
+ skip_ci: 'Add the [skip ci] tag to the commit message',
push: 'Push the new commit to the git remote repository',
remote: 'Git remote to push to (defaults to origin)',
sign: 'GPG sign the commit message',
tag: 'Shortcut for running the `gem tag` command',
recurse: 'Recurse into directories that contain gemspec files',
@@ -54,25 +55,29 @@
file: 'Full path to the version file'
}
DEFAULTS = {
commit: true,
- message: 'Bump to %{to} [skip ci]',
+ message: 'Bump to %{to} %{skip_ci}',
push: false,
remote: 'origin'
}
opt '-v', '--version VERSION', DESCR[:version] do |value|
opts[:version] = value
end
+ opt '-c', '--[no-]commit', DESCR[:commit] do |value|
+ opts[:commit] = value
+ end
+
opt '-m', '--message', DESCR[:message] do |value|
opts[:message] = value
end
- opt '-c', '--[no-]commit', DESCR[:commit] do |value|
- opts[:commit] = value
+ opt '--skip-ci', DESCR[:skip_ci] do |value|
+ opts[:skip_ci] = value
end
opt '-p', '--[no-]push', DESCR[:push] do |value|
opts[:push] = value
end
@@ -145,11 +150,11 @@
version.bump
end
def commit
cmd :git_add, version.path
- cmd :git_commit, message, opts[:sign] ? '-S' : ''
+ cmd :git_commit, message.strip, opts[:sign] ? '-S' : ''
end
def push
cmd :git_push, remote
end
@@ -165,10 +170,12 @@
def reset
@version = nil
end
def message
- opts[:message] % version.to_h
+ args = version.to_h
+ args = args.merge(skip_ci: opts[:skip_ci] ? '[skip ci]' : '')
+ opts[:message] % args
end
def version
@version ||= Files::Version.new(gem.name, opts[:version], only(opts, :file))
end