version_boss 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.commitlintrc.yml +16 -0
- data/.husky/commit-msg +1 -0
- data/.markdownlint.yml +25 -0
- data/.release-please-manifest.json +3 -0
- data/.rubocop.yml +6 -35
- data/.yardopts +1 -1
- data/CHANGELOG.md +32 -0
- data/LICENSE.txt +1 -1
- data/README.md +82 -39
- data/Rakefile +9 -7
- data/lib/version_boss/gem/incrementable_version.rb +3 -8
- data/lib/version_boss/gem/version_file.rb +6 -4
- data/lib/version_boss/gem/version_file_sources/base.rb +2 -0
- data/lib/version_boss/gem/version_file_sources/gemspec.rb +5 -1
- data/lib/version_boss/gem/version_file_sources/version.rb +4 -0
- data/lib/version_boss/gem/version_file_sources/version_rb.rb +4 -0
- data/lib/version_boss/semver/incrementable_version.rb +4 -8
- data/lib/version_boss/version.rb +1 -1
- data/package.json +11 -0
- data/release-please-config.json +22 -0
- data/version_boss.gemspec +12 -5
- metadata +48 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f7984c59cd458be133c9688471edf381fb621b03ace259f16e41e049196eadf
|
4
|
+
data.tar.gz: 21155aea33ed629e422789ec01ca7bda16d5b771c8766d3954d2b95546ef72c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53984fb1eb41b686e3c733225d326a5382ea21f14148a95a0e8bf4977e17ea05e0ba0bcab18c6997fb1e4e25cf97eec9c173510213dac8200e0711c3cb20b62c
|
7
|
+
data.tar.gz: 2be4baa6042c6d1444af73b629acd72bbd1dcbfb88c86395a4d977db0a11def1ccddb05fc6382941ea07646542e1598bd1e850a17ea77166a3ee98c57bf8603c
|
data/.commitlintrc.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
extends: '@commitlint/config-conventional'
|
3
|
+
|
4
|
+
rules:
|
5
|
+
# See: https://commitlint.js.org/reference/rules.html
|
6
|
+
#
|
7
|
+
# Rules are made up by a name and a configuration array. The configuration array contains:
|
8
|
+
#
|
9
|
+
# * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if violated
|
10
|
+
# * Applicability [always|never]: never inverts the rule
|
11
|
+
# * Value: value to use for this rule
|
12
|
+
#
|
13
|
+
# Run `npx commitlint --print-config` to see the current setting for all rules.
|
14
|
+
#
|
15
|
+
body-leading-blank: [2, 'always']
|
16
|
+
footer-leading-blank: [2, 'always']
|
data/.husky/commit-msg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
npx --no-install commitlint --edit "$1"
|
data/.markdownlint.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
default: true
|
2
|
+
|
3
|
+
# Unordered list indentation
|
4
|
+
MD007: { indent: 2 }
|
5
|
+
|
6
|
+
# Line length
|
7
|
+
MD013: { line_length: 90, tables: false, code_blocks: false }
|
8
|
+
|
9
|
+
# Heading duplication is allowed for non-sibling headings
|
10
|
+
MD024: { siblings_only: true }
|
11
|
+
|
12
|
+
# Do not allow the specified trailing punctuation in a header
|
13
|
+
MD026: { punctuation: '.,;:' }
|
14
|
+
|
15
|
+
# Order list items must have a prefix that increases in numerical order
|
16
|
+
MD029: { style: 'ordered' }
|
17
|
+
|
18
|
+
# Lists do not need to be surrounded by blank lines
|
19
|
+
MD032: false
|
20
|
+
|
21
|
+
# Allow raw HTML in Markdown
|
22
|
+
MD033: false
|
23
|
+
|
24
|
+
# Allow emphasis to be used instead of a heading
|
25
|
+
MD036: false
|
data/.rubocop.yml
CHANGED
@@ -1,36 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# Output extra information for each offense to make it easier to diagnose:
|
4
|
-
DisplayCopNames: true
|
5
|
-
DisplayStyleGuide: true
|
6
|
-
ExtraDetails: true
|
7
|
-
SuggestExtensions: false
|
8
|
-
# RuboCop enforces rules depending on the oldest version of Ruby which
|
9
|
-
# your project supports:
|
10
|
-
TargetRubyVersion: 3.0
|
11
|
-
|
12
|
-
Gemspec/DevelopmentDependencies:
|
13
|
-
EnforcedStyle: gemspec
|
14
|
-
|
15
|
-
# The default max line length is 80 characters
|
16
|
-
Layout/LineLength:
|
17
|
-
Max: 120
|
18
|
-
|
19
|
-
# The DSL for RSpec and the gemspec file make it very hard to limit block length:
|
20
|
-
Metrics/BlockLength:
|
21
|
-
Exclude:
|
22
|
-
- "spec/spec_helper.rb"
|
23
|
-
- "spec/**/*_spec.rb"
|
24
|
-
- "*.gemspec"
|
1
|
+
inherit_gem:
|
2
|
+
main_branch_shared_rubocop_config: config/rubocop.yml
|
25
3
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
Metrics/ClassLength:
|
31
|
-
CountAsOne: ['hash']
|
32
|
-
Exclude:
|
33
|
-
- "test/**/*_test.rb"
|
34
|
-
|
35
|
-
Style/AsciiComments:
|
36
|
-
Enabled: false
|
4
|
+
AllCops:
|
5
|
+
# Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2
|
6
|
+
# or later.
|
7
|
+
TargetRubyVersion: 3.1
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,35 @@
|
|
1
|
+
## v0.2.0 (2024-10-10)
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/main-branch/version_boss/compare/v0.1.0..v0.2.0)
|
4
|
+
|
5
|
+
Changes since v0.1.0:
|
6
|
+
|
7
|
+
* 777871d chore: update create_github_release dependency
|
8
|
+
* 8225040 build: remove semver pr label check
|
9
|
+
* 3853ff7 build: enforce conventional commit message formatting
|
10
|
+
* 3c08516 Clarify gem description and installation instructions
|
11
|
+
* 012f717 Add TargetRubyVersion in .rubocop.yml
|
12
|
+
* 4065647 Use shared Rubocop config
|
13
|
+
* 1dc115f Update copyright notice in this project
|
14
|
+
* 4a3f092 Update links in gemspec
|
15
|
+
* a4475f2 Add Slack badge for this project in README
|
16
|
+
* 28234d4 Update “Build Status” link the README
|
17
|
+
* e5b59d7 Standardize YARD and Markdown Lint configurations
|
18
|
+
* aa5851a Set JRuby —debug option when running tests in GitHub Actions workflows
|
19
|
+
* 3869e9c Integrate SimpleCov::RSpec into the project
|
20
|
+
* 4fe44a8 Use latest version of create_github_release
|
21
|
+
* a6ae0af Update continuous integration and experimental ruby builds
|
22
|
+
* 44ea99f Enforce the use of semver tags on PRs
|
23
|
+
* baabc32 Auto correct new rubocop offenses
|
24
|
+
* 8f74384 Release v0.1.0
|
25
|
+
|
26
|
+
## [0.2.1](https://github.com/main-branch/version_boss/compare/v0.2.0...v0.2.1) (2025-04-16)
|
27
|
+
|
28
|
+
|
29
|
+
### Bug Fixes
|
30
|
+
|
31
|
+
* Automate commit-to-publish workflow ([be256ae](https://github.com/main-branch/version_boss/commit/be256ae4dfdf051fcaaf760113011859806a6ccb))
|
32
|
+
|
1
33
|
## v0.1.0 (2024-05-07)
|
2
34
|
|
3
35
|
[Full Changelog](https://github.com/main-branch/version_boss/compare/26b5491..v0.1.0)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# The `version_boss` gem
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/version_boss)
|
4
4
|
[](https://rubydoc.info/gems/version_boss/)
|
5
5
|
[](https://rubydoc.info/gems/version_boss/file/CHANGELOG.md)
|
6
|
-
[](https://github.com/main-branch/version_boss/actions/workflows/continuous-integration.yml)
|
7
|
+
[](https://conventionalcommits.org)
|
9
|
+
[](https://main-branch.slack.com/archives/C07MCMDBJLX)
|
9
10
|
|
10
|
-
Parse, compare, and increment Gem and
|
11
|
+
Parse, compare, and increment Gem and [SemVer](https://semver.org) versions.
|
11
12
|
|
12
|
-
This gem installs the `gem-version-boss`
|
13
|
-
based on
|
13
|
+
This gem installs the `gem-version-boss` command-line tool to display and increment a
|
14
|
+
gem's version based on [Semantic Versioning](https://semver.org) rules.
|
14
15
|
|
15
16
|
`gem-version-boss` can replace the `bump` command from the [bump
|
16
17
|
gem](https://rubygems.org/gems/bump/) for incrementing gem version strings.
|
@@ -18,10 +19,8 @@ gem](https://rubygems.org/gems/bump/) for incrementing gem version strings.
|
|
18
19
|
How `gem-version-boss` differs from `bump`:
|
19
20
|
|
20
21
|
* `gem-version-boss` can manage pre-release versions
|
21
|
-
* `
|
22
|
-
|
23
|
-
* `bump` can update the version in extra files you to specify extra files to
|
24
|
-
increment the version in
|
22
|
+
* `gem-version-boss` can not commit or tag the version file changes it makes
|
23
|
+
* `gem-version-boss` can not update multiple files at a time
|
25
24
|
|
26
25
|
Example CLI commands:
|
27
26
|
|
@@ -37,7 +36,7 @@ gem-version-boss current
|
|
37
36
|
# Display the gem version file
|
38
37
|
gem-version-boss file
|
39
38
|
|
40
|
-
# Validate that a version
|
39
|
+
# Validate that a version is valid
|
41
40
|
gem-version-boss validate VERSION
|
42
41
|
|
43
42
|
# Get more detailed help for each command listed above
|
@@ -46,27 +45,40 @@ gem-version-boss help [COMMAND]
|
|
46
45
|
|
47
46
|
* [Installation](#installation)
|
48
47
|
* [Command Line](#command-line)
|
49
|
-
|
50
|
-
|
48
|
+
* [Usage](#usage)
|
49
|
+
* [Examples](#examples)
|
51
50
|
* [Library Usage](#library-usage)
|
52
|
-
|
53
|
-
|
51
|
+
* [VersionBoss::Gem classes](#versionbossgem-classes)
|
52
|
+
* [VersionBoss::Semver classes](#versionbosssemver-classes)
|
54
53
|
* [Development](#development)
|
55
54
|
* [Contributing](#contributing)
|
55
|
+
* [Commit message guidelines](#commit-message-guidelines)
|
56
|
+
* [Pull request guidelines](#pull-request-guidelines)
|
56
57
|
* [License](#license)
|
57
58
|
|
58
59
|
## Installation
|
59
60
|
|
60
|
-
|
61
|
+
To install the gem, add to the following line to your application's gemspec OR
|
62
|
+
Gemfile:
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
+
gemspec:
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
spec.add_development_dependency "version_boss", '~> 0.1'
|
68
|
+
```
|
69
|
+
|
70
|
+
Gemfile:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
gem "version_boss", "~> 0.1", groups: [:development, :test]
|
64
74
|
```
|
65
75
|
|
76
|
+
and then run `bundle install`.
|
77
|
+
|
66
78
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
67
79
|
|
68
80
|
```shell
|
69
|
-
gem install version_boss
|
81
|
+
gem install version_boss
|
70
82
|
```
|
71
83
|
|
72
84
|
## Command Line
|
@@ -121,34 +133,38 @@ Description:
|
|
121
133
|
|
122
134
|
### Examples
|
123
135
|
|
136
|
+
Assuming the gem version starts at 1.2.3:
|
137
|
+
|
124
138
|
```shell
|
125
|
-
gem-version-boss current
|
139
|
+
$ gem-version-boss current
|
140
|
+
1.2.3
|
126
141
|
|
127
|
-
gem-version-boss
|
128
|
-
|
142
|
+
$ gem-version-boss next-patch
|
143
|
+
1.2.4
|
129
144
|
|
130
|
-
gem-version-boss next-
|
131
|
-
|
132
|
-
gem-version-boss next-major # 0.2.0 -> 1.0.0
|
145
|
+
$ gem-version-boss next-minor
|
146
|
+
1.3.0
|
133
147
|
|
134
|
-
|
135
|
-
|
148
|
+
$ gem-version-boss next-major
|
149
|
+
2.0.0
|
136
150
|
|
137
|
-
#
|
138
|
-
gem-version-boss next-major --pre --pre-type=alpha
|
151
|
+
# Create a pre-release version for the next major version
|
152
|
+
$ gem-version-boss next-major --pre --pre-type=alpha
|
153
|
+
3.0.0.alpha1
|
139
154
|
|
140
|
-
# Increment pre-release
|
141
|
-
gem-version-boss next-pre
|
155
|
+
# Increment the pre-release version
|
156
|
+
$ gem-version-boss next-pre
|
157
|
+
3.0.0.alpha2
|
142
158
|
|
143
|
-
# Change the pre-release type
|
144
|
-
gem-version-boss pre --pre-type=beta
|
159
|
+
# Change the pre-release type to "beta"
|
160
|
+
$ gem-version-boss next-pre --pre-type=beta
|
161
|
+
3.0.0.beta1
|
145
162
|
|
146
|
-
# Create release from pre-release
|
147
|
-
gem-version-boss release
|
163
|
+
# Create a release version from the pre-release version
|
164
|
+
$ gem-version-boss next-release
|
165
|
+
3.0.0
|
148
166
|
```
|
149
167
|
|
150
|
-
This gem also provides the following classes:
|
151
|
-
|
152
168
|
## Library Usage
|
153
169
|
|
154
170
|
[Detailed API documenation](https://rubydoc.info/gems/version_boss/) is hosted on
|
@@ -159,7 +175,9 @@ The main classes are:
|
|
159
175
|
### VersionBoss::Gem classes
|
160
176
|
|
161
177
|
* **VersionBoss::Gem::Version** knows how to parse, validate, and compare [Ruby Gem
|
162
|
-
version strings](https://guides.rubygems.org/patterns/#semantic-versioning)
|
178
|
+
version strings](https://guides.rubygems.org/patterns/#semantic-versioning) which
|
179
|
+
may include [prerelease
|
180
|
+
versions](https://guides.rubygems.org/patterns/#prerelease-gems).
|
163
181
|
|
164
182
|
* **VersionBoss::Gem::IncrementableVersion** knows how to increment Ruby Gem version
|
165
183
|
strings according to SemVer rules.
|
@@ -193,6 +211,31 @@ commits and the created tag, and push the `.gem` file to
|
|
193
211
|
Bug reports and pull requests are welcome on GitHub at
|
194
212
|
https://github.com/main-branch/version_boss.
|
195
213
|
|
214
|
+
### Commit message guidelines
|
215
|
+
|
216
|
+
All commit messages must follow the [Conventional Commits
|
217
|
+
standard](https://www.conventionalcommits.org/en/v1.0.0/). This helps us maintain a
|
218
|
+
clear and structured commit history, automate versioning, and generate changelogs
|
219
|
+
effectively.
|
220
|
+
|
221
|
+
To ensure compliance, this project includes:
|
222
|
+
|
223
|
+
* A git commit-msg hook that validates your commit messages before they are accepted.
|
224
|
+
|
225
|
+
To activate the hook, you must have node installed and run `npm install`.
|
226
|
+
|
227
|
+
* A GitHub Actions workflow that will enforce the Conventional Commit standard as
|
228
|
+
part of the continuous integration pipeline.
|
229
|
+
|
230
|
+
Any commit message that does not conform to the Conventional Commits standard will
|
231
|
+
cause the workflow to fail and not allow the PR to be merged.
|
232
|
+
|
233
|
+
### Pull request guidelines
|
234
|
+
|
235
|
+
All pull requests must be merged using rebase merges. This ensures that commit
|
236
|
+
messages from the feature branch are preserved in the release branch, keeping the
|
237
|
+
history clean and meaningful.
|
238
|
+
|
196
239
|
## License
|
197
240
|
|
198
241
|
The gem is available as open source under the terms of the [MIT
|
data/Rakefile
CHANGED
@@ -25,6 +25,13 @@ rescue Bundler::BundlerError => e
|
|
25
25
|
exit e.status_code
|
26
26
|
end
|
27
27
|
|
28
|
+
# Make it so that calling `rake release` just calls `rake release:rubygems_push` to
|
29
|
+
# avoid creating and pushing a new tag.
|
30
|
+
|
31
|
+
Rake::Task['release'].clear
|
32
|
+
desc 'Customized release task to avoid creating a new tag'
|
33
|
+
task release: 'release:rubygem_push'
|
34
|
+
|
28
35
|
CLEAN << 'pkg'
|
29
36
|
CLEAN << 'Gemfile.lock'
|
30
37
|
|
@@ -49,14 +56,9 @@ CLEAN << 'rspec-report.xml'
|
|
49
56
|
|
50
57
|
require 'rubocop/rake_task'
|
51
58
|
|
52
|
-
RuboCop::RakeTask.new
|
53
|
-
t.options = %w[
|
54
|
-
--format progress
|
55
|
-
--format json --out rubocop-report.json
|
56
|
-
]
|
57
|
-
end
|
59
|
+
RuboCop::RakeTask.new
|
58
60
|
|
59
|
-
|
61
|
+
# YARD
|
60
62
|
|
61
63
|
unless RUBY_PLATFORM == 'java'
|
62
64
|
# yard:build
|
@@ -31,14 +31,7 @@ module VersionBoss
|
|
31
31
|
# @return [Boolean] true if the version string is a valid semver and meets the conditions above
|
32
32
|
#
|
33
33
|
def valid?
|
34
|
-
super && (
|
35
|
-
pre_release.empty? ||
|
36
|
-
(
|
37
|
-
pre_release_identifiers.size == 2 &&
|
38
|
-
pre_type.is_a?(String) &&
|
39
|
-
pre_number.is_a?(Integer)
|
40
|
-
)
|
41
|
-
)
|
34
|
+
super && (pre_release.empty? || (pre_release_identifiers.size == 2 && pre_number.is_a?(Integer)))
|
42
35
|
end
|
43
36
|
|
44
37
|
# The default pre-release identifier
|
@@ -194,9 +187,11 @@ module VersionBoss
|
|
194
187
|
def assert_pre_type_is_valid(pre_type)
|
195
188
|
return if self.pre_type <= pre_type
|
196
189
|
|
190
|
+
# :nocov: JRuby coverage does not report this line correctly
|
197
191
|
message = 'Cannot increment the pre-release identifier ' \
|
198
192
|
"from '#{self.pre_type}' to '#{pre_type}' " \
|
199
193
|
"because '#{self.pre_type}' is lexically less than '#{pre_type}'"
|
194
|
+
# :nocov:
|
200
195
|
|
201
196
|
raise VersionBoss::Error, message
|
202
197
|
end
|
@@ -26,8 +26,9 @@ module VersionBoss
|
|
26
26
|
# @api private
|
27
27
|
#
|
28
28
|
def initialize(path, content_before, version, content_after)
|
29
|
-
|
30
|
-
|
29
|
+
unless version.is_a?(VersionBoss::Gem::IncrementableVersion)
|
30
|
+
raise VersionBoss::Error, 'version must be an IncrementableVersion'
|
31
|
+
end
|
31
32
|
|
32
33
|
@path = path
|
33
34
|
@content_before = content_before
|
@@ -92,8 +93,9 @@ module VersionBoss
|
|
92
93
|
# @api public
|
93
94
|
#
|
94
95
|
def version=(new_version)
|
95
|
-
|
96
|
-
|
96
|
+
unless new_version.is_a?(VersionBoss::Gem::IncrementableVersion)
|
97
|
+
raise VersionBoss::Error, 'new_version must be an IncrementableVersion'
|
98
|
+
end
|
97
99
|
|
98
100
|
@version = version
|
99
101
|
File.write(path, content_before + new_version.to_s + content_after)
|
@@ -18,7 +18,9 @@ module VersionBoss
|
|
18
18
|
# @return [VersionBoss::Gem::VersionFile, nil] the version file or nil if no version file was found
|
19
19
|
#
|
20
20
|
def self.find
|
21
|
+
# :nocov: JRuby does not mark the following line as covered
|
21
22
|
Dir[glob].filter_map do |path|
|
23
|
+
# :nocov:
|
22
24
|
if (match = File.read(path).match(content_regexp))
|
23
25
|
version = VersionBoss::Gem::IncrementableVersion.new(match[:version])
|
24
26
|
VersionBoss::Gem::VersionFile.new(path, match[:content_before], version, match[:content_after])
|
@@ -11,6 +11,8 @@ module VersionBoss
|
|
11
11
|
# @api public
|
12
12
|
#
|
13
13
|
class Gemspec < Base
|
14
|
+
# :nocov: JRuby does not mark the line with VersionBoss::Gem::REGEXP.source as covered
|
15
|
+
|
14
16
|
# The regexp to find the version and surrounding content within the gemspec
|
15
17
|
VERSION_REGEXP = /
|
16
18
|
\A
|
@@ -18,11 +20,13 @@ module VersionBoss
|
|
18
20
|
.*
|
19
21
|
\.version\s*=\s*(?<quote>['"])
|
20
22
|
)
|
21
|
-
(?<version>#{REGEXP.source})
|
23
|
+
(?<version>#{VersionBoss::Gem::REGEXP.source})
|
22
24
|
(?<content_after>\k<quote>.*)
|
23
25
|
\z
|
24
26
|
/xm
|
25
27
|
|
28
|
+
# :nocov:
|
29
|
+
|
26
30
|
private
|
27
31
|
|
28
32
|
# The version file regexp
|
@@ -10,6 +10,8 @@ module VersionBoss
|
|
10
10
|
# @api public
|
11
11
|
#
|
12
12
|
class Version < Base
|
13
|
+
# :nocov: JRuby does not mark the line with VersionBoss::Gem::REGEXP.source as covered
|
14
|
+
|
13
15
|
# The regexp to find the version and surrounding content within the version file
|
14
16
|
VERSION_REGEXP = /
|
15
17
|
\A
|
@@ -19,6 +21,8 @@ module VersionBoss
|
|
19
21
|
\z
|
20
22
|
/x
|
21
23
|
|
24
|
+
# :nocov:
|
25
|
+
|
22
26
|
private
|
23
27
|
|
24
28
|
# The version file regexp
|
@@ -10,6 +10,8 @@ module VersionBoss
|
|
10
10
|
# @api public
|
11
11
|
#
|
12
12
|
class VersionRb < Base
|
13
|
+
# :nocov: JRuby does not mark the line with VersionBoss::Gem::REGEXP.source as covered
|
14
|
+
|
13
15
|
# The regexp to find the version and surrounding content within the version.rb file
|
14
16
|
VERSION_REGEXP = /
|
15
17
|
\A
|
@@ -22,6 +24,8 @@ module VersionBoss
|
|
22
24
|
\z
|
23
25
|
/xm
|
24
26
|
|
27
|
+
# :nocov:
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
# The version file regexp
|
@@ -27,18 +27,12 @@ module VersionBoss
|
|
27
27
|
# IncrementableVersion.new('1.2.3-alpha').valid? # => raise VersionBoss::Error
|
28
28
|
# IncrementableVersion.new('1.2.3-alpha.1.2').valid? # => raise VersionBoss::Error
|
29
29
|
# IncrementableVersion.new('1.2.3-alpha.one').valid? # => raise VersionBoss::Error
|
30
|
+
# IncrementableVersion.new('').valid? # => raise VersionBoss::Error
|
30
31
|
#
|
31
32
|
# @return [Boolean] true if the version string is a valid semver and meets the conditions above
|
32
33
|
#
|
33
34
|
def valid?
|
34
|
-
super && (
|
35
|
-
pre_release.empty? ||
|
36
|
-
(
|
37
|
-
pre_release_identifiers.size == 2 &&
|
38
|
-
pre_type.is_a?(String) &&
|
39
|
-
pre_number.is_a?(Integer)
|
40
|
-
)
|
41
|
-
)
|
35
|
+
super && (pre_release.empty? || (pre_release_identifiers.size == 2 && pre_number.is_a?(Integer)))
|
42
36
|
end
|
43
37
|
|
44
38
|
# The default pre-release identifier
|
@@ -170,9 +164,11 @@ module VersionBoss
|
|
170
164
|
def assert_pre_type_is_valid(pre_type)
|
171
165
|
return if self.pre_type <= pre_type
|
172
166
|
|
167
|
+
# :nocov: JRuby coverage does not report this line correctly
|
173
168
|
message = 'Cannot increment the pre-release identifier ' \
|
174
169
|
"from '#{self.pre_type}' to '#{pre_type}' " \
|
175
170
|
"because '#{self.pre_type}' is lexically less than '#{pre_type}'"
|
171
|
+
# :nocov:
|
176
172
|
|
177
173
|
raise VersionBoss::Error, message
|
178
174
|
end
|
data/lib/version_boss/version.rb
CHANGED
data/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"bootstrap-sha": "2ec865239fefdd45f0b447a9aac0088bd3404300",
|
3
|
+
"packages": {
|
4
|
+
".": {
|
5
|
+
"release-type": "ruby",
|
6
|
+
"package-name": "version_boss",
|
7
|
+
"changelog-path": "CHANGELOG.md",
|
8
|
+
"version-file": "lib/version_boss/version.rb",
|
9
|
+
"bump-minor-pre-major": true,
|
10
|
+
"bump-patch-for-minor-pre-major": true,
|
11
|
+
"draft": false,
|
12
|
+
"prerelease": false,
|
13
|
+
"include-component-in-tag": false
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"plugins": [
|
17
|
+
{
|
18
|
+
"type": "sentence-case"
|
19
|
+
}
|
20
|
+
],
|
21
|
+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
|
22
|
+
}
|
data/version_boss.gemspec
CHANGED
@@ -14,16 +14,17 @@ Gem::Specification.new do |spec|
|
|
14
14
|
command or the 'VersionBoss::Gem::Version' class.
|
15
15
|
DESC
|
16
16
|
|
17
|
-
spec.homepage = 'http://github.com/main-branch/version_boss'
|
18
17
|
spec.license = 'MIT'
|
19
|
-
spec.required_ruby_version = '>= 3.
|
18
|
+
spec.required_ruby_version = '>= 3.1.0'
|
20
19
|
|
21
20
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
21
|
|
22
|
+
# Project links
|
23
|
+
spec.homepage = "https://github.com/main-branch/#{spec.name}"
|
23
24
|
spec.metadata['homepage_uri'] = spec.homepage
|
24
25
|
spec.metadata['source_code_uri'] = spec.homepage
|
25
|
-
spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md"
|
26
26
|
spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}"
|
27
|
+
spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md"
|
27
28
|
|
28
29
|
# Specify which files should be added to the gem when it is released.
|
29
30
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -35,16 +36,22 @@ Gem::Specification.new do |spec|
|
|
35
36
|
spec.bindir = 'exe'
|
36
37
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
37
38
|
spec.require_paths = ['lib']
|
39
|
+
spec.requirements = [
|
40
|
+
'Platform: Mac, Linux, or Windows',
|
41
|
+
'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
|
42
|
+
]
|
38
43
|
|
39
|
-
spec.
|
44
|
+
spec.add_dependency 'thor', '~> 1.3'
|
40
45
|
|
41
46
|
spec.add_development_dependency 'bundler-audit', '~> 0.9'
|
42
|
-
spec.add_development_dependency 'create_github_release', '~> 1
|
47
|
+
spec.add_development_dependency 'create_github_release', '~> 2.1'
|
48
|
+
spec.add_development_dependency 'main_branch_shared_rubocop_config', '~> 0.1'
|
43
49
|
spec.add_development_dependency 'rake', '~> 13.1'
|
44
50
|
spec.add_development_dependency 'rspec', '~> 3.12'
|
45
51
|
spec.add_development_dependency 'rubocop', '~> 1.59'
|
46
52
|
spec.add_development_dependency 'simplecov', '~> 0.22'
|
47
53
|
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
|
54
|
+
spec.add_development_dependency 'simplecov-rspec', '~> 0.2'
|
48
55
|
|
49
56
|
unless RUBY_PLATFORM == 'java'
|
50
57
|
spec.add_development_dependency 'redcarpet', '~> 3.6'
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: version_boss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Couball
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: thor
|
@@ -44,14 +43,28 @@ dependencies:
|
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1
|
46
|
+
version: '2.1'
|
48
47
|
type: :development
|
49
48
|
prerelease: false
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
51
|
- - "~>"
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
53
|
+
version: '2.1'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: main_branch_shared_rubocop_config
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.1'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.1'
|
55
68
|
- !ruby/object:Gem::Dependency
|
56
69
|
name: rake
|
57
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +135,20 @@ dependencies:
|
|
122
135
|
- - "~>"
|
123
136
|
- !ruby/object:Gem::Version
|
124
137
|
version: '0.8'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: simplecov-rspec
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0.2'
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0.2'
|
125
152
|
- !ruby/object:Gem::Dependency
|
126
153
|
name: redcarpet
|
127
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -180,6 +207,10 @@ executables:
|
|
180
207
|
extensions: []
|
181
208
|
extra_rdoc_files: []
|
182
209
|
files:
|
210
|
+
- ".commitlintrc.yml"
|
211
|
+
- ".husky/commit-msg"
|
212
|
+
- ".markdownlint.yml"
|
213
|
+
- ".release-please-manifest.json"
|
183
214
|
- ".rspec"
|
184
215
|
- ".rubocop.yml"
|
185
216
|
- ".yardopts"
|
@@ -209,18 +240,19 @@ files:
|
|
209
240
|
- lib/version_boss/semver/regexp.rb
|
210
241
|
- lib/version_boss/semver/version.rb
|
211
242
|
- lib/version_boss/version.rb
|
243
|
+
- package.json
|
244
|
+
- release-please-config.json
|
212
245
|
- version_boss.gemspec
|
213
|
-
homepage:
|
246
|
+
homepage: https://github.com/main-branch/version_boss
|
214
247
|
licenses:
|
215
248
|
- MIT
|
216
249
|
metadata:
|
217
250
|
allowed_push_host: https://rubygems.org
|
218
|
-
homepage_uri:
|
219
|
-
source_code_uri:
|
220
|
-
|
221
|
-
|
251
|
+
homepage_uri: https://github.com/main-branch/version_boss
|
252
|
+
source_code_uri: https://github.com/main-branch/version_boss
|
253
|
+
documentation_uri: https://rubydoc.info/gems/version_boss/0.2.1
|
254
|
+
changelog_uri: https://rubydoc.info/gems/version_boss/0.2.1/file/CHANGELOG.md
|
222
255
|
rubygems_mfa_required: 'true'
|
223
|
-
post_install_message:
|
224
256
|
rdoc_options: []
|
225
257
|
require_paths:
|
226
258
|
- lib
|
@@ -228,15 +260,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
260
|
requirements:
|
229
261
|
- - ">="
|
230
262
|
- !ruby/object:Gem::Version
|
231
|
-
version: 3.
|
263
|
+
version: 3.1.0
|
232
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
265
|
requirements:
|
234
266
|
- - ">="
|
235
267
|
- !ruby/object:Gem::Version
|
236
268
|
version: '0'
|
237
|
-
requirements:
|
238
|
-
|
239
|
-
|
269
|
+
requirements:
|
270
|
+
- 'Platform: Mac, Linux, or Windows'
|
271
|
+
- 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
|
272
|
+
rubygems_version: 3.6.7
|
240
273
|
specification_version: 4
|
241
274
|
summary: A Gem to parse and compare SemVer versions AND increment versions for Ruby
|
242
275
|
Gems
|