version_gem 1.1.5 → 1.1.7
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +57 -13
- data/CODE_OF_CONDUCT.md +80 -29
- data/CONTRIBUTING.md +7 -4
- data/LICENSE.txt +1 -1
- data/README.md +204 -73
- data/SECURITY.md +12 -4
- data/lib/version_gem/api.rb +0 -0
- data/lib/version_gem/epoch.rb +69 -0
- data/lib/version_gem/rspec.rb +24 -0
- data/lib/version_gem/version.rb +3 -1
- data/lib/version_gem.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +22 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90cc40b0bf2d460aecbcd09d57edcff0a7d5d57b364ecad37a006ffea01390bc
|
4
|
+
data.tar.gz: 48057a10145944f754e9ad2fbc3cf6892d36f742b684483cbebd4421d966b275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2c38503358416ef03fd15c174d392228385d75c000b137394098367e27167a96221de652815c4b509376bfc432ce32ed384370b997b37c2e3a90fb3cdc32f8
|
7
|
+
data.tar.gz: ae251c1c3bd424472f94efa84c3b0d111d0d20054d442b116bb3ae7ad3a7b4afef690d408b157a32f64256dc1daefb8ade74ed7922e501d65cdc23e5003822c4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
3
|
+
[![SemVer 2.0.0][📌semver-img]][📌semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog]
|
4
|
+
|
2
5
|
All notable changes to this project will be documented in this file.
|
3
6
|
|
4
|
-
The format is based on [Keep a Changelog]
|
5
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
7
|
+
The format is based on [Keep a Changelog][📗keep-changelog],
|
8
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
9
|
+
and [yes][📌major-versions-not-sacred], platform and engine support are part of the [public API][📌semver-breaking].
|
10
|
+
Please file a bug if you notice a violation of semantic versioning.
|
11
|
+
|
12
|
+
[📌semver]: https://semver.org/spec/v2.0.0.html
|
13
|
+
[📌semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
|
14
|
+
[📌semver-breaking]: https://github.com/semver/semver/issues/716#issuecomment-869336139
|
15
|
+
[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
16
|
+
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
17
|
+
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
6
18
|
|
7
19
|
## [Unreleased]
|
8
20
|
### Added
|
@@ -10,20 +22,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
10
22
|
### Fixed
|
11
23
|
### Removed
|
12
24
|
|
13
|
-
## [1.1.
|
25
|
+
## [1.1.7] 2025-04-15 ([tag][1.1.7t])
|
26
|
+
- Line Coverage: 100.0% (117 / 117)
|
27
|
+
- Branch Coverage: 100.0% (4 / 4)
|
28
|
+
- 76.92% documented
|
29
|
+
### Added
|
30
|
+
- Support for Epoch Semantic Versioning
|
31
|
+
- `extend VersionGem::Epoch` in your library's `MyLib::Version` module
|
32
|
+
- Support for JRuby 10 (@pboling)
|
33
|
+
- More documentation (@pboling)
|
34
|
+
### Removed
|
35
|
+
- Ruby 2.2 removed from CI, though technically still supported
|
36
|
+
- can't run directly in GHA anymore
|
37
|
+
|
38
|
+
## [1.1.6] 2025-02-24 ([tag][1.1.6t])
|
39
|
+
- Line Coverage: 100.0% (77 / 77)
|
40
|
+
- Branch Coverage: 100.0% (2 / 2)
|
41
|
+
- 77.78% documented
|
42
|
+
### Added
|
43
|
+
- Support for JRuby 9.1, 9.2, 9.3, 9.4, and head (@pboling)
|
44
|
+
- Support for Truffle Ruby 22.3, 23.0, 23.1, 24.1, and head (@pboling)
|
45
|
+
- Evergreen current latest engine release workflow (@pboling)
|
46
|
+
- Runs ruby, truffleruby, and jruby, always latest release
|
47
|
+
- Improved developer experience for contributors (@pboling)
|
48
|
+
- More documentation (@pboling)
|
49
|
+
- Switch to stone_checksums for checksum generation (@pboling)
|
50
|
+
### Changed
|
51
|
+
- Code of Conduct updated - Contributor Covenant v2.0 => v2.1 (@pboling)
|
52
|
+
|
53
|
+
## [1.1.5] 2025-02-22 ([tag][1.1.5t])
|
14
54
|
- Line Coverage: 100.0% (77 / 77)
|
15
55
|
- Branch Coverage: 100.0% (2 / 2)
|
16
56
|
- 77.78% documented
|
17
57
|
### Added
|
18
|
-
- Document approach to get code coverage on your gem's version.rb file
|
19
|
-
- More documentation, and yard task for documentation
|
20
|
-
- Documentation of Ruby version and SemVer support
|
58
|
+
- Document approach to get code coverage on your gem's version.rb file (@pboling)
|
59
|
+
- More documentation, and yard task for documentation (@pboling)
|
60
|
+
- Documentation of Ruby version and SemVer support (@pboling)
|
21
61
|
### Fixed
|
22
|
-
- [#3](https://gitlab.com/oauth-xx/version_gem/-/issues/3) - Allow packaging without signing
|
62
|
+
- [#3](https://gitlab.com/oauth-xx/version_gem/-/issues/3) - Allow packaging without signing (@pboling)
|
23
63
|
- to support secure linux distros which have alternate means of signing packages within their package managers
|
24
|
-
- Code coverage tracking
|
25
|
-
- Documentation of usage in gemspec via `Kernel.load`
|
26
|
-
- Improved gemspec config
|
64
|
+
- Code coverage tracking (@pboling)
|
65
|
+
- Documentation of usage in gemspec via `Kernel.load` (@pboling)
|
66
|
+
- Improved gemspec config (@pboling)
|
27
67
|
|
28
68
|
## [1.1.4] 2024-03-21 ([tag][1.1.4t])
|
29
69
|
### Added
|
@@ -70,10 +110,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
70
110
|
- Gem releases are now cryptographically signed (@pboling)
|
71
111
|
|
72
112
|
## [1.1.0] - 2022-06-24 ([tag][1.1.0t])
|
73
|
-
### Fixed
|
74
|
-
- to_a uses same type casting as major, minor, patch, and pre (@pboling)
|
75
113
|
### Added
|
76
114
|
- RSpec Matchers and Shared Example (@pboling)
|
115
|
+
### Fixed
|
116
|
+
- `to_a` uses same type casting as major, minor, patch, and pre (@pboling)
|
77
117
|
|
78
118
|
## [1.0.2] - 2022-06-23 ([tag][1.0.2t])
|
79
119
|
### Added
|
@@ -90,7 +130,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
90
130
|
### Added
|
91
131
|
- Initial release, with basic version parsing API (@pboling)
|
92
132
|
|
93
|
-
[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.
|
133
|
+
[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.7...main
|
134
|
+
[1.1.7]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.6...v1.1.7
|
135
|
+
[1.1.7t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.7
|
136
|
+
[1.1.6]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.5...v1.1.6
|
137
|
+
[1.1.6t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.6
|
94
138
|
[1.1.5]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.4...v1.1.5
|
95
139
|
[1.1.5t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.5
|
96
140
|
[1.1.4]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.3...v1.1.4
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,84 +1,135 @@
|
|
1
|
+
|
1
2
|
# Contributor Covenant Code of Conduct
|
2
3
|
|
3
4
|
## Our Pledge
|
4
5
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
We as members, contributors, and leaders pledge to make participation in our
|
7
|
+
community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
9
|
+
identity and expression, level of experience, education, socio-economic status,
|
10
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
11
|
+
identity and orientation.
|
6
12
|
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
14
|
+
diverse, inclusive, and healthy community.
|
8
15
|
|
9
16
|
## Our Standards
|
10
17
|
|
11
|
-
Examples of behavior that contributes to a positive environment for our
|
18
|
+
Examples of behavior that contributes to a positive environment for our
|
19
|
+
community include:
|
12
20
|
|
13
21
|
* Demonstrating empathy and kindness toward other people
|
14
22
|
* Being respectful of differing opinions, viewpoints, and experiences
|
15
23
|
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
17
|
-
|
24
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
25
|
+
and learning from the experience
|
26
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
27
|
+
community
|
18
28
|
|
19
29
|
Examples of unacceptable behavior include:
|
20
30
|
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
22
|
-
|
31
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
32
|
+
any kind
|
23
33
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
34
|
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or email
|
26
|
-
|
35
|
+
* Publishing others' private information, such as a physical or email address,
|
36
|
+
without their explicit permission
|
27
37
|
* Other conduct which could reasonably be considered inappropriate in a
|
28
38
|
professional setting
|
29
39
|
|
30
40
|
## Enforcement Responsibilities
|
31
41
|
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
43
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
44
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
45
|
+
or harmful.
|
33
46
|
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
48
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
49
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
50
|
+
decisions when appropriate.
|
35
51
|
|
36
52
|
## Scope
|
37
53
|
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
55
|
+
an individual is officially representing the community in public spaces.
|
56
|
+
Examples of representing our community include using an official email address,
|
57
|
+
posting via an official social media account, or acting as an appointed
|
58
|
+
representative at an online or offline event.
|
39
59
|
|
40
60
|
## Enforcement
|
41
61
|
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
63
|
+
reported to the community leaders responsible for enforcement at
|
64
|
+
[![Contact BDFL][🚂bdfl-contact-img]][🚂bdfl-contact].
|
65
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
43
66
|
|
44
|
-
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
All community leaders are obligated to respect the privacy and security of the
|
68
|
+
reporter of any incident.
|
45
69
|
|
46
70
|
## Enforcement Guidelines
|
47
71
|
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
73
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
49
74
|
|
50
75
|
### 1. Correction
|
51
76
|
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
78
|
+
unprofessional or unwelcome in the community.
|
53
79
|
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
**Consequence**: A private, written warning from community leaders, providing
|
81
|
+
clarity around the nature of the violation and an explanation of why the
|
82
|
+
behavior was inappropriate. A public apology may be requested.
|
55
83
|
|
56
84
|
### 2. Warning
|
57
85
|
|
58
|
-
**Community Impact**: A violation through a single incident or series of
|
86
|
+
**Community Impact**: A violation through a single incident or series of
|
87
|
+
actions.
|
59
88
|
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
90
|
+
interaction with the people involved, including unsolicited interaction with
|
91
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
92
|
+
includes avoiding interactions in community spaces as well as external channels
|
93
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
94
|
+
ban.
|
61
95
|
|
62
96
|
### 3. Temporary Ban
|
63
97
|
|
64
|
-
**Community Impact**: A serious violation of community standards, including
|
98
|
+
**Community Impact**: A serious violation of community standards, including
|
99
|
+
sustained inappropriate behavior.
|
65
100
|
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
102
|
+
communication with the community for a specified period of time. No public or
|
103
|
+
private interaction with the people involved, including unsolicited interaction
|
104
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
105
|
+
Violating these terms may lead to a permanent ban.
|
67
106
|
|
68
107
|
### 4. Permanent Ban
|
69
108
|
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
110
|
+
standards, including sustained inappropriate behavior, harassment of an
|
111
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
71
112
|
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
114
|
+
community.
|
73
115
|
|
74
116
|
## Attribution
|
75
117
|
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
77
|
-
available at
|
78
|
-
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
118
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
119
|
+
version 2.1, available at
|
120
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
80
121
|
|
81
|
-
|
122
|
+
Community Impact Guidelines were inspired by
|
123
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
82
124
|
|
83
125
|
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
|
126
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
127
|
+
[https://www.contributor-covenant.org/translations][translations].
|
128
|
+
|
129
|
+
[homepage]: https://www.contributor-covenant.org
|
130
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
131
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
132
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
133
|
+
[translations]: https://www.contributor-covenant.org/translations
|
134
|
+
[🚂bdfl-contact]: http://www.railsbling.com/contact
|
135
|
+
[🚂bdfl-contact-img]: https://img.shields.io/badge/Contact-BDFL-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red
|
data/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# Contributing
|
2
2
|
|
3
3
|
Bug reports and pull requests are welcome on GitHub at [https://gitlab.com/oauth-xx/version_gem][🚎src-main]
|
4
4
|
. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
@@ -36,6 +36,8 @@ BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
|
|
36
36
|
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
|
37
37
|
```
|
38
38
|
|
39
|
+
When adding an appraisal to CI check the [runner tool cache][🏃♂️runner-tool-cache] to see which runner to use.
|
40
|
+
|
39
41
|
## The Reek List
|
40
42
|
|
41
43
|
Take a look at the `reek` list which is the file called `REEK` and find something to improve.
|
@@ -65,7 +67,7 @@ bundle exec rake
|
|
65
67
|
Or just run the linter.
|
66
68
|
|
67
69
|
```bash
|
68
|
-
bundle exec rubocop_gradual:autocorrect
|
70
|
+
bundle exec rake rubocop_gradual:autocorrect
|
69
71
|
```
|
70
72
|
|
71
73
|
## Contributors
|
@@ -90,7 +92,7 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
90
92
|
### To release a new version:
|
91
93
|
|
92
94
|
1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check
|
93
|
-
2. Update the version number in `version.rb`
|
95
|
+
2. Update the version number in `version.rb`, and ensure `CHANGELOG.md` reflects changes
|
94
96
|
3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
|
95
97
|
4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
|
96
98
|
5. Run `git push` to trigger the final CI pipeline before release, & merge PRs
|
@@ -104,7 +106,7 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
104
106
|
- Note that you'll need the `zsh/datetime` module, if running `zsh`.
|
105
107
|
- In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH`
|
106
108
|
10. Run `bundle exec rake build`
|
107
|
-
11. Run `bin/
|
109
|
+
11. Run `bin/gem_checksums` (more context [1][🔒️rubygems-checksums-pr] and [2][🔒️rubygems-guides-pr])
|
108
110
|
to create SHA-256 and SHA-512 checksums
|
109
111
|
- Checksums will be committed automatically by the script, but not pushed
|
110
112
|
12. Run `bundle exec rake release` which will create a git tag for the version,
|
@@ -129,3 +131,4 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
129
131
|
[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
130
132
|
[🚎appraisal-eval-gemfile-pr]: https://github.com/thoughtbot/appraisal/pull/248
|
131
133
|
[🚎appraisal-fork]: https://github.com/pboling/appraisal/tree/galtzo
|
134
|
+
[🏃♂️runner-tool-cache]: https://github.com/ruby/ruby-builder/releases/tag/toolcache
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -9,21 +9,23 @@
|
|
9
9
|
[![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls]
|
10
10
|
[![CodeClimate Test Coverage][🔑cc-covi♻️]][🔑cc-cov]
|
11
11
|
[![Maintainability][🔑cc-mnti♻️]][🔑cc-mnt]
|
12
|
-
[![CI
|
13
|
-
[![CI
|
14
|
-
[![CI
|
15
|
-
[![CI
|
16
|
-
[![CI
|
17
|
-
[![CI
|
18
|
-
[![CI
|
19
|
-
[![CI
|
12
|
+
[![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf]
|
13
|
+
[![CI Current][🚎11-c-wfi]][🚎11-c-wf]
|
14
|
+
[![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf]
|
15
|
+
[![CI JRuby][🚎10-j-wfi]][🚎10-j-wf]
|
16
|
+
[![CI Supported][🚎6-s-wfi]][🚎6-s-wf]
|
17
|
+
[![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf]
|
18
|
+
[![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf]
|
19
|
+
[![CI Ancient][🚎1-an-wfi]][🚎1-an-wf]
|
20
|
+
[![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf]
|
21
|
+
[![CI Style][🚎5-st-wfi]][🚎5-st-wf]
|
20
22
|
|
21
23
|
---
|
22
24
|
|
23
25
|
[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
|
24
26
|
[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
|
25
27
|
[![Buy me a coffee][🖇buyme-small-img]][🖇buyme]
|
26
|
-
[![Polar
|
28
|
+
[![Donate on Polar][🖇polar-img]][🖇polar]
|
27
29
|
[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
|
28
30
|
[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
|
29
31
|
|
@@ -36,7 +38,7 @@ This gem has a very niche purpose, which is:
|
|
36
38
|
3. allowing 100% test coverage of Ruby code, including the `Version` module.
|
37
39
|
|
38
40
|
As proof in the pudding, this gem achieves 100% test coverage for lines and branches,
|
39
|
-
all
|
41
|
+
all 117 and 4 of them, respectively; coverage enabled in part by patterns from this library.
|
40
42
|
You can make it happen for your library too!
|
41
43
|
|
42
44
|
If this isn't **precisely** your use case you may be better off looking at
|
@@ -63,15 +65,21 @@ This library was extracted from the gem _[oauth2](https://gitlab.com/oauth-xx/oa
|
|
63
65
|
|
64
66
|
This gem has no runtime dependencies.
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
-
|
|
69
|
-
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
## Info you can shake a stick at
|
69
|
+
|
70
|
+
| Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
|
71
|
+
|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
72
|
+
| Works with JRuby | [![JRuby 9.1 Compat][💎jruby-9.1i]][🚎10-j-wf] [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎10-j-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎10-j-wf] [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎10-j-wf] [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
|
73
|
+
| Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎9-t-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎9-t-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf] |
|
74
|
+
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎4-lg-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎6-s-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
|
75
|
+
| Works with MRI Ruby 2 | [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎1-an-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
|
76
|
+
| Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
|
77
|
+
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![HEAD on RubyDoc.info][📜docs-head-rd-img]][🚎yard-head] [![BDFL Blog][🚂bdfl-blog-img]][🚂bdfl-blog] [![Wiki][📜wiki-img]][📜wiki] |
|
78
|
+
| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] |
|
79
|
+
| Expert 1:1 Support | [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] `or` [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] |
|
80
|
+
| Enterprise Support | [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]<br/>💡Subscribe for support guarantees covering _all_ FLOSS dependencies!<br/>💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]!<br/>💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers! |
|
81
|
+
| Comrade BDFL 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact BDFL][🚂bdfl-contact-img]][🚂bdfl-contact] [![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto] |
|
82
|
+
| `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼♂️aboutme-img]][💖💁🏼♂️aboutme] |
|
75
83
|
|
76
84
|
## Installation
|
77
85
|
|
@@ -83,7 +91,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
83
91
|
|
84
92
|
$ gem install version_gem
|
85
93
|
|
86
|
-
## Usage
|
94
|
+
## Basic Usage
|
87
95
|
|
88
96
|
In the standard `bundle gem my_lib` code you get the following in `lib/my_lib/version.rb`:
|
89
97
|
|
@@ -153,7 +161,96 @@ end
|
|
153
161
|
|
154
162
|
Your `version.rb` file now abides the Ruby convention of directory / path matching the namespace / class!
|
155
163
|
|
156
|
-
|
164
|
+
## Epoch Usage (Epoch Semantic Versioning, as of version 1.1.7)
|
165
|
+
|
166
|
+
In the standard `bundle gem my_lib` code you get the following in `lib/my_lib/version.rb`:
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
module MyLib
|
170
|
+
VERSION = "0.1.0"
|
171
|
+
end
|
172
|
+
```
|
173
|
+
|
174
|
+
Change it to a nested `Version` namespace (the one implied by the path => namespace convention):
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
module MyLib
|
178
|
+
module Version
|
179
|
+
VERSION = "0.1.0"
|
180
|
+
end
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
The Epoch and Major versions are derived from the formula:
|
185
|
+
|
186
|
+
```
|
187
|
+
{EPOCH * 1000 + MAJOR}.MINOR.PATCH
|
188
|
+
```
|
189
|
+
|
190
|
+
This will start your library with the following version segments:
|
191
|
+
|
192
|
+
* `epoch = 0`
|
193
|
+
* `major = 0`
|
194
|
+
* `minor = 1`
|
195
|
+
* `patch = 0`
|
196
|
+
* `pre = nil`
|
197
|
+
|
198
|
+
And the segments are defined as:
|
199
|
+
|
200
|
+
```
|
201
|
+
EPOCH: Increment when you make significant or groundbreaking changes.
|
202
|
+
MAJOR: Increment when you make minor incompatible API changes.
|
203
|
+
MINOR: Increment when you add functionality in a backwards-compatible manner.
|
204
|
+
PATCH: Increment when you make backwards-compatible bug fixes.
|
205
|
+
```
|
206
|
+
|
207
|
+
Therefore, if you set your version number to:
|
208
|
+
|
209
|
+
```ruby
|
210
|
+
VERSION = "27016.42.86-pre.7"
|
211
|
+
```
|
212
|
+
|
213
|
+
You will get the following version segments:
|
214
|
+
|
215
|
+
```
|
216
|
+
{
|
217
|
+
epoch: 27,
|
218
|
+
major: 16,
|
219
|
+
minor: 42,
|
220
|
+
patch: 86,
|
221
|
+
pre: "pre-7",
|
222
|
+
}
|
223
|
+
```
|
224
|
+
|
225
|
+
Now add the following near the top of the file the manages requiring external libraries.
|
226
|
+
Using the same example of `bundle gem my_lib`, this would be `lib/my_lib.rb`.
|
227
|
+
|
228
|
+
```ruby
|
229
|
+
require "version_gem"
|
230
|
+
```
|
231
|
+
|
232
|
+
Then, add the following wherever you want in the same file (recommend the bottom).
|
233
|
+
|
234
|
+
```ruby
|
235
|
+
MyLib::Version.class_eval do
|
236
|
+
extend VersionGem::Epoch
|
237
|
+
end
|
238
|
+
```
|
239
|
+
|
240
|
+
And now you have some version introspection methods available:
|
241
|
+
|
242
|
+
```ruby
|
243
|
+
MyLib::Version.to_s # => "1024.3.8"
|
244
|
+
MyLib::Version.epoch # => 1
|
245
|
+
MyLib::Version.major # => 24
|
246
|
+
MyLib::Version.minor # => 3
|
247
|
+
MyLib::Version.patch # => 8
|
248
|
+
MyLib::Version.pre # => ""
|
249
|
+
MyLib::Version.to_a # => [1, 24, 3, 8]
|
250
|
+
MyLib::Version.to_h # => { epoch: 1, major: 24, minor: 3, patch: 8, pre: "" }
|
251
|
+
```
|
252
|
+
|
253
|
+
## Usage with Zeitwerk
|
157
254
|
|
158
255
|
The pattern of `version.rb` breaking the ruby convention of directory / path matching the namespace / class
|
159
256
|
is so entrenched that the `zeitwerk` library has a special carve-out for it. 🥺
|
@@ -243,7 +340,7 @@ RSpec.describe(MyLib::Version) do
|
|
243
340
|
it_behaves_like "a Version module", described_class
|
244
341
|
end
|
245
342
|
|
246
|
-
# Or, if you want to write your own, here is the
|
343
|
+
# Or, if you want to write your own, here is the á la carte menu:
|
247
344
|
RSpec.describe(MyLib::Version) do
|
248
345
|
it "is a Version module" do
|
249
346
|
expect(described_class).is_a?(Module)
|
@@ -251,9 +348,11 @@ RSpec.describe(MyLib::Version) do
|
|
251
348
|
expect(described_class).to(have_version_as_string)
|
252
349
|
expect(described_class.to_s).to(be_a(String))
|
253
350
|
expect(described_class).to(have_major_as_integer)
|
351
|
+
expect(described_class).to(have_epoch_as_integer)
|
254
352
|
expect(described_class).to(have_minor_as_integer)
|
255
353
|
expect(described_class).to(have_patch_as_integer)
|
256
354
|
expect(described_class).to(have_pre_as_nil_or_string)
|
355
|
+
# This would be %i[epoch major minor patch pre] for epoch version schemes
|
257
356
|
expect(described_class.to_h.keys).to(match_array(%i[major minor patch pre]))
|
258
357
|
expect(described_class.to_a).to(be_a(Array))
|
259
358
|
end
|
@@ -272,11 +371,16 @@ or use the gem and think about how it could be better.
|
|
272
371
|
|
273
372
|
We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you make changes, remember to update it.
|
274
373
|
|
275
|
-
|
374
|
+
See [CONTRIBUTING.md][🤝contributing] for more detailed instructions.
|
276
375
|
|
277
376
|
### Code Coverage
|
278
377
|
|
279
|
-
[![Coverage Graph][🔑codecov-g]][🔑codecov]
|
378
|
+
[![Coverage Graph][🔑codecov-g♻️]][🔑codecov]
|
379
|
+
|
380
|
+
### 🪇 Code of Conduct
|
381
|
+
|
382
|
+
Everyone interacting in this project's codebases, issue trackers,
|
383
|
+
chat rooms and mailing lists is expected to follow the [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct].
|
280
384
|
|
281
385
|
## 🌈 Contributors
|
282
386
|
|
@@ -296,18 +400,15 @@ Also see GitLab Contributors: [https://gitlab.com/oauth-xx/version_gem/-/graphs/
|
|
296
400
|
</picture>
|
297
401
|
</a>
|
298
402
|
|
299
|
-
## 🪇 Code of Conduct
|
300
|
-
|
301
|
-
Everyone interacting in this project's codebases, issue trackers,
|
302
|
-
chat rooms and mailing lists is expected to follow the [code of conduct][🪇conduct].
|
303
|
-
|
304
403
|
## 📌 Versioning
|
305
404
|
|
306
|
-
This Library adheres to [![Semantic Versioning
|
405
|
+
This Library adheres to [![Epoch Semantic Versioning][📌semver-img]][📌semver].
|
307
406
|
Violations of this scheme should be reported as bugs.
|
308
407
|
Specifically, if a minor or patch version is released that breaks backward compatibility,
|
309
408
|
a new version should be immediately released that restores compatibility.
|
310
|
-
Breaking changes to the public API
|
409
|
+
Breaking changes to the public API, including dropping a supported platform (i.e. minor version of Ruby),
|
410
|
+
will only be introduced with new major versions.
|
411
|
+
Epoch will only be bumped if there are dramatic changes, and that is not expected to happen ever.
|
311
412
|
|
312
413
|
### 📌 Is "Platform Support" part of the public API?
|
313
414
|
|
@@ -346,7 +447,15 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright
|
|
346
447
|
|
347
448
|
### © Copyright
|
348
449
|
|
349
|
-
|
450
|
+
<p>
|
451
|
+
Copyright (c) 2022 - 2025 Peter H. Boling,
|
452
|
+
<a href="https://railsbling.com">
|
453
|
+
RailsBling.com
|
454
|
+
<picture>
|
455
|
+
<img alt="Rails Bling" height="20" src="https://railsbling.com/images/logos/RailsBling-TrainLogo.svg" />
|
456
|
+
</picture>
|
457
|
+
</a>
|
458
|
+
</p>
|
350
459
|
|
351
460
|
## 🤑 One more thing
|
352
461
|
|
@@ -359,50 +468,60 @@ or one of the others at the head of this README.
|
|
359
468
|
|
360
469
|
[![Buy me a latte][🖇buyme-img]][🖇buyme]
|
361
470
|
|
471
|
+
[✇bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
362
472
|
[🏘chat]: https://gitter.im/oauth-xx/version_gem
|
363
473
|
[🏘chat-img]: https://img.shields.io/gitter/room/oauth-xx/version_gem.svg
|
364
|
-
[⛳️gem-namespace]: https://
|
365
|
-
[⛳️namespace-img]: https://img.shields.io/badge/namespace-VersionGem-brightgreen.svg?style=flat
|
474
|
+
[⛳️gem-namespace]: https://github.com/oauth-xx/version_gem/blob/main/lib/version_gem.rb
|
475
|
+
[⛳️namespace-img]: https://img.shields.io/badge/namespace-VersionGem-brightgreen.svg?style=flat&logo=ruby&logoColor=white
|
366
476
|
[⛳️gem-name]: https://rubygems.org/gems/version_gem
|
367
|
-
[⛳️name-img]: https://img.shields.io/badge/name-version__gem-brightgreen.svg?style=flat
|
368
|
-
[
|
369
|
-
[
|
477
|
+
[⛳️name-img]: https://img.shields.io/badge/name-version__gem-brightgreen.svg?style=flat&logo=rubygems&logoColor=red
|
478
|
+
[🚂bdfl-blog]: http://www.railsbling.com/tags/version_gem
|
479
|
+
[🚂bdfl-blog-img]: https://img.shields.io/badge/blog-railsbling-0093D0.svg?style=for-the-badge&logo=rubyonrails&logoColor=orange
|
480
|
+
[🚂bdfl-contact]: http://www.railsbling.com/contact
|
481
|
+
[🚂bdfl-contact-img]: https://img.shields.io/badge/Contact-BDFL-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red
|
370
482
|
[💖🖇linkedin]: http://www.linkedin.com/in/peterboling
|
371
|
-
[💖🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-
|
483
|
+
[💖🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-LinkedIn-0B66C2?style=flat&logo=newjapanprowrestling
|
372
484
|
[💖✌️wellfound]: https://angel.co/u/peter-boling
|
373
|
-
[💖✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=
|
485
|
+
[💖✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=flat&logo=wellfound
|
374
486
|
[💖💲crunchbase]: https://www.crunchbase.com/person/peter-boling
|
375
|
-
[💖💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=
|
487
|
+
[💖💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=flat&logo=crunchbase
|
376
488
|
[💖🐘ruby-mast]: https://ruby.social/@galtzo
|
377
|
-
[💖🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=
|
489
|
+
[💖🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=flat&logo=mastodon&label=Ruby%20%40galtzo
|
490
|
+
[💖🦋bluesky]: https://galtzo.bsky.social
|
491
|
+
[💖🦋bluesky-img]: https://img.shields.io/badge/@galtzo.bsky.social-0285FF?style=flat&logo=bluesky&logoColor=white
|
378
492
|
[💖🌳linktree]: https://linktr.ee/galtzo
|
379
|
-
[💖🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=
|
493
|
+
[💖🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=flat&logo=linktree
|
380
494
|
[💖💁🏼♂️devto]: https://dev.to/galtzo
|
381
|
-
[💖💁🏼♂️devto-img]: https://img.shields.io/badge/dev.to-0A0A0A?style=
|
495
|
+
[💖💁🏼♂️devto-img]: https://img.shields.io/badge/dev.to-0A0A0A?style=flat&logo=devdotto&logoColor=white
|
382
496
|
[💖💁🏼♂️aboutme]: https://about.me/peter.boling
|
497
|
+
[💖💁🏼♂️aboutme-img]: https://img.shields.io/badge/about.me-0A0A0A?style=flat&logo=aboutme&logoColor=white
|
383
498
|
[👨🏼🏫expsup-upwork]: https://www.upwork.com/freelancers/~014942e9b056abdf86?mp_source=share
|
384
|
-
[👨🏼🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-
|
499
|
+
[👨🏼🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
|
385
500
|
[👨🏼🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
|
386
|
-
[👨🏼🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-
|
387
|
-
[🏙️entsup-tidelift]: https://tidelift.com/
|
388
|
-
[🏙️entsup-tidelift-img]: https://img.shields.io/badge/
|
501
|
+
[👨🏼🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-Get_Help-1abc9c?style=for-the-badge&logo=CodeMentor&logoColor=white
|
502
|
+
[🏙️entsup-tidelift]: https://tidelift.com/subscription
|
503
|
+
[🏙️entsup-tidelift-img]: https://img.shields.io/badge/Tidelift_and_Sonar-Enterprise_Support-FD3456?style=for-the-badge&logo=sonar&logoColor=white
|
504
|
+
[🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
|
389
505
|
[💁🏼♂️peterboling]: http://www.peterboling.com
|
390
|
-
[
|
391
|
-
[📜
|
392
|
-
[📜
|
393
|
-
[📜
|
506
|
+
[🚂railsbling]: http://www.railsbling.com
|
507
|
+
[📜src-gl-img]: https://img.shields.io/badge/GitLab-FBA326?style=for-the-badge&logo=Gitlab&logoColor=orange
|
508
|
+
[📜src-gl]: https://gitlab.com/oauth-xx/version_gem/
|
509
|
+
[📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
|
510
|
+
[📜src-gh]: https://github.com/oauth-xx/version_gem
|
511
|
+
[📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
512
|
+
[📜docs-head-rd-img]: https://img.shields.io/badge/RubyDoc-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
394
513
|
[📜wiki]: https://gitlab.com/oauth-xx/version_gem/-/wikis/home
|
395
|
-
[📜wiki-img]: https://img.shields.io/badge/wiki-examples-
|
514
|
+
[📜wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=Wiki&logoColor=white
|
396
515
|
[👽dl-rank]: https://rubygems.org/gems/version_gem
|
397
516
|
[👽dl-ranki]: https://img.shields.io/gem/rd/version_gem.svg
|
398
517
|
[👽oss-help]: https://www.codetriage.com/oauth-xx/version_gem
|
399
518
|
[👽oss-helpi]: https://www.codetriage.com/oauth-xx/version_gem/badges/users.svg
|
400
519
|
[👽version]: https://rubygems.org/gems/version_gem
|
401
520
|
[👽versioni]: https://img.shields.io/gem/v/version_gem.svg
|
402
|
-
[🔑cc-mnt]: https://
|
403
|
-
[🔑cc-mnti♻️]: https://
|
404
|
-
[🔑cc-cov]: https://
|
405
|
-
[🔑cc-covi♻️]: https://
|
521
|
+
[🔑cc-mnt]: https://qlty.sh/gh/oauth-xx/projects/version_gem
|
522
|
+
[🔑cc-mnti♻️]: https://qlty.sh/badges/19404e90-9168-451a-8dac-882382cb768d/maintainability.svg
|
523
|
+
[🔑cc-cov]: https://qlty.sh/gh/oauth-xx/projects/version_gem
|
524
|
+
[🔑cc-covi♻️]: https://qlty.sh/badges/19404e90-9168-451a-8dac-882382cb768d/test_coverage.svg
|
406
525
|
[🔑codecov]: https://codecov.io/gh/oauth-xx/version_gem
|
407
526
|
[🔑codecovi♻️]: https://codecov.io/gh/oauth-xx/version_gem/branch/main/graph/badge.svg?token=cc6UdZCpAL
|
408
527
|
[🔑coveralls]: https://coveralls.io/github/oauth-xx/version_gem?branch=main
|
@@ -425,19 +544,25 @@ or one of the others at the head of this README.
|
|
425
544
|
[🚎6-s-wfi]: https://github.com/oauth-xx/version_gem/actions/workflows/supported.yml/badge.svg
|
426
545
|
[🚎7-us-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml
|
427
546
|
[🚎7-us-wfi]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml/badge.svg
|
428
|
-
[🚎
|
429
|
-
[🚎
|
547
|
+
[🚎9-t-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/truffle.yml
|
548
|
+
[🚎9-t-wfi]: https://github.com/oauth-xx/version_gem/actions/workflows/truffle.yml/badge.svg
|
549
|
+
[🚎10-j-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/jruby.yml
|
550
|
+
[🚎10-j-wfi]: https://github.com/oauth-xx/version_gem/actions/workflows/jruby.yml/badge.svg
|
551
|
+
[🚎11-c-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/current.yml
|
552
|
+
[🚎11-c-wfi]: https://github.com/oauth-xx/version_gem/actions/workflows/current.yml/badge.svg
|
430
553
|
[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
|
431
554
|
[⛳liberapay]: https://liberapay.com/pboling/donate
|
432
555
|
[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
|
433
556
|
[🖇sponsor]: https://github.com/sponsors/pboling
|
434
|
-
[🖇polar-img]: https://
|
557
|
+
[🖇polar-img]: https://img.shields.io/badge/polar-donate-yellow.svg
|
435
558
|
[🖇polar]: https://polar.sh/pboling
|
436
|
-
[🖇kofi-img]: https://img.shields.io/badge/
|
559
|
+
[🖇kofi-img]: https://img.shields.io/badge/a_more_different_coffee-✓-yellow.svg
|
437
560
|
[🖇kofi]: https://ko-fi.com/O5O86SNP4
|
438
561
|
[🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
|
439
562
|
[🖇patreon]: https://patreon.com/galtzo
|
440
|
-
[
|
563
|
+
[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
|
564
|
+
[🖇buyme]: https://www.buymeacoffee.com/pboling
|
565
|
+
[🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-✓-yellow.svg?style=flat
|
441
566
|
[💎ruby-2.3i]: https://img.shields.io/badge/Ruby-2.3-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
|
442
567
|
[💎ruby-2.4i]: https://img.shields.io/badge/Ruby-2.4-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
|
443
568
|
[💎ruby-2.5i]: https://img.shields.io/badge/Ruby-2.5-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
|
@@ -447,26 +572,39 @@ or one of the others at the head of this README.
|
|
447
572
|
[💎ruby-3.1i]: https://img.shields.io/badge/Ruby-3.1-CC342D?style=for-the-badge&logo=ruby&logoColor=white
|
448
573
|
[💎ruby-3.2i]: https://img.shields.io/badge/Ruby-3.2-CC342D?style=for-the-badge&logo=ruby&logoColor=white
|
449
574
|
[💎ruby-3.3i]: https://img.shields.io/badge/Ruby-3.3-CC342D?style=for-the-badge&logo=ruby&logoColor=white
|
450
|
-
[💎ruby-
|
575
|
+
[💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
|
576
|
+
[💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
|
577
|
+
[💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
|
578
|
+
[💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
|
579
|
+
[💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
|
580
|
+
[💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
|
581
|
+
[💎truby-headi]: https://img.shields.io/badge/Truffle_Ruby-HEAD-34BCB1?style=for-the-badge&logo=ruby&logoColor=blue
|
582
|
+
[💎jruby-9.1i]: https://img.shields.io/badge/JRuby-9.1-FBE742?style=for-the-badge&logo=ruby&logoColor=red
|
583
|
+
[💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
|
584
|
+
[💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
|
585
|
+
[💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
|
586
|
+
[💎jruby-c-i]: https://img.shields.io/badge/JRuby-current-FBE742?style=for-the-badge&logo=ruby&logoColor=green
|
587
|
+
[💎jruby-headi]: https://img.shields.io/badge/JRuby-HEAD-FBE742?style=for-the-badge&logo=ruby&logoColor=blue
|
451
588
|
[🤝issues]: https://github.com/oauth-xx/version_gem/issues
|
452
589
|
[🤝pulls]: https://github.com/oauth-xx/version_gem/pulls
|
453
590
|
[🤝contributing]: CONTRIBUTING.md
|
454
|
-
[🔑codecov-g]: https://codecov.io/gh/oauth-xx/version_gem/graphs/tree.svg?token=cc6UdZCpAL
|
591
|
+
[🔑codecov-g♻️]: https://codecov.io/gh/oauth-xx/version_gem/graphs/tree.svg?token=cc6UdZCpAL
|
455
592
|
[🖐contrib-rocks]: https://contrib.rocks
|
456
593
|
[🖐contributors]: https://github.com/oauth-xx/version_gem/graphs/contributors
|
457
594
|
[🖐contributors-img]: https://contrib.rocks/image?repo=oauth-xx/version_gem
|
458
595
|
[🚎contributors-gl]: https://gitlab.com/oauth-xx/version_gem/-/graphs/main
|
459
596
|
[🪇conduct]: CODE_OF_CONDUCT.md
|
597
|
+
[🪇conduct-img]: https://img.shields.io/badge/Contributor_Covenant-2.1-4baaaa.svg
|
460
598
|
[📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
461
|
-
[📌semver]:
|
462
|
-
[📌semver-img]: https://img.shields.io/badge/semver-
|
599
|
+
[📌semver]: https://antfu.me/posts/epoch-semver
|
600
|
+
[📌semver-img]: https://img.shields.io/badge/epoch-semver-FFDD67.svg?style=flat
|
463
601
|
[📌semver-breaking]: https://github.com/semver/semver/issues/716#issuecomment-869336139
|
464
602
|
[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
465
603
|
[📌changelog]: CHANGELOG.md
|
466
604
|
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
467
605
|
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
468
606
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
469
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
607
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.117-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
470
608
|
[🔐security]: SECURITY.md
|
471
609
|
[🔐security-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
|
472
610
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
@@ -475,12 +613,5 @@ or one of the others at the head of this README.
|
|
475
613
|
[📄license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
476
614
|
[📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
|
477
615
|
[📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-brightgreen.svg?style=flat
|
478
|
-
[railsbling]: http://www.railsbling.com
|
479
|
-
[peterboling]: http://www.peterboling.com
|
480
|
-
[bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
481
616
|
[🚎yard-current]: http://rubydoc.info/gems/version_gem
|
482
617
|
[🚎yard-head]: https://rubydoc.info/github/oauth-xx/version_gem/main
|
483
|
-
[homepage]: https://github.com/oauth-xx/version_gem
|
484
|
-
[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
|
485
|
-
[🖇buyme]: https://www.buymeacoffee.com/pboling
|
486
|
-
[🖇buyme-small-img]: https://img.shields.io/badge/Buy--Me--A--Coffee-✓-brightgreen.svg?style=flat
|
data/SECURITY.md
CHANGED
@@ -6,8 +6,16 @@
|
|
6
6
|
|----------|-----------|
|
7
7
|
| 1.latest | ✅ |
|
8
8
|
|
9
|
-
##
|
9
|
+
## Security contact information
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
To report a security vulnerability, please use the
|
12
|
+
[Tidelift security contact](https://tidelift.com/security).
|
13
|
+
Tidelift will coordinate the fix and disclosure.
|
14
|
+
|
15
|
+
## Additional Support
|
16
|
+
|
17
|
+
If you are interested in support for versions older than the latest release,
|
18
|
+
please consider sponsoring the project / maintainer @ https://liberapay.com/pboling/donate,
|
19
|
+
or find other sponsorship links in the [README].
|
20
|
+
|
21
|
+
[README]: README.md
|
data/lib/version_gem/api.rb
CHANGED
File without changes
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "error"
|
4
|
+
require_relative "api"
|
5
|
+
|
6
|
+
module VersionGem
|
7
|
+
# Support for Epoch Semantic Versioning
|
8
|
+
# See: https://antfu.me/posts/epoch-semver
|
9
|
+
module Epoch
|
10
|
+
EPOCH_SIZE = 1_000
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def extended(base)
|
14
|
+
raise Error, "VERSION must be defined before 'extend #{name}'" unless defined?(base::VERSION)
|
15
|
+
|
16
|
+
base.extend(Api)
|
17
|
+
base.extend(OverloadApiForEpoch)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
module OverloadApiForEpoch
|
22
|
+
# *** OVERLOAD METHODS FROM API ***
|
23
|
+
#
|
24
|
+
# The epoch version
|
25
|
+
#
|
26
|
+
# @return [Integer]
|
27
|
+
def epoch
|
28
|
+
@epoch ||= _major / EPOCH_SIZE
|
29
|
+
end
|
30
|
+
|
31
|
+
# The major version
|
32
|
+
#
|
33
|
+
# @return [Integer]
|
34
|
+
def major
|
35
|
+
@major ||= _major % EPOCH_SIZE
|
36
|
+
end
|
37
|
+
|
38
|
+
# The version number as a hash
|
39
|
+
#
|
40
|
+
# @return [Hash]
|
41
|
+
def to_h
|
42
|
+
@to_h ||= {
|
43
|
+
epoch: epoch,
|
44
|
+
major: major,
|
45
|
+
minor: minor,
|
46
|
+
patch: patch,
|
47
|
+
pre: pre,
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# NOTE: This is not the same as _to_a, which returns an array of strings
|
52
|
+
#
|
53
|
+
# The version number as an array of cast values
|
54
|
+
# where epoch and major are derived from a single string:
|
55
|
+
# EPOCH * 1000 + MAJOR
|
56
|
+
#
|
57
|
+
# @return [Array<[Integer, String, NilClass]>]
|
58
|
+
def to_a
|
59
|
+
@to_a ||= [epoch, major, minor, patch, pre]
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def _major
|
65
|
+
@_major ||= _to_a[0].to_i
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/lib/version_gem/rspec.rb
CHANGED
@@ -12,6 +12,12 @@ RSpec::Matchers.define(:have_version_as_string) do
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
RSpec::Matchers.define(:have_epoch_as_integer) do
|
16
|
+
match do |version_mod|
|
17
|
+
version_mod.epoch.is_a?(Integer)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
15
21
|
RSpec::Matchers.define(:have_major_as_integer) do
|
16
22
|
match do |version_mod|
|
17
23
|
version_mod.major.is_a?(Integer)
|
@@ -52,3 +58,21 @@ RSpec.shared_examples_for("a Version module") do |version_mod|
|
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
61
|
+
|
62
|
+
RSpec.shared_examples_for("an Epoch Version module") do |version_mod|
|
63
|
+
it "is introspectable" do
|
64
|
+
aggregate_failures "introspectable api" do
|
65
|
+
expect(version_mod).is_a?(Module)
|
66
|
+
expect(version_mod).to(have_version_constant)
|
67
|
+
expect(version_mod).to(have_version_as_string)
|
68
|
+
expect(version_mod.to_s).to(be_a(String))
|
69
|
+
expect(version_mod).to(have_epoch_as_integer)
|
70
|
+
expect(version_mod).to(have_major_as_integer)
|
71
|
+
expect(version_mod).to(have_minor_as_integer)
|
72
|
+
expect(version_mod).to(have_patch_as_integer)
|
73
|
+
expect(version_mod).to(have_pre_as_nil_or_string)
|
74
|
+
expect(version_mod.to_h.keys).to(match_array(%i[epoch major minor patch pre]))
|
75
|
+
expect(version_mod.to_a).to(be_a(Array))
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/lib/version_gem/version.rb
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
module VersionGem
|
4
4
|
module Version
|
5
|
-
VERSION = "1.1.
|
5
|
+
VERSION = "1.1.7"
|
6
6
|
# This would work in this gem, but not in external libraries,
|
7
7
|
# because version files are loaded in Gemspecs before bundler
|
8
8
|
# has a chance to load dependencies.
|
9
9
|
# Instead, see lib/version_gem.rb for a solution that will work everywhere
|
10
10
|
# extend VersionGem::Basic
|
11
|
+
# or
|
12
|
+
# extend VersionGem::Epoch
|
11
13
|
end
|
12
14
|
end
|
data/lib/version_gem.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: version_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
I5o+DRfXQHqKucx1ldFHvI2rE/kSCWqGTHN2eyu1sqCPeOoIMxrltJhaejKPkxqj
|
36
36
|
zaF9Og==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2025-
|
38
|
+
date: 2025-04-15 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rspec
|
@@ -79,6 +79,20 @@ dependencies:
|
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '13.0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: stone_checksums
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.0'
|
82
96
|
description: Versions are good. Versions are cool. Versions will win.
|
83
97
|
email:
|
84
98
|
- peter.boling@gmail.com
|
@@ -102,6 +116,7 @@ files:
|
|
102
116
|
- lib/version_gem.rb
|
103
117
|
- lib/version_gem/api.rb
|
104
118
|
- lib/version_gem/basic.rb
|
119
|
+
- lib/version_gem/epoch.rb
|
105
120
|
- lib/version_gem/error.rb
|
106
121
|
- lib/version_gem/rspec.rb
|
107
122
|
- lib/version_gem/ruby.rb
|
@@ -110,11 +125,11 @@ homepage: https://gitlab.com/oauth-xx/version_gem
|
|
110
125
|
licenses:
|
111
126
|
- MIT
|
112
127
|
metadata:
|
113
|
-
homepage_uri: https://
|
114
|
-
source_code_uri: https://gitlab.com/oauth-xx/version_gem/-/tree/v1.1.
|
115
|
-
changelog_uri: https://gitlab.com/oauth-xx/version_gem/-/blob/v1.1.
|
128
|
+
homepage_uri: https://railsbling.com/tags/version_gem/
|
129
|
+
source_code_uri: https://gitlab.com/oauth-xx/version_gem/-/tree/v1.1.7
|
130
|
+
changelog_uri: https://gitlab.com/oauth-xx/version_gem/-/blob/v1.1.7/CHANGELOG.md
|
116
131
|
bug_tracker_uri: https://gitlab.com/oauth-xx/version_gem/-/issues
|
117
|
-
documentation_uri: https://www.rubydoc.info/gems/version_gem/1.1.
|
132
|
+
documentation_uri: https://www.rubydoc.info/gems/version_gem/1.1.7
|
118
133
|
wiki_uri: https://gitlab.com/oauth-xx/version_gem/-/wiki
|
119
134
|
mailing_list_uri: https://groups.google.com/g/oauth-ruby
|
120
135
|
funding_uri: https://liberapay.com/pboling
|
@@ -140,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
155
|
- !ruby/object:Gem::Version
|
141
156
|
version: '0'
|
142
157
|
requirements: []
|
143
|
-
rubygems_version: 3.6.
|
158
|
+
rubygems_version: 3.6.6
|
144
159
|
specification_version: 4
|
145
160
|
summary: Enhance your VERSION! Sugar for Version modules.
|
146
161
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|