version_gem 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +44 -21
- data/CONTRIBUTING.md +27 -12
- data/LICENSE.txt +1 -1
- data/README.md +86 -66
- data/SECURITY.md +3 -3
- data/lib/version_gem/api.rb +7 -7
- data/lib/version_gem/ruby.rb +18 -0
- data/lib/version_gem/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +58 -13
- 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: f2a6a1430cecd3c606bb156d42509955cc88b81afc05c33709bd1c482d35a352
|
4
|
+
data.tar.gz: f831c27f2fac9f8265dbe62dd8a223baafb1272e5ebe5e55bde7cb133e4196b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '07860ba32ebcbaa03662bcdfbef3cb11e77b46d7d9b9bc6fc295bc24b304edcc9ec635de631fd4d7e018cd6d4dc9ddc7b56af9316453a4e0968f4473dec1be5f'
|
7
|
+
data.tar.gz: f4956055f1366e0e882610fe1e1abbc841ed0fee4c5b62e262330073256bba627f6634a542aa4d55c5e7dd74b2803693e2590f3ff1e156bb880cafdc8f7b82cc
|
checksums.yaml.gz.sig
ADDED
Binary file
|
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,59 @@ 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
|
11
|
-
|
12
10
|
### Fixed
|
13
|
-
|
14
11
|
### Removed
|
15
12
|
|
16
|
-
## [1.1.
|
13
|
+
## [1.1.2] - 2023-03-17 ([tag][1.1.2t])
|
14
|
+
### Added
|
15
|
+
- `VersionGem::Ruby` to help library CI integration against many different versions of Ruby (@pboling)
|
16
|
+
- Experimental, optional, require (not loaded by default, which is why this can be in a patch)
|
17
|
+
- Spec coverage is now 100%, lines and branches, including the fabled `version.rb` (@pboling)
|
18
|
+
- Full RBS Signatures (@pboling)
|
19
|
+
|
20
|
+
## [1.1.1] - 2022-09-19 ([tag][1.1.1t])
|
21
|
+
### Added
|
22
|
+
- Alternatives section to README.md (@pboling)
|
23
|
+
- Signing cert for gem releases (@pboling)
|
24
|
+
- Mailing List and other metadata URIs (@pboling)
|
25
|
+
- Checksums for released gems (@pboling)
|
26
|
+
### Changed
|
27
|
+
- SECURITY.md policy (@pboling)
|
28
|
+
- Version methods are now memoized (||=) on initial call for performance (@pboling)
|
29
|
+
- Gem releases are now cryptographically signed (@pboling)
|
30
|
+
|
31
|
+
## [1.1.0] - 2022-06-24 ([tag][1.1.0t])
|
17
32
|
### Fixed
|
18
|
-
- to_a uses same type casting as major, minor, patch, and pre
|
33
|
+
- to_a uses same type casting as major, minor, patch, and pre (@pboling)
|
19
34
|
### Added
|
20
|
-
- RSpec Matchers and Shared Example
|
35
|
+
- RSpec Matchers and Shared Example (@pboling)
|
21
36
|
|
22
|
-
## [1.0.2] - 2022-06-23
|
37
|
+
## [1.0.2] - 2022-06-23 ([tag][1.0.2t])
|
23
38
|
### Added
|
24
|
-
- Delay loading of library code until after code coverage tool is loaded
|
39
|
+
- Delay loading of library code until after code coverage tool is loaded (@pboling)
|
25
40
|
|
26
|
-
## [1.0.1] - 2022-06-23
|
41
|
+
## [1.0.1] - 2022-06-23 ([tag][1.0.1t])
|
27
42
|
### Added
|
28
|
-
- CI Build improvements
|
29
|
-
- Code coverage reporting
|
30
|
-
- Documentation improvements
|
31
|
-
- Badges!
|
43
|
+
- CI Build improvements (@pboling)
|
44
|
+
- Code coverage reporting (@pboling)
|
45
|
+
- Documentation improvements (@pboling)
|
46
|
+
- Badges! (@pboling)
|
32
47
|
|
33
|
-
## [1.0.0] - 2022-06-21
|
48
|
+
## [1.0.0] - 2022-06-21 ([tag][1.0.0t])
|
34
49
|
### Added
|
35
|
-
- Initial release, with basic version parsing API
|
50
|
+
- Initial release, with basic version parsing API (@pboling)
|
36
51
|
|
37
|
-
[Unreleased]: https://
|
38
|
-
[1.1.
|
39
|
-
[1.
|
40
|
-
[1.
|
41
|
-
[1.
|
52
|
+
[Unreleased]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.2...HEAD
|
53
|
+
[1.1.2]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.1...v1.1.2
|
54
|
+
[1.1.2t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.2
|
55
|
+
[1.1.1]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.1.0...v1.1.1
|
56
|
+
[1.1.1t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.1
|
57
|
+
[1.1.0]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.2...v1.1.0
|
58
|
+
[1.1.0t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.1.0
|
59
|
+
[1.0.2]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.1...v1.0.2
|
60
|
+
[1.0.2t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.2
|
61
|
+
[1.0.1]: https://gitlab.com/oauth-xx/version_gem/-/compare/v1.0.0...v1.0.1
|
62
|
+
[1.0.1t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.1
|
63
|
+
[1.0.0]: https://gitlab.com/oauth-xx/version_gem/-/compare/a3055964517c159bf214712940982034b75264be...v1.0.0
|
64
|
+
[1.0.0t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v1.0.0
|
data/CONTRIBUTING.md
CHANGED
@@ -1,25 +1,40 @@
|
|
1
1
|
## Contributing
|
2
2
|
|
3
|
-
Bug reports and pull requests are welcome on
|
3
|
+
Bug reports and pull requests are welcome on GitLab 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
5
|
the [code of conduct][conduct].
|
6
6
|
|
7
|
-
To submit a patch, please fork the project and create a patch with
|
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].
|
8
10
|
|
9
|
-
##
|
10
|
-
|
11
|
-
[![Contributors](https://contrib.rocks/image?repo=pboling/version_gem)][contributors]
|
11
|
+
## Release
|
12
12
|
|
13
|
-
|
13
|
+
To release a new version:
|
14
14
|
|
15
|
-
|
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 `bundle exec rake build:checksum`
|
18
|
+
4. move the built gem to project root
|
19
|
+
5. run `bin/checksum` to create the missing SHA256 checksum
|
20
|
+
6. move the built gem back to `pkg/`
|
21
|
+
7. commit the changes
|
22
|
+
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].
|
16
23
|
|
17
|
-
|
24
|
+
NOTE: You will need to have a public key in `certs/`, and list your cert in the
|
25
|
+
`gemspec`, in order to sign the new release.
|
26
|
+
See: [RubyGems Security Guide][rubygems-security-guide]
|
18
27
|
|
19
|
-
|
28
|
+
## Contributors
|
20
29
|
|
21
|
-
|
30
|
+
See: [https://gitlab.com/oauth-xx/version_gem/-/graphs/main][🚎contributors]
|
22
31
|
|
23
|
-
[comment]: <> (Following links are used by README, CONTRIBUTING
|
32
|
+
[comment]: <> (Following links are used by README, CONTRIBUTING)
|
24
33
|
|
25
|
-
[
|
34
|
+
[conduct]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CODE_OF_CONDUCT.md
|
35
|
+
[🚎contributors]: https://gitlab.com/oauth-xx/version_gem/-/graphs/main
|
36
|
+
[⛳mail-list]: http://groups.google.com/group/oauth-ruby
|
37
|
+
[🚎src-main]: https://gitlab.com/oauth-xx/version_gem
|
38
|
+
[🏘chat]: https://gitter.im/oauth-xx/version_gem
|
39
|
+
[rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
40
|
+
[rubygems]: https://rubygems.org
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,21 @@
|
|
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
|
+
## Still here?
|
17
|
+
|
18
|
+
Give your next library an introspectable `Version` module without breaking your Gemspec.
|
4
19
|
|
5
20
|
```ruby
|
6
21
|
MyLib::Version.to_s # => "1.2.3.rc3"
|
@@ -12,7 +27,7 @@ MyLib::Version.to_a # => [1, 2, 3, "rc3"]
|
|
12
27
|
MyLib::Version.to_h # => { major: 1, minor: 2, patch: 3, pre: "rc3" }
|
13
28
|
```
|
14
29
|
|
15
|
-
This library was extracted from the gem [`oauth2`](https://
|
30
|
+
This library was extracted from the gem [`oauth2`](https://gitlab.com/oauth-xx/oauth2).
|
16
31
|
|
17
32
|
This gem has no runtime dependencies.
|
18
33
|
|
@@ -40,17 +55,17 @@ badge #s:
|
|
40
55
|
📗
|
41
56
|
|
42
57
|
appended indicators:
|
43
|
-
♻️ - URL needs to be updated from
|
58
|
+
♻️ - URL needs to be updated from SAAS integration. Find / Replace is insufficient.
|
44
59
|
-->
|
45
60
|
|
46
|
-
| | Project | bundle add version_gem
|
61
|
+
| | Project | bundle add version_gem |
|
47
62
|
|:----|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
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-
|
63
|
+
| 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] |
|
64
|
+
| 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] <!--[![Next Version][📗next-img]][📗next]--> |
|
50
65
|
| 3️⃣ | maintanence & 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] |
|
51
|
-
| 4️⃣ | testing | [![
|
66
|
+
| 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]--> |
|
52
67
|
| 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 | [![
|
68
|
+
| 6️⃣ | resources | [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Wiki][🖐wiki-img]][🖐wiki] |
|
54
69
|
| 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme] |
|
55
70
|
|
56
71
|
<!--
|
@@ -62,8 +77,9 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
62
77
|
[⛳️name-img]: https://img.shields.io/badge/name-version_gem-brightgreen.svg?style=flat
|
63
78
|
[🖇src-license]: https://opensource.org/licenses/MIT
|
64
79
|
[🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
65
|
-
[🚎yard]: https://www.rubydoc.info/
|
80
|
+
[🚎yard]: https://www.rubydoc.info/gems/version_gem
|
66
81
|
[🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
|
82
|
+
[🧮semver]: http://semver.org/
|
67
83
|
[🧮semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
|
68
84
|
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
69
85
|
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
@@ -72,14 +88,12 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
72
88
|
[⛳️version-img]: http://img.shields.io/gem/v/version_gem.svg
|
73
89
|
[🖇DL-total-img]: https://img.shields.io/gem/dt/version_gem.svg
|
74
90
|
[🏘DL-rank-img]: https://img.shields.io/gem/rt/version_gem.svg
|
75
|
-
[🚎src-
|
76
|
-
[🚎src-
|
77
|
-
[🖐prs-o]: https://
|
91
|
+
[🚎src-main]: https://gitlab.com/oauth-xx/version_gem
|
92
|
+
[🚎src-main-img]: https://img.shields.io/badge/source-gitlab-brightgreen.svg?style=flat
|
93
|
+
[🖐prs-o]: https://gitlab.com/oauth-xx/version_gem/-/merge_requests
|
78
94
|
[🖐prs-o-img]: https://img.shields.io/github/issues-pr/pboling/version_gem
|
79
95
|
[🧮prs-c]: https://github.com/pboling/version_gem/pulls?q=is%3Apr+is%3Aclosed
|
80
96
|
[🧮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
97
|
|
84
98
|
<!-- 3️⃣ maintanence & linting -->
|
85
99
|
[⛳cclim-maint]: https://codeclimate.com/github/pboling/version_gem/maintainability
|
@@ -88,28 +102,24 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
88
102
|
[🖇triage-help-img]: https://www.codetriage.com/pboling/version_gem/badges/users.svg
|
89
103
|
[🏘depfu♻️]: https://depfu.com/github/pboling/version_gem?project_id=35803
|
90
104
|
[🏘depfu-img♻️]: https://badges.depfu.com/badges/5d8943de6cfdf1ee048ad6d907f3e35b/count.svg
|
91
|
-
[🚎contributors]: https://
|
105
|
+
[🚎contributors]: https://gitlab.com/oauth-xx/version_gem/-/graphs/main
|
92
106
|
[🚎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/
|
107
|
+
[🖐style-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/style.yml
|
108
|
+
[🖐style-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/style.yml/badge.svg
|
95
109
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
96
110
|
[🧮kloc-img]: https://img.shields.io/tokei/lines/github.com/pboling/version_gem
|
97
111
|
|
98
112
|
<!-- 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
|
113
|
+
[🏘sup-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/supported.yml
|
114
|
+
[🏘sup-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/supported.yml/badge.svg
|
115
|
+
[🚎heads-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/heads.yml
|
116
|
+
[🚎heads-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/heads.yml/badge.svg
|
117
|
+
[🖐uns-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml
|
118
|
+
[🖐uns-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/unsupported.yml/badge.svg
|
119
|
+
[🧮mac-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/macos.yml
|
120
|
+
[🧮mac-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/macos.yml/badge.svg
|
121
|
+
[📗win-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/windows.yml
|
122
|
+
[📗win-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/windows.yml/badge.svg
|
113
123
|
|
114
124
|
<!-- 5️⃣ coverage & security -->
|
115
125
|
[⛳cclim-cov]: https://codeclimate.com/github/pboling/version_gem/test_coverage
|
@@ -118,23 +128,21 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
118
128
|
[🖇codecov]: https://codecov.io/gh/pboling/version_gem
|
119
129
|
[🏘coveralls]: https://coveralls.io/github/pboling/version_gem?branch=main
|
120
130
|
[🏘coveralls-img]: https://coveralls.io/repos/github/pboling/version_gem/badge.svg?branch=main
|
121
|
-
[🚎sec-pol]: https://
|
131
|
+
[🚎sec-pol]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md
|
122
132
|
[🚎sec-pol-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
|
123
133
|
[🖐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/
|
134
|
+
[🖐codeQL-img]: https://github.com/oauth-xx/version_gem/actions/workflows/codeql-analysis.yml/badge.svg
|
135
|
+
[🧮cov-wf]: https://github.com/oauth-xx/version_gem/actions/workflows/coverage.yml
|
136
|
+
[🧮cov-wf-img]: https://github.com/oauth-xx/version_gem/actions/workflows/coverage.yml/badge.svg
|
127
137
|
|
128
138
|
<!-- 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
139
|
[🖇codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
|
132
140
|
[🖇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/
|
141
|
+
[🏘chat]: https://gitter.im/oauth-xx/version_gem
|
142
|
+
[🏘chat-img]: https://img.shields.io/gitter/room/oauth-xx/version_gem.svg
|
135
143
|
[🚎blog]: http://www.railsbling.com/tags/version_gem/
|
136
144
|
[🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
|
137
|
-
[🖐wiki]: https://
|
145
|
+
[🖐wiki]: https://gitlab.com/oauth-xx/version_gem/-/wikis/home
|
138
146
|
[🖐wiki-img]: https://img.shields.io/badge/wiki-examples-brightgreen.svg?style=flat
|
139
147
|
|
140
148
|
<!-- 7️⃣ spread 💖 -->
|
@@ -213,6 +221,32 @@ MyLib::Version.to_h # => { major: 0, minor: 1, patch: 0, pre: "" }
|
|
213
221
|
|
214
222
|
Your `version.rb` file now abides the Ruby convention of directory / path matching the namespace / class!
|
215
223
|
|
224
|
+
#### Query Ruby Version (as of version 1.2.0)
|
225
|
+
|
226
|
+
In Continuous Integration environments for libraries that run against many versions of Ruby,
|
227
|
+
I often need to configure things discretely per Ruby version, and doing so forced me to repeat
|
228
|
+
a significant amount of boilerplate code across each project.
|
229
|
+
|
230
|
+
Thus `VersionGem::Ruby` was born. It has the two optimized methods I always need:
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
engine = 'ruby'
|
234
|
+
version = "2.7.7"
|
235
|
+
gte_minimum_version?(version, engine) # Is the current version of Ruby greater than or equal to some minimum?
|
236
|
+
|
237
|
+
major = 3
|
238
|
+
minor = 2
|
239
|
+
actual_minor_version?(major, minor, engine) # Is the current version of Ruby precisely a specific minor version of Ruby?
|
240
|
+
```
|
241
|
+
|
242
|
+
`Version::Ruby` is *not loaded* by default. If you want to use it, you must require it as:
|
243
|
+
```ruby
|
244
|
+
require "version_gem/ruby"
|
245
|
+
```
|
246
|
+
|
247
|
+
Normally I do this in my `spec/spec_helper.rb`, and/or `.simplecov` files.
|
248
|
+
Occasionally in my `Rakefile`.
|
249
|
+
|
216
250
|
### Caveat
|
217
251
|
|
218
252
|
This design keeps your `version.rb` file compatible with the way `gemspec` files use them.
|
@@ -262,7 +296,7 @@ See [CONTRIBUTING.md][contributing]
|
|
262
296
|
|
263
297
|
## Contributors
|
264
298
|
|
265
|
-
[![Contributors](https://contrib.rocks/image?repo=pboling/version_gem)]("https://
|
299
|
+
[![Contributors](https://contrib.rocks/image?repo=pboling/version_gem)]("https://gitlab.com/oauth-xx/version_gem/-/graphs/main")
|
266
300
|
|
267
301
|
Made with [contributors-img](https://contrib.rocks).
|
268
302
|
|
@@ -272,15 +306,15 @@ The gem is available as open source under the terms of
|
|
272
306
|
the [MIT License][license] [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][license-ref].
|
273
307
|
See [LICENSE][license] for the official [Copyright Notice][copyright-notice-explainer].
|
274
308
|
|
275
|
-
* Copyright (c) 2022 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
309
|
+
* Copyright (c) 2022 - 2023 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
276
310
|
|
277
311
|
## Code of Conduct
|
278
312
|
|
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://
|
313
|
+
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
314
|
|
281
315
|
## Versioning
|
282
316
|
|
283
|
-
This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations of this scheme should be reported as
|
317
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][🧮semver]. Violations of this scheme should be reported as
|
284
318
|
bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be
|
285
319
|
immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new
|
286
320
|
major versions.
|
@@ -296,30 +330,22 @@ spec.add_dependency "version_gem", "~> 1.1"
|
|
296
330
|
|
297
331
|
## Security
|
298
332
|
|
299
|
-
See [SECURITY.md](https://
|
333
|
+
See [SECURITY.md](https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md).
|
300
334
|
|
301
335
|
[copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
302
336
|
|
303
|
-
[
|
337
|
+
[conduct]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CODE_OF_CONDUCT.md
|
304
338
|
|
305
|
-
[
|
339
|
+
[contributing]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/CONTRIBUTING.md
|
306
340
|
|
307
|
-
[
|
341
|
+
[security]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/SECURITY.md
|
308
342
|
|
309
|
-
[
|
310
|
-
|
311
|
-
[license]: https://github.com/pboling/version_gem/blob/main/LICENSE.txt
|
343
|
+
[license]: https://gitlab.com/oauth-xx/version_gem/-/blob/main/LICENSE.txt
|
312
344
|
|
313
345
|
[license-ref]: https://opensource.org/licenses/MIT
|
314
346
|
|
315
|
-
[semver]: http://semver.org/
|
316
|
-
|
317
347
|
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
318
348
|
|
319
|
-
[railsbling]: http://www.railsbling.com
|
320
|
-
|
321
|
-
[peterboling]: http://www.peterboling.com
|
322
|
-
|
323
349
|
[aboutme]: https://about.me/peter.boling
|
324
350
|
|
325
351
|
[angelme]: https://angel.co/peter-boling
|
@@ -330,15 +356,11 @@ See [SECURITY.md](https://github.com/pboling/version_gem/blob/main/SECURITY.md).
|
|
330
356
|
|
331
357
|
[tweetme]: http://twitter.com/galtzo
|
332
358
|
|
333
|
-
[
|
359
|
+
[source]: https://gitlab.com/oauth-xx/version_gem/
|
334
360
|
|
335
|
-
[
|
361
|
+
[actions]: https://github.com/oauth-xx/version_gem/actions
|
336
362
|
|
337
|
-
[
|
338
|
-
|
339
|
-
[actions]: https://github.com/pboling/version_gem/actions
|
340
|
-
|
341
|
-
[issues]: https://github.com/pboling/version_gem/issues
|
363
|
+
[issues]: https://gitlab.com/oauth-xx/version_gem/-/issues
|
342
364
|
|
343
365
|
[climate_maintainability]: https://codeclimate.com/github/pboling/version_gem/maintainability
|
344
366
|
|
@@ -352,8 +374,6 @@ See [SECURITY.md](https://github.com/pboling/version_gem/blob/main/SECURITY.md).
|
|
352
374
|
|
353
375
|
[rubygems]: https://rubygems.org/gems/version_gem
|
354
376
|
|
355
|
-
[chat]: https://gitter.im/pboling/version_gem?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
356
|
-
|
357
377
|
[maintenancee_policy]: https://guides.rubyonrails.org/maintenance_policy.html#security-issues
|
358
378
|
|
359
379
|
[liberapay_donate]: https://liberapay.com/pboling/donate
|
data/SECURITY.md
CHANGED
data/lib/version_gem/api.rb
CHANGED
@@ -11,35 +11,35 @@ module VersionGem
|
|
11
11
|
#
|
12
12
|
# @return [Integer]
|
13
13
|
def major
|
14
|
-
_to_a[0].to_i
|
14
|
+
@major ||= _to_a[0].to_i
|
15
15
|
end
|
16
16
|
|
17
17
|
# The minor version
|
18
18
|
#
|
19
19
|
# @return [Integer]
|
20
20
|
def minor
|
21
|
-
_to_a[1].to_i
|
21
|
+
@minor ||= _to_a[1].to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
# The patch version
|
25
25
|
#
|
26
26
|
# @return [Integer]
|
27
27
|
def patch
|
28
|
-
_to_a[2].to_i
|
28
|
+
@patch ||= _to_a[2].to_i
|
29
29
|
end
|
30
30
|
|
31
31
|
# The pre-release version, if any
|
32
32
|
#
|
33
33
|
# @return [String, NilClass]
|
34
34
|
def pre
|
35
|
-
_to_a[3]
|
35
|
+
@pre ||= _to_a[3]
|
36
36
|
end
|
37
37
|
|
38
38
|
# The version number as a hash
|
39
39
|
#
|
40
40
|
# @return [Hash]
|
41
41
|
def to_h
|
42
|
-
{
|
42
|
+
@to_h ||= {
|
43
43
|
major: major,
|
44
44
|
minor: minor,
|
45
45
|
patch: patch,
|
@@ -51,7 +51,7 @@ module VersionGem
|
|
51
51
|
#
|
52
52
|
# @return [Array<[Integer, String, NilClass]>]
|
53
53
|
def to_a
|
54
|
-
[major, minor, patch, pre]
|
54
|
+
@to_a ||= [major, minor, patch, pre]
|
55
55
|
end
|
56
56
|
|
57
57
|
private
|
@@ -60,7 +60,7 @@ module VersionGem
|
|
60
60
|
#
|
61
61
|
# @return [Array<String>]
|
62
62
|
def _to_a
|
63
|
-
self::VERSION.split('.')
|
63
|
+
@_to_a = self::VERSION.split('.')
|
64
64
|
end
|
65
65
|
end
|
66
66
|
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.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,42 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
10
|
-
cert_chain:
|
11
|
-
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
|
14
|
+
ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
|
15
|
+
A2NvbTAeFw0yMjA5MTgyMzEyMzBaFw0yMzA5MTgyMzEyMzBaMEMxFTATBgNVBAMM
|
16
|
+
DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
|
17
|
+
LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA2Dn1GM3W
|
18
|
+
8K2/rvN1zz+06bQMcxD16ZKTihVwi7Pb1v3T98rM4Omnxohm3s+CwpDWGeiB9pj6
|
19
|
+
0I/CTce0e4e3s8GKJSOrg93veImPSoH2PfsMsRsuB8wtqyiOCjLbF5o6S29x87r0
|
20
|
+
LA5EawH+Lh4xqrkkPjdffsmLk7TaCig/vlmNvnzxXKBdey/X/aEJZXzzBiWRfVdh
|
21
|
+
O1fmMbVKyieGv9HK7+pLotIoT08bjDv8NP6V7zZslwQRqW27bQc6cqC2LGIbTYO3
|
22
|
+
3jt1kQxfMWmhOictS6SzG9VtKSrXf0L4Neq0Gh7CLBZBvJFWJYZPfb92YNITDbd8
|
23
|
+
emPOAQlXXNMN4mMXsEqtEhCPZRMnmwO+fOk/cC4AyglKi9lnQugCQoFV1XDMZST/
|
24
|
+
CYbzdQyadOdPDInTntG6V+Uw51d2QGXZ6PDDfrx9+toc/3sl5h68rCUGgE6Q3jPz
|
25
|
+
srinqmBsxv2vTpmd4FjmiAtEnwH5/ooLpQYL8UdAjEoeysxS3AwIh+5dAgMBAAGj
|
26
|
+
fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQWU6D156a2cle+
|
27
|
+
lb5RBfvVXlxTwjAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
|
28
|
+
A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
|
29
|
+
ggGBAJ4SqhPlgUiLYIrphGXIaxXScHyvx4kixuvdrwhI4VoQV2qXvO7R6ZjOXVwX
|
30
|
+
f/z84BWPiTZ8lzThPbt1UV/BGwkvLw9I4RjOdzvUz3J42j9Ly6q63isall07bo3F
|
31
|
+
QWe/OBvIMBF1IbjC3q5vKPg4rq8+TkNRJNoE86U2gfR+PkW3jYYs9uiy0GloHDCP
|
32
|
+
k5xgaj0vSL0Uy5mTOPdk3K6a/sUGZyYniWK05zdhIi956ynhfGaFO988FFdVw5Jq
|
33
|
+
LHtXfIpAU8F7ES04syZSslxOluw7VlcSKyRdVIr737J92ZTduppB4PRGSKRgBsWV
|
34
|
+
hXTahRE72Kyw53Q7FAuzF3v102WxAAQ7BuMjW+MyCUT75fwPm3W4ELPL8HYkNGE7
|
35
|
+
2oA5CPghFitRnvYS3GNrDG+9bNiRMEskeaBYwZ9UgReBQIwGYVj7LZk3UhiAsn44
|
36
|
+
gwGrEXGQGDZ0NIgBcmvMOqlXjkGQwQvugKycJ024z89+fz2332vdZIKTrSxJrXGk
|
37
|
+
4/bR9A==
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2023-03-17 00:00:00.000000000 Z
|
12
40
|
dependencies:
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rspec
|
@@ -24,6 +52,20 @@ dependencies:
|
|
24
52
|
- - ">="
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-block_is_expected
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: rake
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,6 +145,7 @@ dependencies:
|
|
103
145
|
description: Versions are good. Versions are cool. Versions will win.
|
104
146
|
email:
|
105
147
|
- peter.boling@gmail.com
|
148
|
+
- oauth-ruby@googlegroups.com
|
106
149
|
executables: []
|
107
150
|
extensions: []
|
108
151
|
extra_rdoc_files: []
|
@@ -118,18 +161,20 @@ files:
|
|
118
161
|
- lib/version_gem/basic.rb
|
119
162
|
- lib/version_gem/error.rb
|
120
163
|
- lib/version_gem/rspec.rb
|
164
|
+
- lib/version_gem/ruby.rb
|
121
165
|
- lib/version_gem/version.rb
|
122
|
-
|
123
|
-
homepage: https://github.com/pboling/version_gem
|
166
|
+
homepage: https://gitlab.com/oauth-xx/version_gem
|
124
167
|
licenses:
|
125
168
|
- MIT
|
126
169
|
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://
|
170
|
+
homepage_uri: https://gitlab.com/oauth-xx/version_gem
|
171
|
+
source_code_uri: https://gitlab.com/oauth-xx/version_gem/-/tree/v1.1.2
|
172
|
+
changelog_uri: https://gitlab.com/oauth-xx/version_gem/-/blob/v1.1.2/CHANGELOG.md
|
173
|
+
bug_tracker_uri: https://gitlab.com/oauth-xx/version_gem/-/issues
|
174
|
+
documentation_uri: https://www.rubydoc.info/gems/version_gem/1.1.2
|
175
|
+
wiki_uri: https://gitlab.com/oauth-xx/version_gem/-/wiki
|
176
|
+
mailing_list_uri: https://groups.google.com/g/oauth-ruby
|
177
|
+
funding_uri: https://liberapay.com/pboling
|
133
178
|
rubygems_mfa_required: 'true'
|
134
179
|
post_install_message:
|
135
180
|
rdoc_options: []
|
@@ -146,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
191
|
- !ruby/object:Gem::Version
|
147
192
|
version: '0'
|
148
193
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.4.8
|
150
195
|
signing_key:
|
151
196
|
specification_version: 4
|
152
197
|
summary: Enhance your VERSION! Sugar for Version modules.
|
metadata.gz.sig
ADDED
Binary file
|
data/sig/version_gem.rbs
DELETED