Skip to content

Commit a2e2500

Browse files
committed
Increment version with version_boss instead of semverify
1 parent 44f8d15 commit a2e2500

File tree

8 files changed

+89
-88
lines changed

8 files changed

+89
-88
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ Options:
6666
-t, --pre-type=TYPE Type of pre-release to create (e.g. alpha, beta, etc.)
6767
--remote=REMOTE_NAME Use this remote name instead of 'origin'
6868
--last-release-version=VERSION
69-
Use this version instead `semverify current`
69+
Use this version instead `gem-version-boss current`
7070
--next-release-version=VERSION
71-
Use this version instead `semverify next-RELEASE_TYPE`
71+
Use this version instead `gem-version-boss next-RELEASE_TYPE`
7272
--changelog-path=PATH Use this file instead of CHANGELOG.md
7373
-q, --[no-]quiet Do not show output
7474
-v, --[no-]verbose Show extra output
@@ -90,10 +90,10 @@ If this is to be the first release of this gem follow these instructions.
9090
For this use case, let's assume the following:
9191

9292
* the default branch is `main` (this is the HEAD branch returned by `git remote show origin`)
93-
* the current version of the gem is `0.1.0` (as returned by `semverify current`)
93+
* the current version of the gem is `0.1.0` (as returned by `gem-version-boss current`)
9494

9595
If a different first version number is desired, update the version number in the
96-
source code making sure that `semverify current` returns the desired version number.
96+
source code making sure that `gem-version-boss current` returns the desired version number.
9797
Then commit the change to the default branch on the remote before running this
9898
script.
9999

@@ -131,7 +131,7 @@ create-github-release first
131131

132132
The `create-github-release` script will do the following:
133133

134-
* Determine the next-release version (`v0.1.0`) using `semverify current`
134+
* Determine the next-release version (`v0.1.0`) using `gem-version-boss current`
135135
* Update the project's changelog file `CHANGELOG.md`
136136
* Create a release branch `release-v0.1.0`
137137
* Commit the changes to the changelog and create a release tag (`v0.1.0`) pointing
@@ -148,7 +148,7 @@ In order to start using `create-github-release` after you have used some other
148148
method for managing the gem version and creating releases, you need to ensure the
149149
following prerequisites are met:
150150

151-
1. that `semverify current` is the version of the last release (let's use `1.3.1` as an
151+
1. that `gem-version-boss current` is the version of the last release (let's use `1.3.1` as an
152152
example).
153153
2. that there is a corresponding release tag that points to the last commit on the
154154
default branch of the previous release. If the last version was `1.3.1`, then
@@ -173,7 +173,7 @@ For this use case, let's assume the following:
173173

174174
* you want to create a `major` release
175175
* the default branch is `main` (this is the HEAD branch returned by `git remote show origin`)
176-
* the current version of the gem is `0.1.0` (as returned by `semverify current`)
176+
* the current version of the gem is `0.1.0` (as returned by `gem-version-boss current`)
177177

178178
The following prerequisites must be met:
179179

@@ -196,9 +196,9 @@ create-github-release major
196196

197197
The `create-github-release` script will do the following:
198198

199-
* Determine the last-release version using `semverify current`
200-
* Determine the next-release version using `semverify RELEASE_TYPE --dry-run`
201-
* Increment the project's version using `semverify RELEASE_TYPE`
199+
* Determine the last-release version using `gem-version-boss current`
200+
* Determine the next-release version using `gem-version-boss RELEASE_TYPE --dry-run`
201+
* Increment the project's version using `gem-version-boss RELEASE_TYPE`
202202
* Update the project's changelog file `CHANGELOG.md`
203203
* Create a release branch `release-v1.0.0`
204204
* Commit the changes to the version and changelog AND create a release tag (`v1.0.0`) pointing

create_github_release.gemspec

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@ Gem::Specification.new do |spec|
3535
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3636
spec.require_paths = ['lib']
3737

38-
spec.add_runtime_dependency 'semverify', '~> 0.3'
38+
spec.add_runtime_dependency 'version_boss', '~> 0.1'
3939

4040
spec.add_development_dependency 'bundler-audit', '~> 0.9'
41-
spec.add_development_dependency 'debug', '~> 1.7'
42-
spec.add_development_dependency 'rake', '~> 13.0'
43-
spec.add_development_dependency 'redcarpet', '~> 3.5'
44-
spec.add_development_dependency 'rspec', '~> 3.10'
45-
spec.add_development_dependency 'rubocop', '~> 1.36'
46-
spec.add_development_dependency 'simplecov', '~> 0.21'
41+
spec.add_development_dependency 'debug', '~> 1.9'
42+
spec.add_development_dependency 'rake', '~> 13.2'
43+
spec.add_development_dependency 'redcarpet', '~> 3.6'
44+
spec.add_development_dependency 'rspec', '~> 3.13'
45+
spec.add_development_dependency 'rubocop', '~> 1.63'
46+
spec.add_development_dependency 'simplecov', '~> 0.22'
4747
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
48-
# spec.add_development_dependency 'solargraph', '~> 0.49'
4948
spec.add_development_dependency 'timecop', '~> 0.9'
5049
spec.add_development_dependency 'yard', '~> 0.9'
5150
spec.add_development_dependency 'yardstick', '~> 0.9'

exe/revert-github-release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Options
1515
attr_writer :default_branch, :release_version, :release_tag, :release_branch, :current_branch, :remote
1616

1717
def default_branch = @default_branch ||= 'main'
18-
def release_version = @release_version ||= `semverify current`.chomp
18+
def release_version = @release_version ||= `gem-version-boss current`.chomp
1919
def release_tag = @release_tag ||= "v#{release_version}"
2020
def release_branch = @release_branch ||= "release-#{release_tag}"
2121
def current_branch = @current_branch ||= `git rev-parse --abbrev-ref HEAD`.chomp

lib/create_github_release/command_line/parser.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ def define_remote_option
222222
# @return [void]
223223
# @api private
224224
def define_last_release_version_option
225-
option_parser.on('--last-release-version=VERSION', 'Use this version instead `semverify current`') do |version|
225+
option_parser.on('--last-release-version=VERSION',
226+
'Use this version instead `gem-version-boss current`') do |version|
226227
options.last_release_version = version
227228
end
228229
end
@@ -233,7 +234,7 @@ def define_last_release_version_option
233234
def define_next_release_version_option
234235
option_parser.on(
235236
'--next-release-version=VERSION',
236-
'Use this version instead `semverify next-RELEASE_TYPE`'
237+
'Use this version instead `gem-version-boss next-RELEASE_TYPE`'
237238
) do |version|
238239
options.next_release_version = version
239240
end

lib/create_github_release/project.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require 'semverify'
3+
require 'version_boss'
44
require 'uri'
55

66
module CreateGithubRelease
@@ -194,7 +194,7 @@ def tag_exist?(tag)
194194
#
195195
# The version of the next release
196196
#
197-
# @example By default, `next_release_version` is based on the value returned by `semverify <release_type> --dry-run`
197+
# @example By default, `next_release_version` is based on `gem-version-boss <release_type> --dry-run`
198198
# options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
199199
# project = CreateGithubRelease::Project.new(options)
200200
# project.next_release_version #=> '1.0.0'
@@ -207,7 +207,7 @@ def tag_exist?(tag)
207207
#
208208
# @return [String]
209209
#
210-
# @raise [RuntimeError] if the semverify command fails
210+
# @raise [RuntimeError] if the gem-version-boss command fails
211211
#
212212
# @api public
213213
#
@@ -245,7 +245,7 @@ def last_release_tag
245245
#
246246
# The version of the last release
247247
#
248-
# @example By default, `last_release_version` is based on the value returned by `semverify current`
248+
# @example By default, `last_release_version` is based on the value returned by `gem-version-boss current`
249249
# options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
250250
# project = CreateGithubRelease::Project.new(options)
251251
# project.last_release_version #=> '0.0.1'
@@ -258,7 +258,7 @@ def last_release_tag
258258
#
259259
# @return [String]
260260
#
261-
# @raise [RuntimeError] if the semverify command fails
261+
# @raise [RuntimeError] if the gem-version-boss command fails
262262
#
263263
# @api public
264264
#
@@ -284,7 +284,7 @@ def last_release_version
284284
#
285285
# @return [String]
286286
#
287-
# @raise [RuntimeError] if the semverify command fails
287+
# @raise [RuntimeError] if the gem-version-boss command fails
288288
#
289289
# @api public
290290
#
@@ -312,7 +312,7 @@ def release_branch
312312
#
313313
# @return [URI]
314314
#
315-
# @raise [RuntimeError] if the semverify command fails
315+
# @raise [RuntimeError] if the gem-version-boss command fails
316316
#
317317
# @api public
318318
#
@@ -369,7 +369,7 @@ def release_pr_url
369369
#
370370
# The type of the release being created (e.g. 'major', 'minor', 'patch')
371371
#
372-
# @note this must be one of the values accepted by the `semverify` command
372+
# @note this must be one of the values accepted by the `gem-version-boss` command
373373
#
374374
# @example By default, this value comes from the options object
375375
# options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
@@ -913,22 +913,22 @@ def first_commit
913913

914914
private
915915

916-
# The current version of the project as determined by semverify
916+
# The current version of the project as determined by gem-version-boss
917917
# @return [String] The current version of the project
918918
# @api private
919919
def current_version
920-
output = `semverify current`
921-
raise 'Could not determine current version using semverify' unless $CHILD_STATUS.success?
920+
output = `gem-version-boss current`
921+
raise 'Could not determine current version using gem-version-boss' unless $CHILD_STATUS.success?
922922

923923
output.lines.last.chomp
924924
end
925925

926-
# The next version of the project as determined by semverify and release_type
926+
# The next version as determined by gem-version-boss and release_type
927927
# @return [String] The next version of the project
928928
# @api private
929929
def next_version
930930
output = `#{next_version_cmd}`
931-
raise 'Could not determine next version using semverify' unless $CHILD_STATUS.success?
931+
raise 'Could not determine next version using gem-version-boss' unless $CHILD_STATUS.success?
932932

933933
output.lines.last.chomp
934934
end
@@ -937,7 +937,7 @@ def next_version
937937
# @return [String]
938938
# @api private
939939
def next_version_cmd
940-
cmd = "semverify next-#{release_type}"
940+
cmd = "gem-version-boss next-#{release_type}"
941941
cmd << ' --pre' if pre
942942
cmd << " --pre-type=#{pre_type}" if pre_type
943943
cmd << ' --dry-run'

lib/create_github_release/tasks/update_version.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
module CreateGithubRelease
77
module Tasks
8-
# Update the gem version using semverify
8+
# Update the gem version using gem-version-boss
99
#
1010
# @api public
1111
#
1212
class UpdateVersion < TaskBase
13-
# Update the gem version using semverify
13+
# Update the gem version using gem-version-boss
1414
#
1515
# @example
1616
# require 'create_github_release'
@@ -39,28 +39,28 @@ def run
3939

4040
private
4141

42-
# Increment the version using semverify
42+
# Increment the version using gem-version-boss
4343
# @return [void]
4444
# @api private
4545
def increment_version
46-
command = "semverify next-#{project.release_type}"
46+
command = "gem-version-boss next-#{project.release_type}"
4747
command += ' --pre' if project.pre
4848
command += " --pre-type=#{project.pre_type}" if project.pre_type
4949
`#{command}`
5050
error 'Could not increment version' unless $CHILD_STATUS.success?
5151
end
5252

53-
# Return the path the the version file using semverify
53+
# Return the path the the version file using gem-version-boss
5454
# @return [String]
5555
# @api private
5656
def version_file
57-
output = `semverify file`
58-
error 'Semverify could determine the version file' unless $CHILD_STATUS.success?
57+
output = `gem-version-boss file`
58+
error 'Could determine the version file' unless $CHILD_STATUS.success?
5959

6060
output.lines.last.chomp
6161
end
6262

63-
# Identify the version file using semverify and stage the change to it
63+
# Identify the version file using gem-version-boss and stage the change to it
6464
# @return [void]
6565
# @api private
6666
def stage_version_file

0 commit comments

Comments
 (0)