version_boss 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +36 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +119 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +199 -0
- data/Rakefile +92 -0
- data/exe/gem-version-boss +6 -0
- data/lib/version_boss/gem/command_line.rb +443 -0
- data/lib/version_boss/gem/incrementable_version.rb +216 -0
- data/lib/version_boss/gem/regexp.rb +29 -0
- data/lib/version_boss/gem/version.rb +449 -0
- data/lib/version_boss/gem/version_file.rb +103 -0
- data/lib/version_boss/gem/version_file_factory.rb +40 -0
- data/lib/version_boss/gem/version_file_sources/base.rb +56 -0
- data/lib/version_boss/gem/version_file_sources/gemspec.rb +40 -0
- data/lib/version_boss/gem/version_file_sources/version.rb +36 -0
- data/lib/version_boss/gem/version_file_sources/version_rb.rb +39 -0
- data/lib/version_boss/gem/version_file_sources.rb +14 -0
- data/lib/version_boss/gem.rb +14 -0
- data/lib/version_boss/semver/command_line.rb +474 -0
- data/lib/version_boss/semver/incrementable_version.rb +192 -0
- data/lib/version_boss/semver/regexp.rb +40 -0
- data/lib/version_boss/semver/version.rb +374 -0
- data/lib/version_boss/semver.rb +9 -0
- data/lib/version_boss/version.rb +6 -0
- data/lib/version_boss.rb +10 -0
- data/version_boss.gemspec +56 -0
- metadata +243 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: afacba1102b1a2c3121168da6d563fe07fa20bf819d816dc6c5a6ad5ed6a9e76
|
4
|
+
data.tar.gz: 2dec6257f24013a38fcc27d13cc9e9b41d5149c5f4dbf0a5df095a38dfb3682b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ecca5ca9fa2f05359ce747ec54fbba9d1b6e89fa9803593628e9fbf26fa2d61ee7a06bfaefc56dd3995c2df6966eb2417111a00e555910f55e78d4c420c4eefc
|
7
|
+
data.tar.gz: 0ad28ede7cb492243f39413d4b9e373315604d37ecbaeb221f5f3df308670c24355450dcb74f26c500bad354b32919cbb0dfd87dec1cf717eb91ef285fa55fb9
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
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"
|
25
|
+
|
26
|
+
Metrics/ModuleLength:
|
27
|
+
CountAsOne: ['hash']
|
28
|
+
|
29
|
+
# When writing minitest tests, it is very hard to limit test class length:
|
30
|
+
Metrics/ClassLength:
|
31
|
+
CountAsOne: ['hash']
|
32
|
+
Exclude:
|
33
|
+
- "test/**/*_test.rb"
|
34
|
+
|
35
|
+
Style/AsciiComments:
|
36
|
+
Enabled: false
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
## v0.1.0 (2024-05-07)
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/main-branch/version_boss/compare/26b5491..v0.1.0)
|
4
|
+
|
5
|
+
Changes:
|
6
|
+
|
7
|
+
* f802a44 Set initial version number
|
8
|
+
* f43d795 Create prerelease without dot like "1.0.0.pre1" instead of "1.0.0.pre.1"
|
9
|
+
* 7ba673a Rename the script 'gem-version' to 'gem-version-boss'
|
10
|
+
* 16dfc48 Fix YARD in Rakefile and coverage
|
11
|
+
* 53a6e1b Remove build_metadata from Gem versions (#36)
|
12
|
+
* 0ecd483 Update Code Climate ID after renaming the repository (#35)
|
13
|
+
* f83acac Update Code Climate ID after renaming the repository (#34)
|
14
|
+
* b8b78dc Rename the gem from semverify to version_boss (#32)
|
15
|
+
* 3d14540 Update README.md for the Semverify::Gem class (#31)
|
16
|
+
* 562bac9 Remove the "sig" directory from Git (#30)
|
17
|
+
* 5d0c857 Separate gem code and semver code into their own modules (#29)
|
18
|
+
* 4c85840 Add Gem version functionality (#27)
|
19
|
+
* 7404b15 Release v0.3.4
|
20
|
+
* cf1dd7c Add env coverage options to use when running rspec (#25)
|
21
|
+
* 4e5cc25 Add command line examples to the README.md (#24)
|
22
|
+
* 46323a8 Release v0.3.3
|
23
|
+
* 8219bf1 Remove markdown from gemspec description (#21)
|
24
|
+
* 7c1585b Release v0.3.2
|
25
|
+
* 91c3780 Update README and gemspec introduction text (#19)
|
26
|
+
* 0d584a8 Release v0.3.1
|
27
|
+
* 51f649f Add Ruby 3.3 to CI build (#17)
|
28
|
+
* 3255436 Update rubocop configuration for new Rubocop changes (#15)
|
29
|
+
* 4cbeb23 Release v0.3.0
|
30
|
+
* 83cf403 Update CodeClimate badges after project rename (#13)
|
31
|
+
* 7079244 Rename gem from 'semversion' to 'semverify' (#11)
|
32
|
+
* 64ae102 Release v0.2.0
|
33
|
+
* 7a8069c Integrate the create_github_release gem (#9)
|
34
|
+
* 96cdae4 Add Library Usage documentation to README.md (#8)
|
35
|
+
* 8196c2e Add JRuby Linux and Windows builds to CI builds (#7)
|
36
|
+
* e6b0739 Add windows build to CI builds (#6)
|
37
|
+
* 59e310f Fix reported CodeClimate complexity issues (#3)
|
38
|
+
* 2d28b30 Integrate CodeClimate maintainability and test coverage tracking (#1)
|
39
|
+
* 2bda849 Add CODEOWNERS file to indicate who can review PRs
|
40
|
+
* 4599554 Add the CommandLine class and semversion script
|
41
|
+
* 6204835 Add the #next_release method to IncrementableSemver
|
42
|
+
* 4219c88 Add the #next_pre method to IncrementableSemver
|
43
|
+
* 6f3bd22 Add the #next_major, #next_minor, #next_patch methods to IncrementableSemver
|
44
|
+
* 76782ac Add the IncrementableSemver class
|
45
|
+
* 98d12cc Add the VersionFile and the VersionFileFactory classes
|
46
|
+
* 713fddd Add the Semver class
|
47
|
+
* e5c9864 Update README.md
|
48
|
+
* 26b5491 Initial version
|
49
|
+
|
50
|
+
## v0.3.4 (2024-01-20)
|
51
|
+
|
52
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.3.3..v0.3.4)
|
53
|
+
|
54
|
+
Changes since v0.3.3:
|
55
|
+
|
56
|
+
* cf1dd7c Add env coverage options to use when running rspec (#25)
|
57
|
+
* 4e5cc25 Add command line examples to the README.md (#24)
|
58
|
+
|
59
|
+
## v0.3.3 (2024-01-11)
|
60
|
+
|
61
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.3.2..v0.3.3)
|
62
|
+
|
63
|
+
Changes since v0.3.2:
|
64
|
+
|
65
|
+
* 8219bf1 Remove markdown from gemspec description (#21)
|
66
|
+
|
67
|
+
## v0.3.2 (2024-01-11)
|
68
|
+
|
69
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.3.1..v0.3.2)
|
70
|
+
|
71
|
+
Changes since v0.3.1:
|
72
|
+
|
73
|
+
* 91c3780 Update README and gemspec introduction text (#19)
|
74
|
+
|
75
|
+
## v0.3.1 (2024-01-05)
|
76
|
+
|
77
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.3.0..v0.3.1)
|
78
|
+
|
79
|
+
Changes since v0.3.0:
|
80
|
+
|
81
|
+
* 51f649f Add Ruby 3.3 to CI build (#17)
|
82
|
+
* 3255436 Update rubocop configuration for new Rubocop changes (#15)
|
83
|
+
|
84
|
+
## v0.3.0 (2023-03-19)
|
85
|
+
|
86
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.2.0..v0.3.0)
|
87
|
+
|
88
|
+
Changes since v0.2.0:
|
89
|
+
|
90
|
+
* 83cf403 Update CodeClimate badges after project rename (#13)
|
91
|
+
* 7079244 Rename gem from 'semversion' to 'semverify' (#11)
|
92
|
+
|
93
|
+
## v0.2.0 (2023-03-18)
|
94
|
+
|
95
|
+
[Full Changelog](https://github.com/main-branch/semverify/compare/v0.1.0..v0.2.0)
|
96
|
+
|
97
|
+
Changes since v0.1.0:
|
98
|
+
|
99
|
+
* 7a8069c Integrate the create_github_release gem (#9)
|
100
|
+
* 96cdae4 Add Library Usage documentation to README.md (#8)
|
101
|
+
* 8196c2e Add JRuby Linux and Windows builds to CI builds (#7)
|
102
|
+
* e6b0739 Add windows build to CI builds (#6)
|
103
|
+
* 59e310f Fix reported CodeClimate complexity issues (#3)
|
104
|
+
* 2d28b30 Integrate CodeClimate maintainability and test coverage tracking (#1)
|
105
|
+
* 2bda849 Add CODEOWNERS file to indicate who can review PRs
|
106
|
+
* 4599554 Add the CommandLine class and semverify script
|
107
|
+
* 6204835 Add the #next_release method to IncrementableSemver
|
108
|
+
* 4219c88 Add the #next_pre method to IncrementableSemver
|
109
|
+
* 6f3bd22 Add the #next_major, #next_minor, #next_patch methods to IncrementableSemver
|
110
|
+
* 76782ac Add the IncrementableSemver class
|
111
|
+
* 98d12cc Add the VersionFile and the VersionFileFactory classes
|
112
|
+
* 713fddd Add the Semver class
|
113
|
+
* e5c9864 Update README.md
|
114
|
+
|
115
|
+
## [Unreleased]
|
116
|
+
|
117
|
+
## [0.1.0] - 2023-03-10
|
118
|
+
|
119
|
+
- Initial release
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jcouball@yahoo.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 James Couball
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
# Version Boss
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/version_boss.svg)](https://badge.fury.io/rb/version_boss)
|
4
|
+
[![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/version_boss/)
|
5
|
+
[![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/version_boss/file/CHANGELOG.md)
|
6
|
+
[![Build Status](https://github.com/main-branch/version_boss/workflows/CI%20Build/badge.svg?branch=main)](https://github.com/main-branch/version_boss/actions?query=workflow%3ACI%20Build)
|
7
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/44a42ed085fe162e5dff/maintainability)](https://codeclimate.com/github/main-branch/version_boss/maintainability)
|
8
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/44a42ed085fe162e5dff/test_coverage)](https://codeclimate.com/github/main-branch/version_boss/test_coverage)
|
9
|
+
|
10
|
+
Parse, compare, and increment Gem and Semver versions.
|
11
|
+
|
12
|
+
This gem installs the `gem-version-boss` CLI tool to display and increment a gem's version
|
13
|
+
based on SemVer rules.
|
14
|
+
|
15
|
+
`gem-version-boss` can replace the `bump` command from the [bump
|
16
|
+
gem](https://rubygems.org/gems/bump/) for incrementing gem version strings.
|
17
|
+
|
18
|
+
How `gem-version-boss` differs from `bump`:
|
19
|
+
|
20
|
+
* `gem-version-boss` can manage pre-release versions
|
21
|
+
* `bump` can commit and tag the version file changes it makes. There is no plan to
|
22
|
+
add this functionality to `gem-version-boss`.
|
23
|
+
* `bump` can update the version in extra files you to specify extra files to
|
24
|
+
increment the version in
|
25
|
+
|
26
|
+
Example CLI commands:
|
27
|
+
|
28
|
+
```shell
|
29
|
+
# Increment the gem version
|
30
|
+
gem-version-boss {next-major|next-minor|next-patch} [--pre [--pretype=TYPE]] [--dryrun]
|
31
|
+
gem-version-boss next-pre [--pretype=TYPE] [--dryrun]
|
32
|
+
gem-version-boss next-release [--dryrun]
|
33
|
+
|
34
|
+
# Command to display the current gem version
|
35
|
+
gem-version-boss current
|
36
|
+
|
37
|
+
# Display the gem version file
|
38
|
+
gem-version-boss file
|
39
|
+
|
40
|
+
# Validate that a version conforms to SemVer 2.0.0
|
41
|
+
gem-version-boss validate VERSION
|
42
|
+
|
43
|
+
# Get more detailed help for each command listed above
|
44
|
+
gem-version-boss help [COMMAND]
|
45
|
+
```
|
46
|
+
|
47
|
+
* [Installation](#installation)
|
48
|
+
* [Command Line](#command-line)
|
49
|
+
* [Usage](#usage)
|
50
|
+
* [Examples](#examples)
|
51
|
+
* [Library Usage](#library-usage)
|
52
|
+
* [VersionBoss::Gem classes](#versionbossgem-classes)
|
53
|
+
* [VersionBoss::Semver classes](#versionbosssemver-classes)
|
54
|
+
* [Development](#development)
|
55
|
+
* [Contributing](#contributing)
|
56
|
+
* [License](#license)
|
57
|
+
|
58
|
+
## Installation
|
59
|
+
|
60
|
+
Install the gem and add to the application's Gemfile by executing:
|
61
|
+
|
62
|
+
```shell
|
63
|
+
bundle add version_boss
|
64
|
+
```
|
65
|
+
|
66
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
67
|
+
|
68
|
+
```shell
|
69
|
+
gem install version_boss --group=development
|
70
|
+
```
|
71
|
+
|
72
|
+
## Command Line
|
73
|
+
|
74
|
+
### Usage
|
75
|
+
|
76
|
+
The `gem-version-boss` command line has built in help for all its commands. List the
|
77
|
+
commands by invoking `gem-version-boss` with no arguments or `gem-version-boss help` as
|
78
|
+
follows:
|
79
|
+
|
80
|
+
```shell
|
81
|
+
gem-version-boss help
|
82
|
+
```
|
83
|
+
|
84
|
+
The output is the following:
|
85
|
+
|
86
|
+
```shell
|
87
|
+
Commands:
|
88
|
+
gem-version-boss current [-q] # Show the current gem version
|
89
|
+
gem-version-boss file [-q] # Show the path to the file containing the gem version
|
90
|
+
gem-version-boss help [COMMAND] # Describe available commands or one specific command
|
91
|
+
gem-version-boss next-major [VERSION] [-p [-t TYPE]] [-n] [-q] # Increment the version's major part
|
92
|
+
gem-version-boss next-minor [VERSION] [-p [-t TYPE]] [-n] [-q] # Increment the version's minor part
|
93
|
+
gem-version-boss next-patch [VERSION] [-p [-t TYPE]] [-n] [-q] # Increment the version's patch part
|
94
|
+
gem-version-boss next-pre [VERSION] [-t TYPE] [-n] [-q] # Increment the version's pre-release part
|
95
|
+
gem-version-boss next-release [VERSION] [-n] [-q] # Increment a pre-release version to the release version
|
96
|
+
gem-version-boss validate VERSION [-q] # Validate the given version
|
97
|
+
```
|
98
|
+
|
99
|
+
The `gem-version-boss help COMMAND` command will give further help for a specific command:
|
100
|
+
|
101
|
+
```shell
|
102
|
+
gem-version-boss help current
|
103
|
+
```
|
104
|
+
|
105
|
+
The output is the following:
|
106
|
+
|
107
|
+
```shell
|
108
|
+
Usage:
|
109
|
+
gem-version-boss current [-q]
|
110
|
+
|
111
|
+
Options:
|
112
|
+
-q, [--quiet], [--no-quiet], [--skip-quiet] # Do not print the current version to stdout
|
113
|
+
|
114
|
+
Description:
|
115
|
+
Output the current gem version from the file that stores the gem version.
|
116
|
+
|
117
|
+
The command fails if the gem version could not be found or is invalid.
|
118
|
+
|
119
|
+
Use `--quiet` to ensure that a gem version could be found and is valid without producing any output.
|
120
|
+
```
|
121
|
+
|
122
|
+
### Examples
|
123
|
+
|
124
|
+
```shell
|
125
|
+
gem-version-boss current # 0.1.0
|
126
|
+
|
127
|
+
gem-version-boss validate 1.0.0 # exitcode=0
|
128
|
+
gem-version-boss validate bad_version # exitcode=1
|
129
|
+
|
130
|
+
gem-version-boss next-patch # 0.1.0 -> 0.1.1
|
131
|
+
gem-version-boss next-minor # 0.1.1 -> 0.2.0
|
132
|
+
gem-version-boss next-major # 0.2.0 -> 1.0.0
|
133
|
+
|
134
|
+
# Pre-release with default pre-release type
|
135
|
+
gem-version-boss next-major --pre # 0.1.1 -> 1.0.0.pre1
|
136
|
+
|
137
|
+
# Pre-release with non-default pre-release type
|
138
|
+
gem-version-boss next-major --pre --pre-type=alpha # 0.1.1 -> 2.0.0-alpha1
|
139
|
+
|
140
|
+
# Increment pre-release
|
141
|
+
gem-version-boss next-pre # 1.0.0-alpha1 -> 1.0.0-alpha2
|
142
|
+
|
143
|
+
# Change the pre-release type
|
144
|
+
gem-version-boss pre --pre-type=beta # 1.0.0-alpha2 -> 1.0.0-beta1
|
145
|
+
|
146
|
+
# Create release from pre-release
|
147
|
+
gem-version-boss release # 1.0.0-beta1 -> 1.0.0
|
148
|
+
```
|
149
|
+
|
150
|
+
This gem also provides the following classes:
|
151
|
+
|
152
|
+
## Library Usage
|
153
|
+
|
154
|
+
[Detailed API documenation](https://rubydoc.info/gems/version_boss/) is hosted on
|
155
|
+
rubygems.org.
|
156
|
+
|
157
|
+
The main classes are:
|
158
|
+
|
159
|
+
### VersionBoss::Gem classes
|
160
|
+
|
161
|
+
* **VersionBoss::Gem::Version** knows how to parse, validate, and compare [Ruby Gem
|
162
|
+
version strings](https://guides.rubygems.org/patterns/#semantic-versioning).
|
163
|
+
|
164
|
+
* **VersionBoss::Gem::IncrementableVersion** knows how to increment Ruby Gem version
|
165
|
+
strings according to SemVer rules.
|
166
|
+
|
167
|
+
* **VersionBoss::Gem::VersionFileFactory**: find the gem's version file and returns a
|
168
|
+
**VersionBoss::Gem::VersionFile** that knows it's path, the contained version, and
|
169
|
+
how to update the version file with a new version.
|
170
|
+
|
171
|
+
### VersionBoss::Semver classes
|
172
|
+
|
173
|
+
* **VersionBoss::Semver::Version** knows how to parse, validate, and compare version
|
174
|
+
strings that conform to [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html)
|
175
|
+
|
176
|
+
* **VersionBoss::Semver::IncrementableVersion** knows how to increment Semver version
|
177
|
+
strings according to SemVer rules.
|
178
|
+
|
179
|
+
## Development
|
180
|
+
|
181
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
182
|
+
spec` to run the tests. You can also run `bin/console` for an interactive prompt that
|
183
|
+
will allow you to experiment.
|
184
|
+
|
185
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
186
|
+
release a new version, update the version number in `version.rb`, and then run
|
187
|
+
`bundle exec rake release`, which will create a git tag for the version, push git
|
188
|
+
commits and the created tag, and push the `.gem` file to
|
189
|
+
[rubygems.org](https://rubygems.org).
|
190
|
+
|
191
|
+
## Contributing
|
192
|
+
|
193
|
+
Bug reports and pull requests are welcome on GitHub at
|
194
|
+
https://github.com/main-branch/version_boss.
|
195
|
+
|
196
|
+
## License
|
197
|
+
|
198
|
+
The gem is available as open source under the terms of the [MIT
|
199
|
+
License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
desc 'Run the same tasks that the CI build will run'
|
4
|
+
if RUBY_PLATFORM == 'java'
|
5
|
+
task default: %w[spec rubocop bundle:audit build]
|
6
|
+
else
|
7
|
+
task default: %w[spec rubocop yard bundle:audit build]
|
8
|
+
end
|
9
|
+
|
10
|
+
# Bundler Audit
|
11
|
+
|
12
|
+
require 'bundler/audit/task'
|
13
|
+
Bundler::Audit::Task.new
|
14
|
+
|
15
|
+
# Bundler Gem Build
|
16
|
+
|
17
|
+
require 'bundler'
|
18
|
+
require 'bundler/gem_tasks'
|
19
|
+
|
20
|
+
begin
|
21
|
+
Bundler.setup(:default, :development)
|
22
|
+
rescue Bundler::BundlerError => e
|
23
|
+
warn e.message
|
24
|
+
warn 'Run `bundle install` to install missing gems'
|
25
|
+
exit e.status_code
|
26
|
+
end
|
27
|
+
|
28
|
+
CLEAN << 'pkg'
|
29
|
+
CLEAN << 'Gemfile.lock'
|
30
|
+
|
31
|
+
# RSpec
|
32
|
+
|
33
|
+
require 'rspec/core/rake_task'
|
34
|
+
|
35
|
+
RSpec::Core::RakeTask.new do
|
36
|
+
if RUBY_PLATFORM == 'java'
|
37
|
+
ENV['JAVA_OPTS'] = '-Djdk.io.File.enableADS=true'
|
38
|
+
ENV['JRUBY_OPTS'] = '--debug'
|
39
|
+
ENV['COV_NO_FAIL'] = 'TRUE'
|
40
|
+
end
|
41
|
+
ENV['COV_SHOW_UNCOVERED'] = 'TRUE'
|
42
|
+
end
|
43
|
+
|
44
|
+
CLEAN << 'coverage'
|
45
|
+
CLEAN << '.rspec_status'
|
46
|
+
CLEAN << 'rspec-report.xml'
|
47
|
+
|
48
|
+
# Rubocop
|
49
|
+
|
50
|
+
require 'rubocop/rake_task'
|
51
|
+
|
52
|
+
RuboCop::RakeTask.new do |t|
|
53
|
+
t.options = %w[
|
54
|
+
--format progress
|
55
|
+
--format json --out rubocop-report.json
|
56
|
+
]
|
57
|
+
end
|
58
|
+
|
59
|
+
CLEAN << 'rubocop-report.json'
|
60
|
+
|
61
|
+
unless RUBY_PLATFORM == 'java'
|
62
|
+
# yard:build
|
63
|
+
|
64
|
+
require 'yard'
|
65
|
+
|
66
|
+
YARD::Rake::YardocTask.new('yard:build') do |t|
|
67
|
+
t.files = %w[lib/**/*.rb examples/**/*]
|
68
|
+
t.stats_options = ['--list-undoc']
|
69
|
+
end
|
70
|
+
|
71
|
+
CLEAN << '.yardoc'
|
72
|
+
CLEAN << 'doc'
|
73
|
+
|
74
|
+
# yard:audit
|
75
|
+
|
76
|
+
desc 'Run yardstick to show missing YARD doc elements'
|
77
|
+
task :'yard:audit' do
|
78
|
+
sh "yardstick 'lib/**/*.rb'"
|
79
|
+
end
|
80
|
+
|
81
|
+
# yard:coverage
|
82
|
+
|
83
|
+
require 'yardstick/rake/verify'
|
84
|
+
|
85
|
+
Yardstick::Rake::Verify.new(:'yard:coverage') do |verify|
|
86
|
+
verify.threshold = 100
|
87
|
+
end
|
88
|
+
|
89
|
+
# yard
|
90
|
+
|
91
|
+
task yard: %i[yard:build yard:audit yard:coverage]
|
92
|
+
end
|