version_gem 1.1.0 → 1.1.4
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 +2 -0
- data/CHANGELOG.md +70 -20
- data/CONTRIBUTING.md +71 -11
- data/LICENSE.txt +1 -1
- data/README.md +185 -120
- data/SECURITY.md +3 -3
- data/lib/version_gem/api.rb +9 -8
- data/lib/version_gem/basic.rb +7 -5
- data/lib/version_gem/rspec.rb +18 -18
- data/lib/version_gem/ruby.rb +18 -0
- data/lib/version_gem/version.rb +1 -1
- data/lib/version_gem.rb +3 -2
- data.tar.gz.sig +0 -0
- metadata +64 -67
- metadata.gz.sig +0 -0
- data/sig/version_gem.rbs +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 293448abeed414d0a43cee34925de9e94cf3329326e248d18694d499f1952e47
|
|
4
|
+
data.tar.gz: 24a83ab4592f9b5271205ee24b7829af6bb13aae5f2a74f982663aad127ac6b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b668065b9b75fd6e7e262ee7a8237da8e8844bdb9f11978cc504da6d7da5dce436bbe3af096c1feb18aab0b0d938a3b083a6090af992ae60ffd849f0f5e8e86
|
|
7
|
+
data.tar.gz: cf0d558fc6ffb5a39795515c4b98553e7703a2ccc120488e5ca09c2ae4c7761143c0127506da9596606ea57bd47627be3ef41ee19f2f930e755d5044b901bbe3
|
checksums.yaml.gz.sig
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<m��F�����:��
|
|
2
|
+
萧����m$�,�7b��GC.0!�$?�x8�������Y7�7rc�����:���"�u�B�QCyO�<�r�����.� �9��B��6�O㳻�u��e���]�����P��0�y��R�*��=�a�_@���NA���'�0FDd�u#�{p�_�'g�uR��'�AOi���̆N�����t�R�e�n+P����rw�U�� �o�8mI����ت`m_P�P���.���4״���`��h&�!��S*.6~�~��2����e���؋��o���8�u �zpݴu�D=��vjHX��.ܡ� X�U��n�:��w����$�@P�ڎ�b �DQZM��b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
@@ -6,36 +6,86 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
### Added
|
|
9
|
-
|
|
10
9
|
### Changed
|
|
10
|
+
### Fixed
|
|
11
|
+
### Removed
|
|
11
12
|
|
|
13
|
+
## [1.1.4] 2024-03-21 ([tag][1.1.4t])
|
|
14
|
+
### Added
|
|
15
|
+
- Ruby 3.3 to CI (@pboling)
|
|
12
16
|
### Fixed
|
|
17
|
+
- Remove the executable bit from non-executable files (@Fryguy)
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
## [1.1.3] 2023-06-05 ([tag][1.1.3t])
|
|
20
|
+
### Added
|
|
21
|
+
- More test coverage (now 100% 🎉) (@pboling)
|
|
22
|
+
- Improved documentation (now 77% 🎉) (@pboling)
|
|
23
|
+
- Gemfile context pattern (@pboling)
|
|
24
|
+
- Improved linting (via rubocop-lts) (@pboling)
|
|
25
|
+
- More robust GHA config (@pboling)
|
|
26
|
+
- (dev) Dependencies (@pboling)
|
|
27
|
+
- yard-junk
|
|
28
|
+
- redcarpet
|
|
29
|
+
- pry, IRB alternative
|
|
30
|
+
- pry-suite
|
|
31
|
+
- debase, for IDE debugging
|
|
32
|
+
- (dev) Rake task for rubocop_gradual (@pboling)
|
|
33
|
+
### Fixed
|
|
34
|
+
- (dev) `yard` documentation task (@pboling)
|
|
35
|
+
|
|
36
|
+
## [1.1.2] - 2023-03-17 ([tag][1.1.2t])
|
|
37
|
+
### Added
|
|
38
|
+
- `VersionGem::Ruby` to help library CI integration against many different versions of Ruby (@pboling)
|
|
39
|
+
- Experimental, optional, require (not loaded by default, which is why this can be in a patch)
|
|
40
|
+
- Spec coverage is now 100%, lines and branches, including the fabled `version.rb` (@pboling)
|
|
41
|
+
- Full RBS Signatures (@pboling)
|
|
42
|
+
|
|
43
|
+
## [1.1.1] - 2022-09-19 ([tag][1.1.1t])
|
|
44
|
+
### Added
|
|
45
|
+
- Alternatives section to README.md (@pboling)
|
|
46
|
+
- Signing cert for gem releases (@pboling)
|
|
47
|
+
- Mailing List and other metadata URIs (@pboling)
|
|
48
|
+
- Checksums for released gems (@pboling)
|
|
49
|
+
### Changed
|
|
50
|
+
- SECURITY.md policy (@pboling)
|
|
51
|
+
- Version methods are now memoized (||=) on initial call for performance (@pboling)
|
|
52
|
+
- Gem releases are now cryptographically signed (@pboling)
|
|
15
53
|
|
|
16
|
-
## [1.1.0] - 2022-06-24
|
|
54
|
+
## [1.1.0] - 2022-06-24 ([tag][1.1.0t])
|
|
17
55
|
### Fixed
|
|
18
|
-
- to_a uses same type casting as major, minor, patch, and pre
|
|
56
|
+
- to_a uses same type casting as major, minor, patch, and pre (@pboling)
|
|
19
57
|
### Added
|
|
20
|
-
- RSpec Matchers and Shared Example
|
|
58
|
+
- RSpec Matchers and Shared Example (@pboling)
|
|
21
59
|
|
|
22
|
-
## [1.0.2] - 2022-06-23
|
|
60
|
+
## [1.0.2] - 2022-06-23 ([tag][1.0.2t])
|
|
23
61
|
### Added
|
|
24
|
-
- Delay loading of library code until after code coverage tool is loaded
|
|
62
|
+
- Delay loading of library code until after code coverage tool is loaded (@pboling)
|
|
25
63
|
|
|
26
|
-
## [1.0.1] - 2022-06-23
|
|
64
|
+
## [1.0.1] - 2022-06-23 ([tag][1.0.1t])
|
|
27
65
|
### Added
|
|
28
|
-
- CI Build improvements
|
|
29
|
-
- Code coverage reporting
|
|
30
|
-
- Documentation improvements
|
|
31
|
-
- Badges!
|
|
66
|
+
- CI Build improvements (@pboling)
|
|
67
|
+
- Code coverage reporting (@pboling)
|
|
68
|
+
- Documentation improvements (@pboling)
|
|
69
|
+
- Badges! (@pboling)
|
|
32
70
|
|
|
33
|
-
## [1.0.0] - 2022-06-21
|
|
71
|
+
## [1.0.0] - 2022-06-21 ([tag][1.0.0t])
|
|
34
72
|
### Added
|
|
35
|
-
- Initial release, with basic version parsing API
|
|
73
|
+
- Initial release, with basic version parsing API (@pboling)
|
|
36
74
|
|
|
37
|
-
[Unreleased]: https://
|
|
38
|
-
[1.1.
|
|
39
|
-
[1.
|
|
40
|
-
[1.
|
|
41
|
-
[1.
|
|
75
|
+
[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.4...HEAD
|
|
76
|
+
[1.1.4]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.3...v1.1.4
|
|
77
|
+
[1.1.4t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.4
|
|
78
|
+
[1.1.3]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.2...v1.1.3
|
|
79
|
+
[1.1.3t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.3
|
|
80
|
+
[1.1.2]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.1...v1.1.2
|
|
81
|
+
[1.1.2t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.2
|
|
82
|
+
[1.1.1]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.0...v1.1.1
|
|
83
|
+
[1.1.1t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.1
|
|
84
|
+
[1.1.0]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.2...v1.1.0
|
|
85
|
+
[1.1.0t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.0
|
|
86
|
+
[1.0.2]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.1...v1.0.2
|
|
87
|
+
[1.0.2t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.2
|
|
88
|
+
[1.0.1]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.0...v1.0.1
|
|
89
|
+
[1.0.1t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.1
|
|
90
|
+
[1.0.0]: https://gitlab.com/oauth-xx/version_gem/-/compare/a3055964517c159bf214712940982034b75264be...v1.0.0
|
|
91
|
+
[1.0.0t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.0
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,25 +1,85 @@
|
|
|
1
1
|
## Contributing
|
|
2
2
|
|
|
3
|
-
Bug reports and pull requests are welcome on GitHub at [https://
|
|
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
|
|
5
|
-
the [code of conduct][conduct].
|
|
5
|
+
the [code of conduct][🤝conduct].
|
|
6
|
+
|
|
7
|
+
To submit a patch, please fork the project and create a patch with
|
|
8
|
+
tests. Once you're happy with it send a pull request and post a message to the
|
|
9
|
+
[google group][⛳mail-list] or on the [gitter chat][🏘chat].
|
|
10
|
+
|
|
11
|
+
## Release
|
|
12
|
+
|
|
13
|
+
To release a new version:
|
|
14
|
+
|
|
15
|
+
1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check
|
|
16
|
+
2. Update the version number in `version.rb`
|
|
17
|
+
3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
|
|
18
|
+
4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
|
|
19
|
+
5. Run `git push` to trigger the final CI pipeline before release, & merge PRs
|
|
20
|
+
a. NOTE: Remember to [check the build][🧪build]!
|
|
21
|
+
6. Run `git checkout main` (Or whichever branch is considered `trunk`, e.g. `master`)
|
|
22
|
+
7. Run `git pull origin main` to ensure you will release the latest trunk code.
|
|
23
|
+
8. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums
|
|
24
|
+
a. Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS` (you'll need the zsh/datetime module, if running zsh)
|
|
25
|
+
9. Run `bundle exec rake build`
|
|
26
|
+
10. Run [`bin/checksums`](https://github.com/rubygems/guides/pull/325) to create SHA-256 and SHA-512 checksums
|
|
27
|
+
a. Checksums will be committed automatically by the script, but not pushed
|
|
28
|
+
11. Run `bundle exec rake release` which will create a git tag for the version,
|
|
29
|
+
push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems]
|
|
6
30
|
|
|
7
|
-
|
|
31
|
+
NOTE: You will need to have a public key in `certs/`, and list your cert in the
|
|
32
|
+
`gemspec`, in order to sign the new release.
|
|
33
|
+
See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
8
34
|
|
|
9
35
|
## Contributors
|
|
10
36
|
|
|
11
|
-
[][🖐contributors]
|
|
12
38
|
|
|
13
|
-
Made with [contributors-img][contrib-rocks].
|
|
39
|
+
Made with [contributors-img][🖐contrib-rocks].
|
|
14
40
|
|
|
15
|
-
|
|
41
|
+
Also see GitLab Contributors: [https://gitlab.com/oauth-xx/version_gem/-/graphs/main][🚎contributors]
|
|
16
42
|
|
|
17
|
-
|
|
43
|
+
## Contributing
|
|
18
44
|
|
|
19
|
-
[
|
|
45
|
+
Bug reports and pull requests are welcome on GitLab at [https://gitlab.com/oauth-xx/version_gem][🚎src-main]
|
|
46
|
+
. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
|
47
|
+
the [code of conduct][conduct].
|
|
20
48
|
|
|
21
|
-
|
|
49
|
+
To submit a patch, please fork the project and create a patch with
|
|
50
|
+
tests. Once you're happy with it send a pull request and post a message to the
|
|
51
|
+
[google group][⛳mail-list] or on the [gitter chat][🏘chat].
|
|
22
52
|
|
|
23
|
-
|
|
53
|
+
## Release
|
|
54
|
+
|
|
55
|
+
To release a new version:
|
|
56
|
+
|
|
57
|
+
1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check.
|
|
58
|
+
2. update the version number in `version.rb`
|
|
59
|
+
3. run `bundle exec rake build:checksum`
|
|
60
|
+
4. move the built gem to project root
|
|
61
|
+
5. run `bin/checksum` to create the missing SHA256 checksum
|
|
62
|
+
6. move the built gem back to `pkg/`
|
|
63
|
+
7. commit the changes
|
|
64
|
+
8. run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][rubygems].
|
|
65
|
+
|
|
66
|
+
NOTE: You will need to have a public key in `certs/`, and list your cert in the
|
|
67
|
+
`gemspec`, in order to sign the new release.
|
|
68
|
+
See: [RubyGems Security Guide][rubygems-security-guide]
|
|
69
|
+
|
|
70
|
+
## Contributors
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
[comment]: <> (Following links are used by README, CONTRIBUTING)
|
|
24
74
|
|
|
25
|
-
[
|
|
75
|
+
[🚎contributors]: https://gitlab.com/oauth-xx/version_gem/-/graphs/main
|
|
76
|
+
[⛳mail-list]: http://groups.google.com/group/oauth-ruby
|
|
77
|
+
[🚎src-main]: https://gitlab.com/oauth-xx/version_gem
|
|
78
|
+
[🧪build]: https://github.com/oauth-xx/version_gem/actions
|
|
79
|
+
[🏘chat]: https://matrix.to/#/#pboling_version_gem:gitter.im
|
|
80
|
+
[🤝conduct]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CODE_OF_CONDUCT.md
|
|
81
|
+
[🖐contrib-rocks]: https://contrib.rocks
|
|
82
|
+
[🖐contributors]: https://github.com/oauth-xx/version_gem/graphs/contributors
|
|
83
|
+
[💎rubygems]: https://rubygems.org
|
|
84
|
+
[🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
|
85
|
+
[🚎src-main]: https://github.com/oauth-xx/version_gem
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# VersionGem
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Alternatives
|
|
4
|
+
|
|
5
|
+
This gem has a very niche purpose, which is:
|
|
6
|
+
|
|
7
|
+
1. providing introspection of a `Version` module based on a `Version::VERSION` constant string,
|
|
8
|
+
2. while not interfering with `gemspec` parsing where the `VERSION` string is traditionally used.
|
|
9
|
+
|
|
10
|
+
If this isn't **precisely** your use case you may be better off looking at
|
|
11
|
+
_[versionaire](https://www.alchemists.io/projects/versionaire)_, a wonderful, performant, well-maintained,
|
|
12
|
+
gem from the Alchemists, or _[version_sorter](https://rubygems.org/gems/version_sorter)_ from GitHub.
|
|
13
|
+
|
|
14
|
+
For more discussion about this [see issue #2](https://gitlab.com/oauth-xx/version_gem/-/issues/2)
|
|
15
|
+
|
|
16
|
+
-----
|
|
17
|
+
|
|
18
|
+
<div id="badges">
|
|
19
|
+
|
|
20
|
+
[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
|
|
21
|
+
[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
|
|
22
|
+
<span class="badge-buymeacoffee">
|
|
23
|
+
<a href="https://ko-fi.com/O5O86SNP4" target='_blank' title="Donate to my FLOSS or refugee efforts at ko-fi.com"><img src="https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg" alt="Buy me coffee donation button" /></a>
|
|
24
|
+
</span>
|
|
25
|
+
<span class="badge-patreon">
|
|
26
|
+
<a href="https://patreon.com/galtzo" title="Donate to my FLOSS or refugee efforts using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a>
|
|
27
|
+
</span>
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
|
|
32
|
+
[⛳liberapay]: https://liberapay.com/pboling/donate
|
|
33
|
+
[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
|
|
34
|
+
[🖇sponsor]: https://github.com/sponsors/pboling
|
|
35
|
+
|
|
36
|
+
## Still here?
|
|
37
|
+
|
|
38
|
+
Give your next library an introspectable `Version` module without breaking your Gemspec.
|
|
4
39
|
|
|
5
40
|
```ruby
|
|
6
41
|
MyLib::Version.to_s # => "1.2.3.rc3"
|
|
@@ -12,7 +47,7 @@ MyLib::Version.to_a # => [1, 2, 3, "rc3"]
|
|
|
12
47
|
MyLib::Version.to_h # => { major: 1, minor: 2, patch: 3, pre: "rc3" }
|
|
13
48
|
```
|
|
14
49
|
|
|
15
|
-
This library was extracted from the gem [
|
|
50
|
+
This library was extracted from the gem _[oauth2](https://gitlab.com/oauth-xx/oauth2)_.
|
|
16
51
|
|
|
17
52
|
This gem has no runtime dependencies.
|
|
18
53
|
|
|
@@ -40,18 +75,18 @@ badge #s:
|
|
|
40
75
|
📗
|
|
41
76
|
|
|
42
77
|
appended indicators:
|
|
43
|
-
♻️ - URL needs to be updated from
|
|
78
|
+
♻️ - URL needs to be updated from SAAS integration. Find / Replace is insufficient.
|
|
44
79
|
-->
|
|
45
80
|
|
|
46
|
-
| | Project | bundle add version_gem
|
|
47
|
-
|
|
48
|
-
| 1️⃣ | name, license, docs, standards | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] [![SemVer 2.0.0][🧮semver-img]][semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog]
|
|
49
|
-
| 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-
|
|
50
|
-
| 3️⃣ |
|
|
51
|
-
| 4️⃣ | testing | [![
|
|
52
|
-
| 5️⃣ | coverage & security | [![CodeClimate][⛳cclim-cov-img♻️]][⛳cclim-cov] [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Code Coverage][🧮cov-wf-img]][🧮cov-wf]
|
|
53
|
-
| 6️⃣ | resources | [![
|
|
54
|
-
| 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme]
|
|
81
|
+
| | Project | bundle add version_gem |
|
|
82
|
+
|:----|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
83
|
+
| 1️⃣ | name, license, docs, standards | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] [![SemVer 2.0.0][🧮semver-img]][🧮semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] |
|
|
84
|
+
| 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-main-img]][🚎src-main] [![Open PRs][🖐prs-o-img]][🖐prs-o] [![Closed PRs][🧮prs-c-img]][🧮prs-c] |
|
|
85
|
+
| 3️⃣ | maintenance & linting | [![Maintainability][⛳cclim-maint-img♻️]][⛳cclim-maint] [![Helpers][🖇triage-help-img]][🖇triage-help] [![Depfu][🏘depfu-img♻️]][🏘depfu♻️] [![Contributors][🚎contributors-img]][🚎contributors] [![Style][🖐style-wf-img]][🖐style-wf] [![Kloc Roll][🧮kloc-img]][🧮kloc] |
|
|
86
|
+
| 4️⃣ | testing | [![Supported][🏘sup-wf-img]][🏘sup-wf] [![Heads][🚎heads-wf-img]][🚎heads-wf] [![Unofficial Support][🖐uns-wf-img]][🖐uns-wf] <!--[![MacOS][🧮mac-wf-img]][🧮mac-wf] [![Windows][📗win-wf-img]][📗win-wf]--> |
|
|
87
|
+
| 5️⃣ | coverage & security | [![CodeClimate][⛳cclim-cov-img♻️]][⛳cclim-cov] [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Code Coverage][🧮cov-wf-img]][🧮cov-wf] |
|
|
88
|
+
| 6️⃣ | resources | [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Wiki][🖐wiki-img]][🖐wiki] |
|
|
89
|
+
| 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme] |
|
|
55
90
|
|
|
56
91
|
<!--
|
|
57
92
|
The link tokens in the following sections should be kept ordered by the row and badge numbering scheme
|
|
@@ -62,8 +97,9 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
|
62
97
|
[⛳️name-img]: https://img.shields.io/badge/name-version_gem-brightgreen.svg?style=flat
|
|
63
98
|
[🖇src-license]: https://opensource.org/licenses/MIT
|
|
64
99
|
[🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
|
65
|
-
[🚎yard]: https://www.rubydoc.info/
|
|
100
|
+
[🚎yard]: https://www.rubydoc.info/gems/version_gem
|
|
66
101
|
[🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
|
|
102
|
+
[🧮semver]: http://semver.org/
|
|
67
103
|
[🧮semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
|
|
68
104
|
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
|
69
105
|
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
|
@@ -72,44 +108,38 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
|
72
108
|
[⛳️version-img]: http://img.shields.io/gem/v/version_gem.svg
|
|
73
109
|
[🖇DL-total-img]: https://img.shields.io/gem/dt/version_gem.svg
|
|
74
110
|
[🏘DL-rank-img]: https://img.shields.io/gem/rt/version_gem.svg
|
|
75
|
-
[🚎src-
|
|
76
|
-
[🚎src-
|
|
77
|
-
[🖐prs-o]: https://
|
|
111
|
+
[🚎src-main]: https://gitlab.com/oauth-xx/version_gem
|
|
112
|
+
[🚎src-main-img]: https://img.shields.io/badge/source-gitlab-brightgreen.svg?style=flat
|
|
113
|
+
[🖐prs-o]: https://gitlab.com/oauth-xx/version_gem/-/merge_requests
|
|
78
114
|
[🖐prs-o-img]: https://img.shields.io/github/issues-pr/pboling/version_gem
|
|
79
115
|
[🧮prs-c]: https://github.com/pboling/version_gem/pulls?q=is%3Apr+is%3Aclosed
|
|
80
116
|
[🧮prs-c-img]: https://img.shields.io/github/issues-pr-closed/pboling/version_gem
|
|
81
|
-
[📗next]: https://github.com/pboling/version_gem/milestone/1
|
|
82
|
-
[📗next-img]: https://img.shields.io/github/milestones/progress/pboling/version_gem/1?label=Next%20Version
|
|
83
117
|
|
|
84
|
-
<!-- 3️⃣
|
|
118
|
+
<!-- 3️⃣ maintenance & linting -->
|
|
85
119
|
[⛳cclim-maint]: https://codeclimate.com/github/pboling/version_gem/maintainability
|
|
86
120
|
[⛳cclim-maint-img♻️]: https://api.codeclimate.com/v1/badges/b504d61c4ed1d46aec02/maintainability
|
|
87
121
|
[🖇triage-help]: https://www.codetriage.com/pboling/version_gem
|
|
88
122
|
[🖇triage-help-img]: https://www.codetriage.com/pboling/version_gem/badges/users.svg
|
|
89
123
|
[🏘depfu♻️]: https://depfu.com/github/pboling/version_gem?project_id=35803
|
|
90
124
|
[🏘depfu-img♻️]: https://badges.depfu.com/badges/5d8943de6cfdf1ee048ad6d907f3e35b/count.svg
|
|
91
|
-
[🚎contributors]: https://
|
|
125
|
+
[🚎contributors]: https://gitlab.com/oauth-xx/version_gem/-/graphs/main
|
|
92
126
|
[🚎contributors-img]: https://img.shields.io/github/contributors-anon/pboling/version_gem
|
|
93
|
-
[🖐style-wf]: https://github.com/
|
|
94
|
-
[🖐style-wf-img]: https://github.com/
|
|
127
|
+
[🖐style-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/style.yml
|
|
128
|
+
[🖐style-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/style.yml/badge.svg
|
|
95
129
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
96
130
|
[🧮kloc-img]: https://img.shields.io/tokei/lines/github.com/pboling/version_gem
|
|
97
131
|
|
|
98
132
|
<!-- 4️⃣ testing -->
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
[🧮mac-wf]: https://github.com/pboling/version_gem/actions/workflows/macos.yml
|
|
110
|
-
[🧮mac-wf-img]: https://github.com/pboling/version_gem/actions/workflows/macos.yml/badge.svg
|
|
111
|
-
[📗win-wf]: https://github.com/pboling/version_gem/actions/workflows/windows.yml
|
|
112
|
-
[📗win-wf-img]: https://github.com/pboling/version_gem/actions/workflows/windows.yml/badge.svg
|
|
133
|
+
[🏘sup-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/supported.yml
|
|
134
|
+
[🏘sup-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/supported.yml/badge.svg
|
|
135
|
+
[🚎heads-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/heads.yml
|
|
136
|
+
[🚎heads-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/heads.yml/badge.svg
|
|
137
|
+
[🖐uns-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml
|
|
138
|
+
[🖐uns-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml/badge.svg
|
|
139
|
+
[🧮mac-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/macos.yml
|
|
140
|
+
[🧮mac-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/macos.yml/badge.svg
|
|
141
|
+
[📗win-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/windows.yml
|
|
142
|
+
[📗win-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/windows.yml/badge.svg
|
|
113
143
|
|
|
114
144
|
<!-- 5️⃣ coverage & security -->
|
|
115
145
|
[⛳cclim-cov]: https://codeclimate.com/github/pboling/version_gem/test_coverage
|
|
@@ -118,23 +148,21 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
|
118
148
|
[🖇codecov]: https://codecov.io/gh/pboling/version_gem
|
|
119
149
|
[🏘coveralls]: https://coveralls.io/github/pboling/version_gem?branch=main
|
|
120
150
|
[🏘coveralls-img]: https://coveralls.io/repos/github/pboling/version_gem/badge.svg?branch=main
|
|
121
|
-
[🚎sec-pol]: https://
|
|
151
|
+
[🚎sec-pol]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md
|
|
122
152
|
[🚎sec-pol-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
|
|
123
153
|
[🖐codeQL]: https://github.com/pboling/version_gem/security/code-scanning
|
|
124
|
-
[🖐codeQL-img]: https://github.com/
|
|
125
|
-
[🧮cov-wf]: https://github.com/
|
|
126
|
-
[🧮cov-wf-img]: https://github.com/
|
|
154
|
+
[🖐codeQL-img]: https://github.com/oauth-xx/version_gem/actions/workflows/codeql-analysis.yml/badge.svg
|
|
155
|
+
[🧮cov-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/coverage.yml
|
|
156
|
+
[🧮cov-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/coverage.yml/badge.svg
|
|
127
157
|
|
|
128
158
|
<!-- 6️⃣ resources -->
|
|
129
|
-
[⛳gh-discussions]: https://github.com/pboling/version_gem/discussions
|
|
130
|
-
[⛳gh-discussions-img]: https://img.shields.io/github/discussions/pboling/version_gem
|
|
131
159
|
[🖇codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
|
|
132
160
|
[🖇codementor-img]: https://cdn.codementor.io/badges/get_help_github.svg
|
|
133
|
-
[🏘chat]: https://gitter.im/
|
|
134
|
-
[🏘chat-img]: https://img.shields.io/gitter/room/
|
|
161
|
+
[🏘chat]: https://gitter.im/oauth-xx/version_gem
|
|
162
|
+
[🏘chat-img]: https://img.shields.io/gitter/room/oauth-xx/version_gem.svg
|
|
135
163
|
[🚎blog]: http://www.railsbling.com/tags/version_gem/
|
|
136
164
|
[🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
|
|
137
|
-
[🖐wiki]: https://
|
|
165
|
+
[🖐wiki]: https://gitlab.com/oauth-xx/version_gem/-/wikis/home
|
|
138
166
|
[🖐wiki-img]: https://img.shields.io/badge/wiki-examples-brightgreen.svg?style=flat
|
|
139
167
|
|
|
140
168
|
<!-- 7️⃣ spread 💖 -->
|
|
@@ -213,6 +241,75 @@ MyLib::Version.to_h # => { major: 0, minor: 1, patch: 0, pre: "" }
|
|
|
213
241
|
|
|
214
242
|
Your `version.rb` file now abides the Ruby convention of directory / path matching the namespace / class!
|
|
215
243
|
|
|
244
|
+
### Zietwerk
|
|
245
|
+
|
|
246
|
+
The pattern of `version.rb` breaking the ruby convention of directory / path matching the namespace / class
|
|
247
|
+
is so entrenched that the `zeitwerk` library has a special carve-out for it.
|
|
248
|
+
RubyGems using this "bad is actually good" pattern are encouraged to use `Zeitwerk.for_gem`.
|
|
249
|
+
|
|
250
|
+
**Do not do that ^** if you use this gem.
|
|
251
|
+
|
|
252
|
+
#### Simple Zeitwerk Example
|
|
253
|
+
|
|
254
|
+
Create a gem like this (keeping with the `MyLib` theme):
|
|
255
|
+
|
|
256
|
+
```shell
|
|
257
|
+
bundle gem my_lib
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Then following the usage instructions above, you edit your primary namespace file @ `lib/my_lib.rb`,
|
|
261
|
+
but inject the Zeitwerk loader.
|
|
262
|
+
|
|
263
|
+
```ruby
|
|
264
|
+
# frozen_string_literal: true
|
|
265
|
+
|
|
266
|
+
require_relative "my_lib/version"
|
|
267
|
+
|
|
268
|
+
module MyLib
|
|
269
|
+
class Error < StandardError; end
|
|
270
|
+
# Your code goes here...
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
loader = Zeitwerk::Loader.new
|
|
274
|
+
loader.tag = File.basename(__FILE__, ".rb")
|
|
275
|
+
loader.push_dir("lib/my_lib", namespace: MyLib)
|
|
276
|
+
loader.setup # ready!
|
|
277
|
+
loader.eager_load(force: true) # optional!
|
|
278
|
+
|
|
279
|
+
MyLib::Version.class_eval do
|
|
280
|
+
extend VersionGem::Basic
|
|
281
|
+
end
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### Complex Zeitwerk Example
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
#### Query Ruby Version (as of version 1.2.0)
|
|
288
|
+
|
|
289
|
+
In Continuous Integration environments for libraries that run against many versions of Ruby,
|
|
290
|
+
I often need to configure things discretely per Ruby version, and doing so forced me to repeat
|
|
291
|
+
a significant amount of boilerplate code across each project.
|
|
292
|
+
|
|
293
|
+
Thus `VersionGem::Ruby` was born. It has the two optimized methods I always need:
|
|
294
|
+
|
|
295
|
+
```ruby
|
|
296
|
+
engine = "ruby"
|
|
297
|
+
version = "2.7.7"
|
|
298
|
+
gte_minimum_version?(version, engine) # Is the current version of Ruby greater than or equal to some minimum?
|
|
299
|
+
|
|
300
|
+
major = 3
|
|
301
|
+
minor = 2
|
|
302
|
+
actual_minor_version?(major, minor, engine) # Is the current version of Ruby precisely a specific minor version of Ruby?
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
`Version::Ruby` is *not loaded* by default. If you want to use it, you must require it as:
|
|
306
|
+
```ruby
|
|
307
|
+
require "version_gem/ruby"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Normally I do this in my `spec/spec_helper.rb`, and/or `.simplecov` files.
|
|
311
|
+
Occasionally in my `Rakefile`.
|
|
312
|
+
|
|
216
313
|
### Caveat
|
|
217
314
|
|
|
218
315
|
This design keeps your `version.rb` file compatible with the way `gemspec` files use them.
|
|
@@ -223,29 +320,29 @@ The enhancement from this gem is only available at runtime.
|
|
|
223
320
|
|
|
224
321
|
In `spec_helper.rb`:
|
|
225
322
|
```ruby
|
|
226
|
-
require
|
|
323
|
+
require "version_gem/rspec"
|
|
227
324
|
```
|
|
228
325
|
|
|
229
326
|
Then you can write a test like:
|
|
230
327
|
|
|
231
328
|
```ruby
|
|
232
|
-
RSpec.describe
|
|
233
|
-
it_behaves_like
|
|
329
|
+
RSpec.describe(MyLib::Version) do
|
|
330
|
+
it_behaves_like "a Version module", described_class
|
|
234
331
|
end
|
|
235
332
|
|
|
236
333
|
# Or, if you want to write your own, here is the a la carte menu:
|
|
237
|
-
RSpec.describe
|
|
334
|
+
RSpec.describe(MyLib::Version) do
|
|
238
335
|
it "is a Version module" do
|
|
239
336
|
expect(described_class).is_a?(Module)
|
|
240
|
-
expect(described_class).to
|
|
241
|
-
expect(described_class).to
|
|
242
|
-
expect(described_class.to_s).to
|
|
243
|
-
expect(described_class).to
|
|
244
|
-
expect(described_class).to
|
|
245
|
-
expect(described_class).to
|
|
246
|
-
expect(described_class).to
|
|
247
|
-
expect(described_class.to_h.keys).to
|
|
248
|
-
expect(described_class.to_a).to
|
|
337
|
+
expect(described_class).to(have_version_constant)
|
|
338
|
+
expect(described_class).to(have_version_as_string)
|
|
339
|
+
expect(described_class.to_s).to(be_a(String))
|
|
340
|
+
expect(described_class).to(have_major_as_integer)
|
|
341
|
+
expect(described_class).to(have_minor_as_integer)
|
|
342
|
+
expect(described_class).to(have_patch_as_integer)
|
|
343
|
+
expect(described_class).to(have_pre_as_nil_or_string)
|
|
344
|
+
expect(described_class.to_h.keys).to(match_array(%i[major minor patch pre]))
|
|
345
|
+
expect(described_class.to_a).to(be_a(Array))
|
|
249
346
|
end
|
|
250
347
|
end
|
|
251
348
|
```
|
|
@@ -262,7 +359,7 @@ See [CONTRIBUTING.md][contributing]
|
|
|
262
359
|
|
|
263
360
|
## Contributors
|
|
264
361
|
|
|
265
|
-
[]("https://
|
|
362
|
+
[]("https://gitlab.com/oauth-xx/version_gem/-/graphs/main")
|
|
266
363
|
|
|
267
364
|
Made with [contributors-img](https://contrib.rocks).
|
|
268
365
|
|
|
@@ -272,15 +369,15 @@ The gem is available as open source under the terms of
|
|
|
272
369
|
the [MIT License][license] [][license-ref].
|
|
273
370
|
See [LICENSE][license] for the official [Copyright Notice][copyright-notice-explainer].
|
|
274
371
|
|
|
275
|
-
* Copyright (c) 2022 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
|
372
|
+
* Copyright (c) 2022 - 2023 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
|
276
373
|
|
|
277
374
|
## Code of Conduct
|
|
278
375
|
|
|
279
|
-
Everyone interacting in the VersionGem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://
|
|
376
|
+
Everyone interacting in the VersionGem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/oauth-xx/version_gem/-/blob/main/CODE_OF_CONDUCT.md).
|
|
280
377
|
|
|
281
378
|
## Versioning
|
|
282
379
|
|
|
283
|
-
This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations of this scheme should be reported as
|
|
380
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][🧮semver]. Violations of this scheme should be reported as
|
|
284
381
|
bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be
|
|
285
382
|
immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new
|
|
286
383
|
major versions.
|
|
@@ -291,71 +388,39 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
|
|
|
291
388
|
For example:
|
|
292
389
|
|
|
293
390
|
```ruby
|
|
294
|
-
spec.add_dependency
|
|
391
|
+
spec.add_dependency("version_gem", "~> 1.1")
|
|
295
392
|
```
|
|
296
393
|
|
|
297
394
|
## Security
|
|
298
395
|
|
|
299
|
-
See [SECURITY.md](https://
|
|
396
|
+
See [SECURITY.md](https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md).
|
|
300
397
|
|
|
398
|
+
[aboutme]: https://about.me/peter.boling
|
|
399
|
+
[actions]: https://github.com/oauth-xx/version_gem/actions
|
|
400
|
+
[angelme]: https://angel.co/peter-boling
|
|
401
|
+
[blogpage]: http://www.railsbling.com/tags/version_gem/
|
|
402
|
+
[codecov_coverage]: https://codecov.io/gh/oauth-xx/version_gem
|
|
403
|
+
[code_triage]: https://www.codetriage.com/oauth-xx/version_gem
|
|
404
|
+
[chat]: https://gitter.im/oauth-xx/version_gem?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
|
405
|
+
[climate_coverage]: https://codeclimate.com/github/oauth-xx/version_gem/test_coverage
|
|
406
|
+
[climate_maintainability]: https://codeclimate.com/github/oauth-xx/version_gem/maintainability
|
|
301
407
|
[copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
302
|
-
|
|
303
|
-
[
|
|
304
|
-
|
|
305
|
-
[
|
|
306
|
-
|
|
307
|
-
[
|
|
308
|
-
|
|
309
|
-
[
|
|
310
|
-
|
|
311
|
-
[license]: https://github.com/pboling/version_gem/blob/main/LICENSE.txt
|
|
312
|
-
|
|
408
|
+
[conduct]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CODE_OF_CONDUCT.md
|
|
409
|
+
[contributing]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CONTRIBUTING.md
|
|
410
|
+
[devto]: https://dev.to/galtzo
|
|
411
|
+
[documentation]: https://rubydoc.info/github/oauth-xx/version_gem/main
|
|
412
|
+
[followme]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
|
|
413
|
+
[gh_sponsors]: https://github.com/sponsors/pboling
|
|
414
|
+
[issues]: https://github.com/oauth-xx/version_gem/issues
|
|
415
|
+
[liberapay_donate]: https://liberapay.com/pboling/donate
|
|
416
|
+
[license]: LICENSE.txt
|
|
313
417
|
[license-ref]: https://opensource.org/licenses/MIT
|
|
314
|
-
|
|
315
|
-
[
|
|
316
|
-
|
|
418
|
+
[license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
|
419
|
+
[peterboling]: http://www.peterboling.com
|
|
317
420
|
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
|
318
|
-
|
|
319
421
|
[railsbling]: http://www.railsbling.com
|
|
320
|
-
|
|
321
|
-
[peterboling]: http://www.peterboling.com
|
|
322
|
-
|
|
323
|
-
[aboutme]: https://about.me/peter.boling
|
|
324
|
-
|
|
325
|
-
[angelme]: https://angel.co/peter-boling
|
|
326
|
-
|
|
327
|
-
[coderme]:http://coderwall.com/pboling
|
|
328
|
-
|
|
329
|
-
[followme-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
|
|
330
|
-
|
|
331
|
-
[tweetme]: http://twitter.com/galtzo
|
|
332
|
-
|
|
333
|
-
[politicme]: https://nationalprogressiveparty.org
|
|
334
|
-
|
|
335
|
-
[documentation]: https://rubydoc.info/github/pboling/version_gem/main
|
|
336
|
-
|
|
337
|
-
[source]: https://github.com/pboling/version_gem/
|
|
338
|
-
|
|
339
|
-
[actions]: https://github.com/pboling/version_gem/actions
|
|
340
|
-
|
|
341
|
-
[issues]: https://github.com/pboling/version_gem/issues
|
|
342
|
-
|
|
343
|
-
[climate_maintainability]: https://codeclimate.com/github/pboling/version_gem/maintainability
|
|
344
|
-
|
|
345
|
-
[climate_coverage]: https://codeclimate.com/github/pboling/version_gem/test_coverage
|
|
346
|
-
|
|
347
|
-
[codecov_coverage]: https://codecov.io/gh/pboling/version_gem
|
|
348
|
-
|
|
349
|
-
[code_triage]: https://www.codetriage.com/pboling/version_gem
|
|
350
|
-
|
|
351
|
-
[blogpage]: http://www.railsbling.com/tags/version_gem/
|
|
352
|
-
|
|
353
422
|
[rubygems]: https://rubygems.org/gems/version_gem
|
|
354
|
-
|
|
355
|
-
[
|
|
356
|
-
|
|
357
|
-
[
|
|
358
|
-
|
|
359
|
-
[liberapay_donate]: https://liberapay.com/pboling/donate
|
|
360
|
-
|
|
361
|
-
[gh_sponsors]: https://github.com/sponsors/pboling
|
|
423
|
+
[security]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md
|
|
424
|
+
[semver]: http://semver.org/
|
|
425
|
+
[source]: https://gitlab.com/oauth-xx/version_gem
|
|
426
|
+
[tweetme]: http://twitter.com/galtzo
|
data/SECURITY.md
CHANGED
data/lib/version_gem/api.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module VersionGem
|
|
2
|
+
# Public API of this library
|
|
2
3
|
module Api
|
|
3
4
|
# The version number as a string
|
|
4
5
|
#
|
|
@@ -11,39 +12,39 @@ module VersionGem
|
|
|
11
12
|
#
|
|
12
13
|
# @return [Integer]
|
|
13
14
|
def major
|
|
14
|
-
_to_a[0].to_i
|
|
15
|
+
@major ||= _to_a[0].to_i
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
# The minor version
|
|
18
19
|
#
|
|
19
20
|
# @return [Integer]
|
|
20
21
|
def minor
|
|
21
|
-
_to_a[1].to_i
|
|
22
|
+
@minor ||= _to_a[1].to_i
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
# The patch version
|
|
25
26
|
#
|
|
26
27
|
# @return [Integer]
|
|
27
28
|
def patch
|
|
28
|
-
_to_a[2].to_i
|
|
29
|
+
@patch ||= _to_a[2].to_i
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# The pre-release version, if any
|
|
32
33
|
#
|
|
33
34
|
# @return [String, NilClass]
|
|
34
35
|
def pre
|
|
35
|
-
_to_a[3]
|
|
36
|
+
@pre ||= _to_a[3]
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
# The version number as a hash
|
|
39
40
|
#
|
|
40
41
|
# @return [Hash]
|
|
41
42
|
def to_h
|
|
42
|
-
{
|
|
43
|
+
@to_h ||= {
|
|
43
44
|
major: major,
|
|
44
45
|
minor: minor,
|
|
45
46
|
patch: patch,
|
|
46
|
-
pre: pre
|
|
47
|
+
pre: pre,
|
|
47
48
|
}
|
|
48
49
|
end
|
|
49
50
|
|
|
@@ -51,7 +52,7 @@ module VersionGem
|
|
|
51
52
|
#
|
|
52
53
|
# @return [Array<[Integer, String, NilClass]>]
|
|
53
54
|
def to_a
|
|
54
|
-
[major, minor, patch, pre]
|
|
55
|
+
@to_a ||= [major, minor, patch, pre]
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
private
|
|
@@ -60,7 +61,7 @@ module VersionGem
|
|
|
60
61
|
#
|
|
61
62
|
# @return [Array<String>]
|
|
62
63
|
def _to_a
|
|
63
|
-
self::VERSION.split(
|
|
64
|
+
@_to_a = self::VERSION.split(".")
|
|
64
65
|
end
|
|
65
66
|
end
|
|
66
67
|
end
|
data/lib/version_gem/basic.rb
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
4
|
-
require_relative
|
|
3
|
+
require_relative "error"
|
|
4
|
+
require_relative "api"
|
|
5
5
|
|
|
6
6
|
module VersionGem
|
|
7
7
|
# This is a very *basic* version parser. Others could be built based on this pattern!
|
|
8
8
|
module Basic
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
class << self
|
|
10
|
+
def extended(base)
|
|
11
|
+
raise Error, "VERSION must be defined before 'extend #{name}'" unless defined?(base::VERSION)
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
base.extend(Api)
|
|
14
|
+
end
|
|
13
15
|
end
|
|
14
16
|
end
|
|
15
17
|
end
|
data/lib/version_gem/rspec.rb
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
RSpec::Matchers.define
|
|
3
|
+
RSpec::Matchers.define(:have_version_constant) do
|
|
4
4
|
match do |version_mod|
|
|
5
5
|
version_mod.const_defined?(:VERSION, false)
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
RSpec::Matchers.define
|
|
9
|
+
RSpec::Matchers.define(:have_version_as_string) do
|
|
10
10
|
match do |version_mod|
|
|
11
11
|
!version_mod::VERSION.nil? && version_mod::VERSION.is_a?(String)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
RSpec::Matchers.define
|
|
15
|
+
RSpec::Matchers.define(:have_major_as_integer) do
|
|
16
16
|
match do |version_mod|
|
|
17
17
|
version_mod.major.is_a?(Integer)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
RSpec::Matchers.define
|
|
21
|
+
RSpec::Matchers.define(:have_minor_as_integer) do
|
|
22
22
|
match do |version_mod|
|
|
23
23
|
version_mod.minor.is_a?(Integer)
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
RSpec::Matchers.define
|
|
27
|
+
RSpec::Matchers.define(:have_patch_as_integer) do
|
|
28
28
|
match do |version_mod|
|
|
29
29
|
version_mod.patch.is_a?(Integer)
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
RSpec::Matchers.define
|
|
33
|
+
RSpec::Matchers.define(:have_pre_as_nil_or_string) do
|
|
34
34
|
match do |version_mod|
|
|
35
35
|
version_mod.pre.nil? || version_mod.pre.is_a?(String)
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
RSpec.shared_examples_for
|
|
40
|
-
it
|
|
41
|
-
aggregate_failures
|
|
39
|
+
RSpec.shared_examples_for("a Version module") do |version_mod|
|
|
40
|
+
it "is introspectable" do
|
|
41
|
+
aggregate_failures "introspectable api" do
|
|
42
42
|
expect(version_mod).is_a?(Module)
|
|
43
|
-
expect(version_mod).to
|
|
44
|
-
expect(version_mod).to
|
|
45
|
-
expect(version_mod.to_s).to
|
|
46
|
-
expect(version_mod).to
|
|
47
|
-
expect(version_mod).to
|
|
48
|
-
expect(version_mod).to
|
|
49
|
-
expect(version_mod).to
|
|
50
|
-
expect(version_mod.to_h.keys).to
|
|
51
|
-
expect(version_mod.to_a).to
|
|
43
|
+
expect(version_mod).to(have_version_constant)
|
|
44
|
+
expect(version_mod).to(have_version_as_string)
|
|
45
|
+
expect(version_mod.to_s).to(be_a(String))
|
|
46
|
+
expect(version_mod).to(have_major_as_integer)
|
|
47
|
+
expect(version_mod).to(have_minor_as_integer)
|
|
48
|
+
expect(version_mod).to(have_patch_as_integer)
|
|
49
|
+
expect(version_mod).to(have_pre_as_nil_or_string)
|
|
50
|
+
expect(version_mod.to_h.keys).to(match_array(%i[major minor patch pre]))
|
|
51
|
+
expect(version_mod.to_a).to(be_a(Array))
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module VersionGem
|
|
2
|
+
# Helpers for library CI integration against many different versions of Ruby
|
|
3
|
+
module Ruby
|
|
4
|
+
RUBY_VER = ::Gem::Version.new(RUBY_VERSION)
|
|
5
|
+
|
|
6
|
+
def gte_minimum_version?(version, engine = "ruby")
|
|
7
|
+
RUBY_VER >= ::Gem::Version.new(version) && ::RUBY_ENGINE == engine
|
|
8
|
+
end
|
|
9
|
+
module_function :gte_minimum_version?
|
|
10
|
+
|
|
11
|
+
def actual_minor_version?(major, minor, engine = "ruby")
|
|
12
|
+
major.to_i == RUBY_VER.segments[0] &&
|
|
13
|
+
minor.to_i == RUBY_VER.segments[1] &&
|
|
14
|
+
::RUBY_ENGINE == engine
|
|
15
|
+
end
|
|
16
|
+
module_function :actual_minor_version?
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/version_gem/version.rb
CHANGED
data/lib/version_gem.rb
CHANGED
data.tar.gz.sig
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,108 +1,103 @@
|
|
|
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.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Boling
|
|
8
|
-
autorequire:
|
|
9
|
-
bindir:
|
|
10
|
-
cert_chain:
|
|
11
|
-
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain:
|
|
11
|
+
- |
|
|
12
|
+
-----BEGIN CERTIFICATE-----
|
|
13
|
+
MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
|
|
14
|
+
ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
|
|
15
|
+
A2NvbTAeFw0yMzA5MjAxNzMwMjhaFw0yNDA5MTkxNzMwMjhaMEMxFTATBgNVBAMM
|
|
16
|
+
DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
|
|
17
|
+
LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA+a9UvHo3
|
|
18
|
+
84k96WgU5Kk5HB+cLZs/modjorsTfqY67MJF5nNvAoqcKTUBW4uG+Zpfnm3jaDO5
|
|
19
|
+
GxhJEIZWfndYzycHT2KMVQ1uTP82ba8ZaKrPlPIafkbui3mdds47qsmqHiblKERg
|
|
20
|
+
U532lkwfqHDlJwE7OBZQ59EwWWLynlT/yAUHpOBbqIuHKUxdpmBI+sIjrZcD1e05
|
|
21
|
+
WmjkO6fwIdC5oM757aoPxIgXD587VOViH11Vkm2doskj4T8yONtwVHlcrrhJ9Bzd
|
|
22
|
+
/zdp6vEn7GZQrABvpOlqwWxQ72ZnFhJe/RJZf6CXOPOh69Ai0QKYl2a1sYuCJKS3
|
|
23
|
+
nsBnxXJINEEznjR7rZjNUmYD+CZqfjzgPqedRxTlASe7iA4w7xZOqMDzcuhNwcUQ
|
|
24
|
+
tMEH6BTktxKP3jXZPXRfHCf6s+HRVb6vezAonTBVyydf5Xp5VwWkd6cwm+2BzHl5
|
|
25
|
+
7kc/3lLxKMcsyEUprAsk8LdHohwZdC267l+RS++AP6Cz6x+nB3oGob19AgMBAAGj
|
|
26
|
+
fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQCSSas60GqqMjt
|
|
27
|
+
xR7LoY1gucEvtzAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
|
|
28
|
+
A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
|
|
29
|
+
ggGBAMl9ifcw5p+PdvB7dCPoNKoVdp/2LbC9ztETHuYL2gUMJB6UoS3o9c/piSuR
|
|
30
|
+
V3ZMQaijmNu6ms1bWAtJ66LjmYrVflJtf9yp31Kierr9LpisMSUx2qbMOHGa8d2Z
|
|
31
|
+
vCUWPF8E9Cg0mP3GAyZ6qql8jDh/anUKeksPXqJvNxNPDu2DVYsa/IWdl96whzS4
|
|
32
|
+
Bl7SwB1E7agps40UcshCSKaVDOU0M+XN6SrnJMElnBic+KSAkBkVFbzS0BE4ODZM
|
|
33
|
+
BgE6nYzQ05qhuvbE+oGdACTlemNtDDWCh0uw+7x0q2PocGIDU5zsPn/WNTkCXPmB
|
|
34
|
+
CHGvqDNWq4M7ncTKAaS2XExgyb7uPdq9fKiOW8nmH+zCiGzJXzBWwZlKf7L4Ht9E
|
|
35
|
+
a3f0e5C+zvee9Z5Ng9ciyfav9/fcXgYt5MjoBv27THr5XfBhgOCIHSYW2tqJmWKi
|
|
36
|
+
KuxrfYrN+9HvMdm+nZ6TypmKftHY3Gj+/uu+g8Icm/zrvTWAEE0mcJOkfrIoNPJb
|
|
37
|
+
pF8dMA==
|
|
38
|
+
-----END CERTIFICATE-----
|
|
39
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
|
12
40
|
dependencies:
|
|
13
41
|
- !ruby/object:Gem::Dependency
|
|
14
42
|
name: rspec
|
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
|
16
44
|
requirements:
|
|
17
|
-
- - "
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: pry
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '3.12'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
54
|
+
version: '3.12'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: rspec-block_is_expected
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
62
|
-
- - ">="
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: 8.0.2
|
|
61
|
+
version: '1.0'
|
|
65
62
|
type: :development
|
|
66
63
|
prerelease: false
|
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
68
65
|
requirements:
|
|
69
66
|
- - "~>"
|
|
70
67
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: '
|
|
72
|
-
- - ">="
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: 8.0.2
|
|
68
|
+
version: '1.0'
|
|
75
69
|
- !ruby/object:Gem::Dependency
|
|
76
|
-
name:
|
|
70
|
+
name: rake
|
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
|
78
72
|
requirements:
|
|
79
|
-
- - "
|
|
73
|
+
- - "~>"
|
|
80
74
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '0'
|
|
75
|
+
version: '13.0'
|
|
82
76
|
type: :development
|
|
83
77
|
prerelease: false
|
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
79
|
requirements:
|
|
86
|
-
- - "
|
|
80
|
+
- - "~>"
|
|
87
81
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '0'
|
|
82
|
+
version: '13.0'
|
|
89
83
|
- !ruby/object:Gem::Dependency
|
|
90
|
-
name:
|
|
84
|
+
name: pry
|
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
|
92
86
|
requirements:
|
|
93
|
-
- - "
|
|
87
|
+
- - "~>"
|
|
94
88
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '0'
|
|
89
|
+
version: '0.14'
|
|
96
90
|
type: :development
|
|
97
91
|
prerelease: false
|
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
93
|
requirements:
|
|
100
|
-
- - "
|
|
94
|
+
- - "~>"
|
|
101
95
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '0'
|
|
96
|
+
version: '0.14'
|
|
103
97
|
description: Versions are good. Versions are cool. Versions will win.
|
|
104
98
|
email:
|
|
105
99
|
- peter.boling@gmail.com
|
|
100
|
+
- oauth-ruby@googlegroups.com
|
|
106
101
|
executables: []
|
|
107
102
|
extensions: []
|
|
108
103
|
extra_rdoc_files: []
|
|
@@ -118,20 +113,22 @@ files:
|
|
|
118
113
|
- lib/version_gem/basic.rb
|
|
119
114
|
- lib/version_gem/error.rb
|
|
120
115
|
- lib/version_gem/rspec.rb
|
|
116
|
+
- lib/version_gem/ruby.rb
|
|
121
117
|
- lib/version_gem/version.rb
|
|
122
|
-
|
|
123
|
-
homepage: https://github.com/pboling/version_gem
|
|
118
|
+
homepage: https://gitlab.com/oauth-xx/version_gem
|
|
124
119
|
licenses:
|
|
125
120
|
- MIT
|
|
126
121
|
metadata:
|
|
127
|
-
homepage_uri: https://
|
|
128
|
-
source_code_uri: https://
|
|
129
|
-
changelog_uri: https://
|
|
130
|
-
bug_tracker_uri: https://
|
|
131
|
-
documentation_uri: https://www.rubydoc.info/gems/version_gem/1.1.
|
|
132
|
-
wiki_uri: https://
|
|
122
|
+
homepage_uri: https://gitlab.com/oauth-xx/version_gem
|
|
123
|
+
source_code_uri: https://gitlab.com/oauth-xx/version_gem/-/tree/v1.1.4
|
|
124
|
+
changelog_uri: https://gitlab.com/oauth-xx/version_gem/-/blob/v1.1.4/CHANGELOG.md
|
|
125
|
+
bug_tracker_uri: https://gitlab.com/oauth-xx/version_gem/-/issues
|
|
126
|
+
documentation_uri: https://www.rubydoc.info/gems/version_gem/1.1.4
|
|
127
|
+
wiki_uri: https://gitlab.com/oauth-xx/version_gem/-/wiki
|
|
128
|
+
mailing_list_uri: https://groups.google.com/g/oauth-ruby
|
|
129
|
+
funding_uri: https://liberapay.com/pboling
|
|
133
130
|
rubygems_mfa_required: 'true'
|
|
134
|
-
post_install_message:
|
|
131
|
+
post_install_message:
|
|
135
132
|
rdoc_options: []
|
|
136
133
|
require_paths:
|
|
137
134
|
- lib
|
|
@@ -146,8 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
146
143
|
- !ruby/object:Gem::Version
|
|
147
144
|
version: '0'
|
|
148
145
|
requirements: []
|
|
149
|
-
rubygems_version: 3.
|
|
150
|
-
signing_key:
|
|
146
|
+
rubygems_version: 3.5.6
|
|
147
|
+
signing_key:
|
|
151
148
|
specification_version: 4
|
|
152
149
|
summary: Enhance your VERSION! Sugar for Version modules.
|
|
153
150
|
test_files: []
|
metadata.gz.sig
ADDED
|
Binary file
|
data/sig/version_gem.rbs
DELETED