yard-timekeeper 0.2.2 → 0.2.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 +0 -0
- data/CHANGELOG.md +29 -1
- data/CONTRIBUTING.md +4 -1
- data/MIT.md +21 -0
- data/README.md +1 -1
- data/lib/yard/timekeeper/version.rb +1 -1
- data/lib/yard/timekeeper.rb +75 -6
- data.tar.gz.sig +0 -0
- metadata +20 -19
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e09988dc7f2aa7fbd159d09194aad1c6c8b0fd7108d2a2ed36c28a904783bcea
|
|
4
|
+
data.tar.gz: bf3b8b0ddf8b4306a88ba82c676411677ecd142326c6e3678145c0b9e5d45514
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6b6fc80c60947b4ae41e30cbba483e07739294eb04814e2423e0ec704d29f76e3e8b8d3ce3460baf09859c6d0553568bcdb3a404db047a0b4d1a8f202a73958
|
|
7
|
+
data.tar.gz: 12f546cff001d872c891914ef9c76a6da879ed8b1d6a57441d9c79cfcc9291c0ebacf9b73f97746638f253f1d5c23e6b3b791f04f2db9fe8801e368b4ad5fb4e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,30 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [0.2.4] - 2026-07-18
|
|
34
|
+
|
|
35
|
+
- TAG: [v0.2.4][0.2.4t]
|
|
36
|
+
- COVERAGE: 95.20% -- 119/125 lines in 3 files
|
|
37
|
+
- BRANCH COVERAGE: 86.54% -- 45/52 branches in 3 files
|
|
38
|
+
- 15.62% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- Restored generated YARD title/header metadata from git when rebuilding docs
|
|
43
|
+
with a newer YARD version, including when the file also has real content
|
|
44
|
+
changes that should be preserved.
|
|
45
|
+
|
|
46
|
+
## [0.2.3] - 2026-07-02
|
|
47
|
+
|
|
48
|
+
- TAG: [v0.2.3][0.2.3t]
|
|
49
|
+
- COVERAGE: 97.62% -- 82/84 lines in 3 files
|
|
50
|
+
- BRANCH COVERAGE: 93.33% -- 28/30 branches in 3 files
|
|
51
|
+
- 20.83% documented
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- Package configured license files in gem release file lists.
|
|
56
|
+
|
|
33
57
|
## [0.2.2] - 2026-06-22
|
|
34
58
|
|
|
35
59
|
- TAG: [v0.2.2][0.2.2t]
|
|
@@ -108,7 +132,11 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
108
132
|
|
|
109
133
|
- Initial release
|
|
110
134
|
|
|
111
|
-
[Unreleased]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.
|
|
135
|
+
[Unreleased]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.4...HEAD
|
|
136
|
+
[0.2.4]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.3...v0.2.4
|
|
137
|
+
[0.2.4t]: https://github.com/galtzo-floss/yard-timekeeper/releases/tag/v0.2.4
|
|
138
|
+
[0.2.3]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.2...v0.2.3
|
|
139
|
+
[0.2.3t]: https://github.com/galtzo-floss/yard-timekeeper/releases/tag/v0.2.3
|
|
112
140
|
[0.2.2]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.1...v0.2.2
|
|
113
141
|
[0.2.2t]: https://github.com/galtzo-floss/yard-timekeeper/releases/tag/v0.2.2
|
|
114
142
|
[0.2.1]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.0...v0.2.1
|
data/CONTRIBUTING.md
CHANGED
|
@@ -131,9 +131,12 @@ toolchain, and it may be higher than the gemspec runtime floor.
|
|
|
131
131
|
They are created and updated with the commands:
|
|
132
132
|
|
|
133
133
|
```console
|
|
134
|
-
bin/rake appraisal:
|
|
134
|
+
bin/rake appraisal:generate
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
+
Use `bin/rake appraisal:update` when you intentionally need to resolve fresh
|
|
138
|
+
appraisal locks.
|
|
139
|
+
|
|
137
140
|
If you need to reset all gemfiles/*.gemfile.lock files:
|
|
138
141
|
|
|
139
142
|
```console
|
data/MIT.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
See [LICENSE.md](LICENSE.md) for the copyright notice.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -540,7 +540,7 @@ Thanks for RTFM. ☺️
|
|
|
540
540
|
[📌gitmoji]: https://gitmoji.dev
|
|
541
541
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
542
542
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
543
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
543
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.125-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
544
544
|
[🔐security]: https://github.com/galtzo-floss/yard-timekeeper/blob/main/SECURITY.md
|
|
545
545
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
546
546
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/lib/yard/timekeeper.rb
CHANGED
|
@@ -14,13 +14,22 @@ module Yard
|
|
|
14
14
|
RAKE_INTEGRATIONS = {}
|
|
15
15
|
RAKE_INTEGRATIONS_MUTEX = Mutex.new
|
|
16
16
|
|
|
17
|
+
TITLE_GENERATOR_DIFF_LINE_RE = /\A[+-].*Documentation by YARD \d+(?:\.\d+)+(?:[.\w-][.\w-]*)?\s*\z/
|
|
17
18
|
TIMESTAMP_DIFF_LINE_RE = /\A[+-]\s{2}Generated on .+ by\s*\z/
|
|
18
|
-
|
|
19
|
+
FOOTER_GENERATOR_VERSION_DIFF_LINE_RE = /
|
|
19
20
|
\A[+-]\s{2}
|
|
20
21
|
\d+(?:\.\d+)+(?:[.\w-][.\w-]*)?
|
|
21
22
|
\s\(ruby-[^)]+\)\.\s*
|
|
22
23
|
\z
|
|
23
24
|
/x
|
|
25
|
+
TITLE_GENERATOR_LINE_RE = /Documentation by YARD \d+(?:\.\d+)+(?:[.\w-][.\w-]*)?/
|
|
26
|
+
TIMESTAMP_LINE_RE = /\A\s{2}Generated on .+ by\s*\z/
|
|
27
|
+
FOOTER_GENERATOR_VERSION_LINE_RE = /
|
|
28
|
+
\A\s{2}
|
|
29
|
+
\d+(?:\.\d+)+(?:[.\w-][.\w-]*)?
|
|
30
|
+
\s\(ruby-[^)]+\)\.\s*
|
|
31
|
+
\z
|
|
32
|
+
/x
|
|
24
33
|
DIFF_METADATA_PREFIXES = [
|
|
25
34
|
"diff --git ",
|
|
26
35
|
"index ",
|
|
@@ -41,9 +50,12 @@ module Yard
|
|
|
41
50
|
|
|
42
51
|
changed_docs_files(root).each do |relative_path|
|
|
43
52
|
next unless relative_path.end_with?(".html")
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
diff = git_diff(relative_path, root)
|
|
54
|
+
if timestamp_only_diff?(diff)
|
|
55
|
+
restore_file(relative_path, root)
|
|
56
|
+
else
|
|
57
|
+
normalize_generated_metadata(relative_path, root)
|
|
58
|
+
end
|
|
47
59
|
end
|
|
48
60
|
rescue => e
|
|
49
61
|
warn("Yard::Timekeeper.postprocess_html_docs failed: #{e.class}: #{e.message}")
|
|
@@ -126,7 +138,9 @@ module Yard
|
|
|
126
138
|
end
|
|
127
139
|
|
|
128
140
|
def footer_churn_line?(line)
|
|
129
|
-
line.match?(
|
|
141
|
+
line.match?(TITLE_GENERATOR_DIFF_LINE_RE) ||
|
|
142
|
+
line.match?(TIMESTAMP_DIFF_LINE_RE) ||
|
|
143
|
+
line.match?(FOOTER_GENERATOR_VERSION_DIFF_LINE_RE)
|
|
130
144
|
end
|
|
131
145
|
|
|
132
146
|
def balanced_footer_churn?(change_lines)
|
|
@@ -140,12 +154,67 @@ module Yard
|
|
|
140
154
|
end
|
|
141
155
|
|
|
142
156
|
def footer_churn_kind(line)
|
|
157
|
+
return :title_generator if line.match?(TITLE_GENERATOR_DIFF_LINE_RE)
|
|
143
158
|
return :timestamp if line.match?(TIMESTAMP_DIFF_LINE_RE)
|
|
144
|
-
return :
|
|
159
|
+
return :footer_generator_version if line.match?(FOOTER_GENERATOR_VERSION_DIFF_LINE_RE)
|
|
145
160
|
|
|
146
161
|
:unknown
|
|
147
162
|
end
|
|
148
163
|
|
|
164
|
+
def normalize_generated_metadata(path, root)
|
|
165
|
+
original = tracked_file_content(path, root)
|
|
166
|
+
return false unless original
|
|
167
|
+
|
|
168
|
+
absolute_path = File.join(root, path)
|
|
169
|
+
return false unless File.file?(absolute_path)
|
|
170
|
+
|
|
171
|
+
replacement_lines = generated_metadata_lines(original)
|
|
172
|
+
return false if replacement_lines.empty?
|
|
173
|
+
|
|
174
|
+
current = File.read(absolute_path)
|
|
175
|
+
changed = false
|
|
176
|
+
normalized_lines = current.lines.map do |line|
|
|
177
|
+
kind = generated_metadata_kind(line)
|
|
178
|
+
replacement = replacement_lines[kind]
|
|
179
|
+
if replacement && line != replacement
|
|
180
|
+
changed = true
|
|
181
|
+
replacement
|
|
182
|
+
else
|
|
183
|
+
line
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
return false unless changed
|
|
188
|
+
|
|
189
|
+
File.write(absolute_path, normalized_lines.join)
|
|
190
|
+
true
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def tracked_file_content(path, root)
|
|
194
|
+
stdout, status = Open3.capture2("git", "show", "HEAD:#{path}", chdir: root)
|
|
195
|
+
return unless status.success?
|
|
196
|
+
|
|
197
|
+
stdout
|
|
198
|
+
rescue Errno::ENOENT
|
|
199
|
+
nil
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def generated_metadata_lines(content)
|
|
203
|
+
content.lines.each_with_object({}) do |line, replacements|
|
|
204
|
+
kind = generated_metadata_kind(line)
|
|
205
|
+
replacements[kind] ||= line if kind
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
def generated_metadata_kind(line)
|
|
210
|
+
stripped_line = line.strip
|
|
211
|
+
return :title_generator if stripped_line.match?(TITLE_GENERATOR_LINE_RE)
|
|
212
|
+
return :timestamp if line.match?(TIMESTAMP_LINE_RE)
|
|
213
|
+
return :footer_generator_version if line.match?(FOOTER_GENERATOR_VERSION_LINE_RE)
|
|
214
|
+
|
|
215
|
+
nil
|
|
216
|
+
end
|
|
217
|
+
|
|
149
218
|
def restore_file(path, root)
|
|
150
219
|
_stdout, _stderr, status = Open3.capture3("git", "checkout", "--", path, chdir: root)
|
|
151
220
|
status.success?
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yard-timekeeper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -63,20 +63,20 @@ dependencies:
|
|
|
63
63
|
requirements:
|
|
64
64
|
- - "~>"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '2.
|
|
66
|
+
version: '2.3'
|
|
67
67
|
- - ">="
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 2.
|
|
69
|
+
version: 2.3.0
|
|
70
70
|
type: :development
|
|
71
71
|
prerelease: false
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
|
74
74
|
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '2.
|
|
76
|
+
version: '2.3'
|
|
77
77
|
- - ">="
|
|
78
78
|
- !ruby/object:Gem::Version
|
|
79
|
-
version: 2.
|
|
79
|
+
version: 2.3.0
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: bundler-audit
|
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -134,7 +134,7 @@ dependencies:
|
|
|
134
134
|
version: '3.1'
|
|
135
135
|
- - ">="
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: 3.1.
|
|
137
|
+
version: 3.1.4
|
|
138
138
|
type: :development
|
|
139
139
|
prerelease: false
|
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -144,7 +144,7 @@ dependencies:
|
|
|
144
144
|
version: '3.1'
|
|
145
145
|
- - ">="
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
|
-
version: 3.1.
|
|
147
|
+
version: 3.1.4
|
|
148
148
|
- !ruby/object:Gem::Dependency
|
|
149
149
|
name: kettle-test
|
|
150
150
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -154,7 +154,7 @@ dependencies:
|
|
|
154
154
|
version: '2.0'
|
|
155
155
|
- - ">="
|
|
156
156
|
- !ruby/object:Gem::Version
|
|
157
|
-
version: 2.0.
|
|
157
|
+
version: 2.0.9
|
|
158
158
|
type: :development
|
|
159
159
|
prerelease: false
|
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -164,7 +164,7 @@ dependencies:
|
|
|
164
164
|
version: '2.0'
|
|
165
165
|
- - ">="
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
|
-
version: 2.0.
|
|
167
|
+
version: 2.0.9
|
|
168
168
|
- !ruby/object:Gem::Dependency
|
|
169
169
|
name: turbo_tests2
|
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -174,7 +174,7 @@ dependencies:
|
|
|
174
174
|
version: '3.1'
|
|
175
175
|
- - ">="
|
|
176
176
|
- !ruby/object:Gem::Version
|
|
177
|
-
version: 3.1.
|
|
177
|
+
version: 3.1.6
|
|
178
178
|
type: :development
|
|
179
179
|
prerelease: false
|
|
180
180
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -184,7 +184,7 @@ dependencies:
|
|
|
184
184
|
version: '3.1'
|
|
185
185
|
- - ">="
|
|
186
186
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 3.1.
|
|
187
|
+
version: 3.1.6
|
|
188
188
|
- !ruby/object:Gem::Dependency
|
|
189
189
|
name: ruby-progressbar
|
|
190
190
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -208,7 +208,7 @@ dependencies:
|
|
|
208
208
|
version: '1.0'
|
|
209
209
|
- - ">="
|
|
210
210
|
- !ruby/object:Gem::Version
|
|
211
|
-
version: 1.0.
|
|
211
|
+
version: 1.0.4
|
|
212
212
|
type: :development
|
|
213
213
|
prerelease: false
|
|
214
214
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -218,7 +218,7 @@ dependencies:
|
|
|
218
218
|
version: '1.0'
|
|
219
219
|
- - ">="
|
|
220
220
|
- !ruby/object:Gem::Version
|
|
221
|
-
version: 1.0.
|
|
221
|
+
version: 1.0.4
|
|
222
222
|
- !ruby/object:Gem::Dependency
|
|
223
223
|
name: gitmoji-regex
|
|
224
224
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -228,7 +228,7 @@ dependencies:
|
|
|
228
228
|
version: '2.0'
|
|
229
229
|
- - ">="
|
|
230
230
|
- !ruby/object:Gem::Version
|
|
231
|
-
version: 2.0.
|
|
231
|
+
version: 2.0.4
|
|
232
232
|
type: :development
|
|
233
233
|
prerelease: false
|
|
234
234
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -238,7 +238,7 @@ dependencies:
|
|
|
238
238
|
version: '2.0'
|
|
239
239
|
- - ">="
|
|
240
240
|
- !ruby/object:Gem::Version
|
|
241
|
-
version: 2.0.
|
|
241
|
+
version: 2.0.4
|
|
242
242
|
description: "\U0001F570️ A YARD plugin that post-processes generated docs, detects
|
|
243
243
|
timestamp-only diffs in tracked HTML files under docs/, and restores those files
|
|
244
244
|
from git to prevent pointless churn while keeping the footer timestamp on genuinely
|
|
@@ -264,6 +264,7 @@ files:
|
|
|
264
264
|
- CONTRIBUTING.md
|
|
265
265
|
- FUNDING.md
|
|
266
266
|
- LICENSE.md
|
|
267
|
+
- MIT.md
|
|
267
268
|
- README.md
|
|
268
269
|
- RUBOCOP.md
|
|
269
270
|
- SECURITY.md
|
|
@@ -278,10 +279,10 @@ licenses:
|
|
|
278
279
|
- MIT
|
|
279
280
|
metadata:
|
|
280
281
|
homepage_uri: https://yard-timekeeper.galtzo.com
|
|
281
|
-
source_code_uri: https://github.com/galtzo-floss/yard-timekeeper/tree/v0.2.
|
|
282
|
-
changelog_uri: https://github.com/galtzo-floss/yard-timekeeper/blob/v0.2.
|
|
282
|
+
source_code_uri: https://github.com/galtzo-floss/yard-timekeeper/tree/v0.2.4
|
|
283
|
+
changelog_uri: https://github.com/galtzo-floss/yard-timekeeper/blob/v0.2.4/CHANGELOG.md
|
|
283
284
|
bug_tracker_uri: https://github.com/galtzo-floss/yard-timekeeper/issues
|
|
284
|
-
documentation_uri: https://www.rubydoc.info/gems/yard-timekeeper/0.2.
|
|
285
|
+
documentation_uri: https://www.rubydoc.info/gems/yard-timekeeper/0.2.4
|
|
285
286
|
funding_uri: https://github.com/sponsors/pboling
|
|
286
287
|
wiki_uri: https://github.com/galtzo-floss/yard-timekeeper/wiki
|
|
287
288
|
news_uri: https://www.railsbling.com/tags/yard-timekeeper
|
|
@@ -311,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
311
312
|
- !ruby/object:Gem::Version
|
|
312
313
|
version: '0'
|
|
313
314
|
requirements: []
|
|
314
|
-
rubygems_version: 4.0.
|
|
315
|
+
rubygems_version: 4.0.16
|
|
315
316
|
specification_version: 4
|
|
316
317
|
summary: "\U0001F570️ Preserve tracked YARD docs when only the generated timestamp
|
|
317
318
|
changed."
|
metadata.gz.sig
CHANGED
|
Binary file
|