yard-timekeeper 0.2.0 → 0.2.1
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 +16 -1
- data/README.md +23 -5
- data/lib/yard/timekeeper/version.rb +1 -1
- data/lib/yard/timekeeper.rb +29 -4
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: 865e7e350c522be374670622f6f78849725e0c34e4f70e9736cf0d0d95d93ecb
|
|
4
|
+
data.tar.gz: ca58d1226036bf5f64ce43815d54f6f628640bb470462e56f5340808df3c508c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6648fe7c779062819edaee95af6e456663b1fb73d45e05b9385308d8ae09d1766165af924a21eb2b4f1dea347770dec80f68a9e23818bfc276b9a2c362c2ba38
|
|
7
|
+
data.tar.gz: 895058166ceba097ea730336d5deef19e2b20ea73cead4cd21222c2090fee4a9424adb3cbf3f38b016bf6c80628b66a49a919f0d416335d369bf2caf6401f580
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,19 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [0.2.1] - 2026-06-04
|
|
34
|
+
|
|
35
|
+
- TAG: [v0.2.1][0.2.1t]
|
|
36
|
+
- COVERAGE: 98.80% -- 82/83 lines in 2 files
|
|
37
|
+
- BRANCH COVERAGE: 93.33% -- 28/30 branches in 2 files
|
|
38
|
+
- 20.83% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- Treated YARD generator version and Ruby version footer changes as generated
|
|
43
|
+
documentation churn, so footer-only docs diffs are restored even when the
|
|
44
|
+
toolchain version changes.
|
|
45
|
+
|
|
33
46
|
## [0.2.0] - 2026-06-03
|
|
34
47
|
|
|
35
48
|
- TAG: [v0.2.0][0.2.0t]
|
|
@@ -80,7 +93,9 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
80
93
|
|
|
81
94
|
- Initial release
|
|
82
95
|
|
|
83
|
-
[Unreleased]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.
|
|
96
|
+
[Unreleased]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.1...HEAD
|
|
97
|
+
[0.2.1]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.2.0...v0.2.1
|
|
98
|
+
[0.2.1t]: https://github.com/galtzo-floss/yard-timekeeper/releases/tag/v0.2.1
|
|
84
99
|
[0.2.0]: https://github.com/galtzo-floss/yard-timekeeper/compare/v0.1.0...v0.2.0
|
|
85
100
|
[0.2.0t]: https://github.com/galtzo-floss/yard-timekeeper/releases/tag/v0.2.0
|
|
86
101
|
[0.1.0]: https://github.com/galtzo-floss/yard-timekeeper/compare/bffde1dbf4ceb71a29a72b5b2dfb79622a14417b...v0.1.0
|
data/README.md
CHANGED
|
@@ -22,13 +22,15 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
|
|
|
22
22
|
## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
|
|
23
23
|
|
|
24
24
|
`yard-timekeeper` keeps checked-in YARD HTML stable by restoring files whose
|
|
25
|
-
only
|
|
25
|
+
only changes are generated footer churn.
|
|
26
26
|
|
|
27
27
|
Just the important bits:
|
|
28
28
|
|
|
29
29
|
- It postprocesses generated `docs/**/*.html` files after YARD finishes.
|
|
30
30
|
- It only restores files that are already tracked in git and only when the diff
|
|
31
|
-
is
|
|
31
|
+
is limited to generated footer metadata.
|
|
32
|
+
- It treats YARD footer timestamp, YARD version, and Ruby version changes as
|
|
33
|
+
generated churn, because those do not represent documentation content changes.
|
|
32
34
|
- Real content changes are preserved.
|
|
33
35
|
- The supported workflow is `rake yard`; raw `yard` / `bin/yard` does not run
|
|
34
36
|
the explicit postprocess hook.
|
|
@@ -127,20 +129,32 @@ Yard::Timekeeper.install_rake_tasks!(:yard)
|
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
`yard-timekeeper` runs after YARD generates HTML and checks git diffs for tracked
|
|
130
|
-
files under `docs/`. If a file's only
|
|
132
|
+
files under `docs/`. If a file's only changes are generated footer metadata:
|
|
131
133
|
|
|
132
134
|
```text
|
|
133
135
|
Generated on ...
|
|
136
|
+
0.9.44 (ruby-4.0.5).
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
then the plugin restores that file from git so the docs site does not churn for
|
|
137
|
-
|
|
140
|
+
toolchain-only changes.
|
|
141
|
+
|
|
142
|
+
This protects against the common case where rebuilding docs changes only:
|
|
143
|
+
|
|
144
|
+
- the generation timestamp
|
|
145
|
+
- the YARD generator version
|
|
146
|
+
- the Ruby version in the YARD footer
|
|
147
|
+
|
|
148
|
+
Those values are useful when the page content changes, but they are not useful
|
|
149
|
+
as standalone repository diffs.
|
|
138
150
|
|
|
139
151
|
Notes:
|
|
140
152
|
|
|
141
153
|
- It only affects files already tracked in git.
|
|
142
154
|
- It is most useful for checked-in `docs/` sites.
|
|
143
155
|
- Files with any real content changes keep their fresh timestamp.
|
|
156
|
+
- Files with source, README, changelog, API, or rendered markup changes are not
|
|
157
|
+
restored just because their footer also changed.
|
|
144
158
|
|
|
145
159
|
Environment toggles:
|
|
146
160
|
|
|
@@ -154,6 +168,10 @@ Generate docs through rake so the postprocess runs after YARD finishes:
|
|
|
154
168
|
bin/rake yard
|
|
155
169
|
```
|
|
156
170
|
|
|
171
|
+
After generation, `yard-timekeeper` examines each changed tracked HTML file
|
|
172
|
+
under `docs/`. Footer-only churn is restored from git automatically. Pages with
|
|
173
|
+
real rendered content changes remain modified, including their fresh footer.
|
|
174
|
+
|
|
157
175
|
If your project also exposes `bin/yard`, do not rely on it for the full docs
|
|
158
176
|
workflow. It runs YARD, but it does not run
|
|
159
177
|
`Yard::Timekeeper.install_rake_tasks!(:yard)`.
|
|
@@ -506,7 +524,7 @@ Thanks for RTFM. ☺️
|
|
|
506
524
|
[📌gitmoji]: https://gitmoji.dev
|
|
507
525
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
508
526
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
509
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
527
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.083-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
510
528
|
[🔐security]: https://github.com/galtzo-floss/yard-timekeeper/blob/main/SECURITY.md
|
|
511
529
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
512
530
|
[📄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
|
@@ -15,6 +15,12 @@ module Yard
|
|
|
15
15
|
RAKE_INTEGRATIONS_MUTEX = Mutex.new
|
|
16
16
|
|
|
17
17
|
TIMESTAMP_DIFF_LINE_RE = /\A[+-]\s{2}Generated on .+ by\s*\z/
|
|
18
|
+
GENERATOR_VERSION_DIFF_LINE_RE = /
|
|
19
|
+
\A[+-]\s{2}
|
|
20
|
+
\d+(?:\.\d+)+(?:[.\w-][.\w-]*)?
|
|
21
|
+
\s\(ruby-[^)]+\)\.\s*
|
|
22
|
+
\z
|
|
23
|
+
/x
|
|
18
24
|
DIFF_METADATA_PREFIXES = [
|
|
19
25
|
"diff --git ",
|
|
20
26
|
"index ",
|
|
@@ -111,14 +117,33 @@ module Yard
|
|
|
111
117
|
next if DIFF_METADATA_PREFIXES.any? { |prefix| line.start_with?(prefix) }
|
|
112
118
|
next if line.strip.empty?
|
|
113
119
|
|
|
114
|
-
return false unless
|
|
120
|
+
return false unless footer_churn_line?(line)
|
|
115
121
|
|
|
116
122
|
change_lines << line
|
|
117
123
|
end
|
|
118
124
|
|
|
119
|
-
change_lines
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
balanced_footer_churn?(change_lines)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def footer_churn_line?(line)
|
|
129
|
+
line.match?(TIMESTAMP_DIFF_LINE_RE) || line.match?(GENERATOR_VERSION_DIFF_LINE_RE)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def balanced_footer_churn?(change_lines)
|
|
133
|
+
removed_lines = change_lines.select { |line| line.start_with?("-") }
|
|
134
|
+
added_lines = change_lines.select { |line| line.start_with?("+") }
|
|
135
|
+
|
|
136
|
+
removed_lines.size == added_lines.size &&
|
|
137
|
+
removed_lines.size.between?(1, 2) &&
|
|
138
|
+
removed_lines.map { |line| footer_churn_kind(line) }.sort ==
|
|
139
|
+
added_lines.map { |line| footer_churn_kind(line) }.sort
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def footer_churn_kind(line)
|
|
143
|
+
return :timestamp if line.match?(TIMESTAMP_DIFF_LINE_RE)
|
|
144
|
+
return :generator_version if line.match?(GENERATOR_VERSION_DIFF_LINE_RE)
|
|
145
|
+
|
|
146
|
+
:unknown
|
|
122
147
|
end
|
|
123
148
|
|
|
124
149
|
def restore_file(path, root)
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -278,10 +278,10 @@ licenses:
|
|
|
278
278
|
- MIT
|
|
279
279
|
metadata:
|
|
280
280
|
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.
|
|
281
|
+
source_code_uri: https://github.com/galtzo-floss/yard-timekeeper/tree/v0.2.1
|
|
282
|
+
changelog_uri: https://github.com/galtzo-floss/yard-timekeeper/blob/v0.2.1/CHANGELOG.md
|
|
283
283
|
bug_tracker_uri: https://github.com/galtzo-floss/yard-timekeeper/issues
|
|
284
|
-
documentation_uri: https://www.rubydoc.info/gems/yard-timekeeper/0.2.
|
|
284
|
+
documentation_uri: https://www.rubydoc.info/gems/yard-timekeeper/0.2.1
|
|
285
285
|
funding_uri: https://github.com/sponsors/pboling
|
|
286
286
|
wiki_uri: https://github.com/galtzo-floss/yard-timekeeper/wiki
|
|
287
287
|
news_uri: https://www.railsbling.com/tags/yard-timekeeper
|
metadata.gz.sig
CHANGED
|
Binary file
|