yard-fence 0.8.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efcf6aabcf9abcf8dcf8e1878511c03251163a4badfd5b3bb70f14945586a60a
4
- data.tar.gz: 3f2b3b47d984092fc321a8f20b93a0c61fb2df7a8693f00c1e321ddfd1378625
3
+ metadata.gz: bc262c091f78581d3821583ece2da12cd358b65c7d0acf746d4d6707716e954e
4
+ data.tar.gz: '0942c781301e6bd8797d6f2469536f7fb78f9ec94c0925f392dfc3ea4b85291f'
5
5
  SHA512:
6
- metadata.gz: e11299ec5ad361db6eeac761c165c4e46ec0d70b7fb176476a4a2a8236323a9dfe7df81a1bd3ea5ec94db3476caa24eb40f608bc19c76262c3eab25b52af1112
7
- data.tar.gz: e0e1020769588c7f576b0c6d34e0effe4042803407b5ea5dd215fca1037ec114fe029ee8684608517011c8dfea5ce956f27c4288e3c03b757dbc85356eff23c6
6
+ metadata.gz: 55f59d786ae901ffce17587bd780277dfad50937d2a4e3ebb3d1c7bd7c20f0509c1ca24ee2de9dd614aa206179bae4919257399d398e5c4b997e2d5874669e72
7
+ data.tar.gz: 974da0442ee2e4f4cbb42a7c0cf9100226d05a0ffe58b53a86ee6436bc198dc9807261b44daa9ad5d708a4ee1fbff16ab93c9ed413747e2e7f65340d7cac6ce9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,24 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.8.1] - 2025-12-29
34
+
35
+ - TAG: [v0.8.1][0.8.1t]
36
+ - COVERAGE: 100.00% -- 129/129 lines in 4 files
37
+ - BRANCH COVERAGE: 100.00% -- 40/40 branches in 4 files
38
+ - 40.00% documented
39
+
40
+ ### Added
41
+
42
+ - `YARD_FENCE_CLEAN_DOCS` environment variable to optionally clear the `docs/` directory before regeneration
43
+ - Set to `true` to enable; prevents stale HTML files from persisting when markdown source files are deleted
44
+
45
+ ### Changed
46
+
47
+ - `prepare_tmp_files` now clears the `tmp/yard-fence/` staging directory before regenerating files
48
+ - This prevents stale preprocessed files from persisting when source markdown files are deleted
49
+ - Previously, files added manually or by other processes to `tmp/yard-fence/` would remain and get included in documentation
50
+
33
51
  ## [0.8.0] - 2025-11-08
34
52
 
35
53
  - TAG: [v0.8.0][0.8.0t]
@@ -132,7 +150,9 @@ Please file a bug if you notice a violation of semantic versioning.
132
150
 
133
151
  - Initial release
134
152
 
135
- [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.0...HEAD
153
+ [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.1...HEAD
154
+ [0.8.1]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.0...v0.8.1
155
+ [0.8.1t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.8.1
136
156
  [0.8.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.7.0...v0.8.0
137
157
  [0.8.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.8.0
138
158
  [0.7.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.6.0...v0.7.0
data/README.md CHANGED
@@ -27,16 +27,18 @@
27
27
  [gem-server]: https://github.com/galtzo-floss/gem-server
28
28
  [reinteractive-podcast]: https://youtu.be/_H4qbtC5qzU?si=BvuBU90R2wAqD2E6
29
29
 
30
- [![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-i]][🖼️galtzo-discord] [![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang]
30
+ [![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-i]][🖼️galtzo-discord] [![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang] [![yard-fence Logo by Aboling0, CC BY-SA 4.0][🖼️yard-fence-i]][🖼️yard-fence]
31
31
 
32
32
  [🖼️galtzo-i]: https://logos.galtzo.com/assets/images/galtzo-floss/avatar-192px.svg
33
33
  [🖼️galtzo-discord]: https://discord.gg/3qme4XHNKN
34
34
  [🖼️ruby-lang-i]: https://logos.galtzo.com/assets/images/ruby-lang/avatar-192px.svg
35
35
  [🖼️ruby-lang]: https://www.ruby-lang.org/
36
+ [🖼️yard-fence-i]: https://logos.galtzo.com/assets/images/galtzo-floss/yard-fence/avatar-192px.svg
37
+ [🖼️yard-fence]: https://github.com/galtzo-floss/yard-fence
36
38
 
37
39
  # 🤺 Yard::Fence
38
40
 
39
- [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
41
+ [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
40
42
 
41
43
  `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-discord], as I may have missed the [discord notification][🖼️galtzo-discord].
42
44
 
@@ -80,7 +82,7 @@ See the configuration and usage sections for more details.
80
82
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
81
83
  |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
82
84
  | Works with JRuby | [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
83
- | Works with Truffle Ruby | [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] |
85
+ | Works with Truffle Ruby | [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] |
84
86
  | Works with MRI Ruby 3 | [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
85
87
  | Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
86
88
  | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
@@ -219,7 +221,30 @@ Recommended .yardopts (noise‑free):
219
221
 
220
222
  Why tmp/yard-fence/?
221
223
 
222
- - The plugin converts ASCII `{ }` to fullwidth `{ }` only in `tmp/yard-fence/` so YARD wont treat brace content as reference tags and emit `InvalidLink` warnings. After docs are generated, the HTML is restored back to normal ASCII braces for easy copy/paste.
224
+ - The plugin converts ASCII `{ }` to fullwidth `{ }` only in `tmp/yard-fence/` so YARD won't treat brace content as reference tags and emit `InvalidLink` warnings. After docs are generated, the HTML is restored back to normal ASCII braces for easy copy/paste.
225
+
226
+ ### Environment Variables
227
+
228
+ | Variable | Default | Description |
229
+ |----------|---------|-------------|
230
+ | `YARD_FENCE_DISABLE` | `false` | Set to `true` to disable all yard-fence processing |
231
+ | `YARD_FENCE_CLEAN_DOCS` | `false` | Set to `true` to clear `docs/` directory before regeneration (prevents stale files) |
232
+ | `YARD_FENCE_SKIP_AT_EXIT` | `0` | Set to `1` to skip the at_exit hook that restores ASCII braces in HTML |
233
+ | `YARD_DEBUG` | `false` | Set to `true` to enable debug output |
234
+
235
+ #### Preventing Stale Files
236
+
237
+ When markdown files are removed from your project, their corresponding HTML files may remain in `docs/`. To ensure a clean build:
238
+
239
+ ```bash
240
+ # Option 1: Use the YARD_FENCE_CLEAN_DOCS environment variable
241
+ YARD_FENCE_CLEAN_DOCS=true bundle exec yard
242
+
243
+ # Option 2: Manually clear the docs directory before running yard
244
+ rm -rf docs/ && bundle exec yard
245
+ ```
246
+
247
+ The `tmp/yard-fence/` staging directory is always cleared automatically before regeneration to prevent stale preprocessed files.
223
248
 
224
249
  ## 🔧 Basic Usage
225
250
 
@@ -365,7 +390,7 @@ the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
365
390
  For example:
366
391
 
367
392
  ```ruby
368
- spec.add_dependency("yard-fence", "~> 0.4")
393
+ spec.add_dependency("yard-fence", "~> 0.8")
369
394
  ```
370
395
 
371
396
  <details markdown="1">
@@ -539,8 +564,6 @@ Thanks for RTFM. ☺️
539
564
  [🚎6-s-wfi]: https://github.com/galtzo-floss/yard-fence/actions/workflows/supported.yml/badge.svg
540
565
  [🚎8-ho-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/hoary.yml
541
566
  [🚎8-ho-wfi]: https://github.com/galtzo-floss/yard-fence/actions/workflows/hoary.yml/badge.svg
542
- [🚎9-t-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/truffle.yml
543
- [🚎9-t-wfi]: https://github.com/galtzo-floss/yard-fence/actions/workflows/truffle.yml/badge.svg
544
567
  [🚎10-j-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/jruby.yml
545
568
  [🚎10-j-wfi]: https://github.com/galtzo-floss/yard-fence/actions/workflows/jruby.yml/badge.svg
546
569
  [🚎11-c-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/current.yml
@@ -594,7 +617,7 @@ Thanks for RTFM. ☺️
594
617
  [📌gitmoji]: https://gitmoji.dev
595
618
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
596
619
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
597
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.121-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
620
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.129-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
598
621
  [🔐security]: SECURITY.md
599
622
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
600
623
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -3,7 +3,7 @@
3
3
  module Yard
4
4
  module Fence
5
5
  module Version
6
- VERSION = "0.8.0"
6
+ VERSION = "0.8.1"
7
7
  end
8
8
  VERSION = Version::VERSION
9
9
  end
data/lib/yard/fence.rb CHANGED
@@ -144,9 +144,15 @@ module Yard
144
144
  end
145
145
 
146
146
  # Copy top-level *.md/*.txt into tmp/yard-fence/ with the above sanitization applied.
147
+ # Clears the staging directory first to prevent stale files from persisting.
147
148
  def prepare_tmp_files
148
149
  root = Dir.pwd
149
150
  outdir = File.join(root, "tmp", "yard-fence")
151
+
152
+ # Clear existing staging directory to prevent stale files from persisting.
153
+ # This ensures that if a markdown file is deleted from the project root,
154
+ # it won't remain in tmp/yard-fence/ and get included in documentation.
155
+ FileUtils.rm_rf(outdir)
150
156
  FileUtils.mkdir_p(outdir)
151
157
 
152
158
  candidates = Dir.glob(File.join(root, GLOB_PATTERN))
@@ -208,12 +214,27 @@ module Yard
208
214
  false
209
215
  end
210
216
 
217
+ # Clear the docs output directory to remove stale generated files.
218
+ # Only runs when YARD_FENCE_CLEAN_DOCS=true is set.
219
+ # This ensures that if a markdown file is deleted from the project,
220
+ # its corresponding HTML file won't remain in docs/.
221
+ def clean_docs_directory
222
+ return unless ENV.fetch("YARD_FENCE_CLEAN_DOCS", "false").casecmp?("true")
223
+
224
+ docs = File.join(Dir.pwd, "docs")
225
+ return unless Dir.exist?(docs)
226
+
227
+ FileUtils.rm_rf(docs)
228
+ puts "[yard/fence] Cleared docs/ directory (YARD_FENCE_CLEAN_DOCS=true)"
229
+ end
230
+
211
231
  def at_load_hook
212
232
  if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
213
233
  # :nocov:
214
234
  warn("[yard/fence] at_load_hook disabled via YARD_FENCE_DISABLE")
215
235
  # :nocov:
216
236
  else
237
+ Yard::Fence.clean_docs_directory
217
238
  Yard::Fence.prepare_tmp_files
218
239
  end
219
240
  rescue => e
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-fence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -201,6 +201,26 @@ dependencies:
201
201
  - - "~>"
202
202
  - !ruby/object:Gem::Version
203
203
  version: '3.0'
204
+ - !ruby/object:Gem::Dependency
205
+ name: kettle-soup-cover
206
+ requirement: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - "~>"
209
+ - !ruby/object:Gem::Version
210
+ version: '1.1'
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: 1.1.1
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - "~>"
219
+ - !ruby/object:Gem::Version
220
+ version: '1.1'
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: 1.1.1
204
224
  - !ruby/object:Gem::Dependency
205
225
  name: kettle-test
206
226
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +230,7 @@ dependencies:
210
230
  version: '1.0'
211
231
  - - ">="
212
232
  - !ruby/object:Gem::Version
213
- version: 1.0.6
233
+ version: 1.0.7
214
234
  type: :development
215
235
  prerelease: false
216
236
  version_requirements: !ruby/object:Gem::Requirement
@@ -220,7 +240,7 @@ dependencies:
220
240
  version: '1.0'
221
241
  - - ">="
222
242
  - !ruby/object:Gem::Version
223
- version: 1.0.6
243
+ version: 1.0.7
224
244
  - !ruby/object:Gem::Dependency
225
245
  name: ruby-progressbar
226
246
  requirement: !ruby/object:Gem::Requirement
@@ -316,10 +336,10 @@ licenses:
316
336
  - MIT
317
337
  metadata:
318
338
  homepage_uri: https://yard-fence.galtzo.com/
319
- source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.8.0
320
- changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.8.0/CHANGELOG.md
339
+ source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.8.1
340
+ changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.8.1/CHANGELOG.md
321
341
  bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
322
- documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.8.0
342
+ documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.8.1
323
343
  funding_uri: https://github.com/sponsors/pboling
324
344
  wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
325
345
  news_uri: https://www.railsbling.com/tags/yard-fence
@@ -348,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
368
  - !ruby/object:Gem::Version
349
369
  version: '0'
350
370
  requirements: []
351
- rubygems_version: 3.7.2
371
+ rubygems_version: 4.0.3
352
372
  specification_version: 4
353
373
  summary: "\U0001F93A A brace converter for the markdown fences in your YARD"
354
374
  test_files: []
metadata.gz.sig CHANGED
Binary file