semverve 0.1.0
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 +7 -0
- data/.github/workflows/ruby.yml +37 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/CONTRIBUTING.md +155 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +93 -0
- data/LICENSE +21 -0
- data/README.md +551 -0
- data/Rakefile +45 -0
- data/lib/semverve/configuration.rb +471 -0
- data/lib/semverve/docs_publisher/task.rb +166 -0
- data/lib/semverve/docs_publisher.rb +370 -0
- data/lib/semverve/error.rb +8 -0
- data/lib/semverve/file_list_resolver.rb +66 -0
- data/lib/semverve/formats/module_constants.rb +140 -0
- data/lib/semverve/formats/simple_string.rb +72 -0
- data/lib/semverve/formats.rb +27 -0
- data/lib/semverve/generator.rb +66 -0
- data/lib/semverve/presets.rb +126 -0
- data/lib/semverve/project_metadata.rb +153 -0
- data/lib/semverve/railtie.rb +16 -0
- data/lib/semverve/semantic_version.rb +116 -0
- data/lib/semverve/task.rb +409 -0
- data/lib/semverve/version.rb +50 -0
- data/lib/semverve/version_code_references.rb +244 -0
- data/lib/semverve/version_file.rb +142 -0
- data/lib/semverve/version_metadata.rb +358 -0
- data/lib/semverve/version_references.rb +427 -0
- data/lib/semverve.rb +30 -0
- data/semverve.gemspec +36 -0
- metadata +156 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9f0366a11f400a32928725b5f954c9f71e3659a75cb5757cf268a3efc018659c
|
|
4
|
+
data.tar.gz: 870ae675510264ea80bc7a44dbe86efd5248a4020a98f3884b3123cb1f68bea6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e945ab75c4b9b4eaf3d232ccc5f0be75b7c024a37e9f5488c2a9d31cefe1bfbd1bc6105b27f1b9d51d600d393ea2ca5b3a51445d9bf712ef279a362192ba5166
|
|
7
|
+
data.tar.gz: 5dcdc6bb2287825fe348c84c289878f76b06e2b453257848990dc1c9cf42a3581dbafc2fd65e04d88ed2861a2f2c17496ce865d929823c5f8bd36e4e8acff13e
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# .github/workflows/ruby.yml
|
|
2
|
+
name: Ruby CI
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ master ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ master ]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-22.04
|
|
13
|
+
env:
|
|
14
|
+
BUNDLER_VERSION: 4.0.10
|
|
15
|
+
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
ruby-version: ['3.2', '3.3', '4.0']
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
25
|
+
uses: ruby/setup-ruby@v1
|
|
26
|
+
with:
|
|
27
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
28
|
+
bundler: ${{ env.BUNDLER_VERSION }}
|
|
29
|
+
bundler-cache: true
|
|
30
|
+
|
|
31
|
+
- name: Print Ruby and Bundler versions
|
|
32
|
+
run: |
|
|
33
|
+
ruby -v
|
|
34
|
+
bundle -v
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: bundle exec rake
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.4
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
Thanks for helping improve Semverve. This project is small on purpose, so the
|
|
3
|
+
best contributions tend to keep behavior explicit, tests close to the feature,
|
|
4
|
+
and release automation boring.
|
|
5
|
+
|
|
6
|
+
## Ruby and Dependencies
|
|
7
|
+
Use the Ruby version declared in `.ruby-version` for local development. The
|
|
8
|
+
gemspec declares the supported Ruby floor, while `.ruby-version` records the
|
|
9
|
+
maintainer's preferred local runtime.
|
|
10
|
+
|
|
11
|
+
Install dependencies with:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
bundle install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The project has no runtime dependencies outside Ruby, Rake, RubyGems, and
|
|
18
|
+
Bundler. Development dependencies are listed in `semverve.gemspec`.
|
|
19
|
+
|
|
20
|
+
## Test Suite
|
|
21
|
+
Run the full default check with:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
bundle exec rake
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The default task runs:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bundle exec rake test
|
|
31
|
+
bundle exec rake semverve:check
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Tests live under `test/semverve` and use `test-unit`. The suite exercises the
|
|
35
|
+
Rake tasks through temporary project directories so changes are tested the way a
|
|
36
|
+
real gem or Rails app would use them. `test/test_helper.rb` also enables
|
|
37
|
+
SimpleCov, so test runs print line coverage.
|
|
38
|
+
|
|
39
|
+
Prefer adding focused tests near the behavior you change:
|
|
40
|
+
|
|
41
|
+
- format parsing and replacement behavior belongs in format tests
|
|
42
|
+
- Rake task behavior belongs in task tests
|
|
43
|
+
- version value-object behavior belongs in semantic version tests
|
|
44
|
+
- release metadata expectations belong in version or task tests
|
|
45
|
+
|
|
46
|
+
## Style
|
|
47
|
+
Semverve uses Standard Ruby. Check style with:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
bundle exec rake standard
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can ask Standard to fix safe offenses with:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
bundle exec rake standard:fix
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Keep comments useful but sparse. Public constants, classes, modules, attributes,
|
|
60
|
+
and methods should have RDoc comments; internal code should usually be clear
|
|
61
|
+
from naming and tests.
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
Build the API documentation with:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
bundle exec rake rerdoc
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Check documentation coverage with:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
bundle exec rake rdoc:coverage
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
RDoc uses `README.md` as the main page and documents files under `lib/**/*.rb`.
|
|
77
|
+
Generated documentation is written to `docs/`, which is ignored on development
|
|
78
|
+
branches. The generated site is maintained on the `gh-pages` branch for GitHub
|
|
79
|
+
Pages.
|
|
80
|
+
|
|
81
|
+
Publish generated docs with:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
bundle exec rake docs:publish
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
That task runs `rerdoc`, opens `gh-pages` in a temporary Git worktree, copies
|
|
88
|
+
the generated `docs/` output there, commits changed docs, pushes to
|
|
89
|
+
`origin/gh-pages`, and removes the temporary worktree. To preview whether
|
|
90
|
+
publishing would change the docs branch without committing or pushing, run:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
bundle exec rake docs:publish:dry_run
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Keep public RDoc comments current as code changes so `bundle exec rake
|
|
97
|
+
rdoc:coverage` stays clean and the published API docs remain useful.
|
|
98
|
+
|
|
99
|
+
When changing behavior, update the README at the same time. The README is the
|
|
100
|
+
primary user guide, so examples should match real task names, configuration
|
|
101
|
+
names, defaults, and output.
|
|
102
|
+
|
|
103
|
+
## Versioning and Release Checks
|
|
104
|
+
Semverve uses Semverve to maintain itself, which doubles as useful
|
|
105
|
+
smoke-testing. The project Rakefile requires `lib/semverve/task` and installs
|
|
106
|
+
`Semverve::Task` with this project-specific configuration:
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
Semverve::Task.new do |t|
|
|
110
|
+
t.bundle_lock = true
|
|
111
|
+
t.version_code_reference_files.append("lib/**/*.rb", "semverve.gemspec", "Rakefile")
|
|
112
|
+
end
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
That means the local `semverve:*` tasks are the same tasks the gem provides to
|
|
116
|
+
users. The current version is stored in `lib/semverve/version.rb`, the gemspec
|
|
117
|
+
uses `Semverve::VERSION`, and `Gemfile.lock` is checked for drift.
|
|
118
|
+
|
|
119
|
+
Useful commands:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
bundle exec rake semverve:current
|
|
123
|
+
bundle exec rake semverve:increment:patch
|
|
124
|
+
bundle exec rake semverve:increment:minor
|
|
125
|
+
bundle exec rake semverve:increment:major
|
|
126
|
+
bundle exec rake semverve:set VERSION=x.y.z
|
|
127
|
+
bundle exec rake semverve:check
|
|
128
|
+
bundle exec rake semverve:fix
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Because `bundle_lock` is enabled for this repository, successful version updates
|
|
132
|
+
also run `bundle lock`. The self-check scans README version references,
|
|
133
|
+
configured code literals, the gemspec version, and the lockfile entry.
|
|
134
|
+
|
|
135
|
+
## Release Sanity Checks
|
|
136
|
+
Before release, run:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
bundle exec rake
|
|
140
|
+
bundle exec rake standard
|
|
141
|
+
bundle exec rake rdoc:coverage
|
|
142
|
+
bundle exec rake rerdoc
|
|
143
|
+
bundle exec rake build
|
|
144
|
+
bundle exec rake docs:publish:dry_run
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The build task writes the packaged gem under `pkg/`. Inspect the package if you
|
|
148
|
+
changed metadata or file lists:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
gem specification pkg/semverve-*.gem
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
For a public release, also confirm that the GitHub repository is public, the
|
|
155
|
+
gemspec metadata URLs resolve, and RubyGems credentials are configured locally.
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
semverve (0.1.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
ast (2.4.3)
|
|
10
|
+
docile (1.4.1)
|
|
11
|
+
erb (6.0.4)
|
|
12
|
+
json (2.20.0)
|
|
13
|
+
language_server-protocol (3.17.0.6)
|
|
14
|
+
lint_roller (1.1.0)
|
|
15
|
+
logger (1.7.0)
|
|
16
|
+
parallel (1.28.0)
|
|
17
|
+
parser (3.3.11.1)
|
|
18
|
+
ast (~> 2.4.1)
|
|
19
|
+
racc
|
|
20
|
+
power_assert (3.0.1)
|
|
21
|
+
prism (1.9.0)
|
|
22
|
+
racc (1.8.1)
|
|
23
|
+
rainbow (3.1.1)
|
|
24
|
+
rake (13.4.2)
|
|
25
|
+
rbs (4.0.3)
|
|
26
|
+
logger
|
|
27
|
+
prism (>= 1.6.0)
|
|
28
|
+
tsort
|
|
29
|
+
rdoc (8.0.0)
|
|
30
|
+
erb
|
|
31
|
+
prism (>= 1.6.0)
|
|
32
|
+
rbs (>= 4.0.0)
|
|
33
|
+
tsort
|
|
34
|
+
regexp_parser (2.12.0)
|
|
35
|
+
rubocop (1.84.2)
|
|
36
|
+
json (~> 2.3)
|
|
37
|
+
language_server-protocol (~> 3.17.0.2)
|
|
38
|
+
lint_roller (~> 1.1.0)
|
|
39
|
+
parallel (~> 1.10)
|
|
40
|
+
parser (>= 3.3.0.2)
|
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
42
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
43
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
44
|
+
ruby-progressbar (~> 1.7)
|
|
45
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
46
|
+
rubocop-ast (1.50.0)
|
|
47
|
+
parser (>= 3.3.7.2)
|
|
48
|
+
prism (~> 1.7)
|
|
49
|
+
rubocop-performance (1.26.1)
|
|
50
|
+
lint_roller (~> 1.1)
|
|
51
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
52
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
53
|
+
ruby-progressbar (1.13.0)
|
|
54
|
+
simplecov (0.22.0)
|
|
55
|
+
docile (~> 1.1)
|
|
56
|
+
simplecov-html (~> 0.11)
|
|
57
|
+
simplecov_json_formatter (~> 0.1)
|
|
58
|
+
simplecov-html (0.13.2)
|
|
59
|
+
simplecov_json_formatter (0.1.4)
|
|
60
|
+
standard (1.54.0)
|
|
61
|
+
language_server-protocol (~> 3.17.0.2)
|
|
62
|
+
lint_roller (~> 1.0)
|
|
63
|
+
rubocop (~> 1.84.0)
|
|
64
|
+
standard-custom (~> 1.0.0)
|
|
65
|
+
standard-performance (~> 1.8)
|
|
66
|
+
standard-custom (1.0.2)
|
|
67
|
+
lint_roller (~> 1.0)
|
|
68
|
+
rubocop (~> 1.50)
|
|
69
|
+
standard-performance (1.9.0)
|
|
70
|
+
lint_roller (~> 1.1)
|
|
71
|
+
rubocop-performance (~> 1.26.0)
|
|
72
|
+
test-unit (3.7.8)
|
|
73
|
+
power_assert
|
|
74
|
+
tsort (0.2.0)
|
|
75
|
+
unicode-display_width (3.2.0)
|
|
76
|
+
unicode-emoji (~> 4.1)
|
|
77
|
+
unicode-emoji (4.2.0)
|
|
78
|
+
|
|
79
|
+
PLATFORMS
|
|
80
|
+
arm64-darwin-21
|
|
81
|
+
arm64-darwin-25
|
|
82
|
+
x86_64-linux
|
|
83
|
+
|
|
84
|
+
DEPENDENCIES
|
|
85
|
+
rake (~> 13.0, >= 13.0.1)
|
|
86
|
+
rdoc
|
|
87
|
+
simplecov
|
|
88
|
+
standard (~> 1.54.0)
|
|
89
|
+
test-unit (~> 3.3, >= 3.3.5)
|
|
90
|
+
semverve!
|
|
91
|
+
|
|
92
|
+
BUNDLED WITH
|
|
93
|
+
4.0.10
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Evan Gray
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|