hoe-halostatue 2.1.2 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c93b2f03ae032c392bc6856ffbd2d06a350d631e3ff859d100e613c289bb57ce
4
- data.tar.gz: 64031107e56a836f7546668403e47920f7a90545e921994e751e8dda0a0e1557
3
+ metadata.gz: 91f8c281c6cce65f4b2eaa54857bd77773b24862c6bba773cce078c6a7019d99
4
+ data.tar.gz: f417d9e2f28ccd274bcb8a37869fba45b87003d7a5ab9b3804f716dda6f85d01
5
5
  SHA512:
6
- metadata.gz: c8445ded0b456a5bac27a042c44f33c867a4055bf8df4116cbe0c9b2f24fa340eb90856eea7c4699c115a90e9121ea303d98cd3804418735d89560441cbcb028
7
- data.tar.gz: 99d4f6c97b6fb790694259a44d1f57f55e7fcba833a8cf332807faae8a20f13780e687bd31733580eaae815194633f3ebfc405c6f0ee2931e2110bb5de9a4a7a
6
+ metadata.gz: 8e972a821fc43ac4a087f58f11e8f54a5c7fd2a2aaaac6353c1c1548f24598c33ea2c34ec90a6720fa73e13c49c6772d07921c5ee28491d251bfc3009027717d
7
+ data.tar.gz: 3801533925fad4cdcf691f0ab762e0e5218574adfd069bac142915569c44ca11fd5698010e605ce493a3010ba22dbeb7c64b98da55291a2f52e0f62b47e25118
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # hoe-halostatue Changelog
2
2
 
3
+ ## 3.0.0 / 2026-01-19
4
+
5
+ - Replaced `hoe-gemspec2` with an internal implementation that improves support
6
+ for [reproducible builds][rb]. The included plugin `hoe-rubygems` was also
7
+ removed as it's duplicative of this work.
8
+
9
+ - Replaced `hoe-markdown` with an internal implementation that uses
10
+ [`kramdown`][kd] for AST-aware Markdown processing when converting GitHub
11
+ references to links. The new implementation correctly handles edge cases like
12
+ email addresses, Mastodon handles, code blocks/spans, existing links, and
13
+ malformed patterns. This was written with the assistance of Kiro.
14
+
15
+ - Internal restructuring was performed to improve readability and optimize some
16
+ flows.
17
+
3
18
  ## 2.1.2 / 2026-01-17
4
19
 
5
20
  - Simplified several functions around git execution.
@@ -40,5 +55,7 @@
40
55
 
41
56
  - Birthday!
42
57
 
58
+ [kd]: https://github.com/gettalong/kramdown
59
+ [rb]: https://reproducible-builds.org/
43
60
  [rsw]: https://github.com/rails/rails/blob/66732971111a62e5940268e1daf7d413c72a234f/tools/strict_warnings.rb
44
61
  [trusted]: https://github.com/rubygems/release-gem
data/CONTRIBUTORS.md CHANGED
@@ -1,26 +1,21 @@
1
1
  # Contributors
2
2
 
3
- - Austin Ziegler ([@halostatue][@halostatue]) created Hoe::Halostatue.
3
+ - Austin Ziegler ([@halostatue][gh-user-halostatue]) created Hoe::Halostatue.
4
4
 
5
5
  It would not be possible without Ryan Davis's [Hoe][hoe] and depends on the work
6
6
  of others in the Ruby community:
7
7
 
8
- - James Tucker ([@raggi][@raggi]) for [`hoe-gemspec2`][hoe-gemspec2].
9
- - James Barnette ([@jbarnette][@jbarnette]) for [`hoe-doofus`][hoe-doofus],
10
- [`hoe-git2`][hoe-git2], and [`hoe-rubygems`][hoe-rubygems].
11
- - Mike Dalessio ([@flavorjones][@flavorjones]) for
8
+ - James Tucker ([@raggi][gh-user-raggi]) for [`hoe-gemspec2`][hoe-gemspec2].
9
+ - James Barnette ([@jbarnette][gh-user-jbarnette]) for
10
+ [`hoe-doofus`][hoe-doofus], [`hoe-git2`][hoe-git2], and
11
+ [`hoe-rubygems`][hoe-rubygems].
12
+ - Mike Dalessio ([@flavorjones][gh-user-flavorjones]) for
12
13
  [`hoe-markdown`][hoe-markdown].
13
- - Samuel Giddins ([@segiddins][@segiddins]) for providing the inspiration to
14
- make all of this work better for trusted publishing for RubyGems.
15
- - Jean Boussier ([@byroot][@byroot]) for creating and pointing me to
14
+ - Samuel Giddins ([@segiddins][gh-user-segiddins]) for providing the inspiration
15
+ to make all of this work better for trusted publishing for RubyGems.
16
+ - Jean Boussier ([@byroot][gh-user-byroot]) for creating and pointing me to
16
17
  [RailsStrictWarnings][rsw].
17
18
 
18
- [@byroot]: https://github.com/byroot
19
- [@flavorjones]: https://github.com/flavorjones
20
- [@halostatue]: https://github.com/halostatue
21
- [@jbarnette]: https://github.com/jbarnette
22
- [@raggi]: https://github.com/raggi
23
- [@segiddins]: https://github.com/segiddins
24
19
  [hoe-doofus]: https://github.com/jbarnette/hoe-doofus
25
20
  [hoe-gemspec2]: https://github.com/raggi/hoe-gemspec2
26
21
  [hoe-git2]: https://github.com/halostatue/hoe-git2
@@ -28,3 +23,9 @@ of others in the Ruby community:
28
23
  [hoe-rubygems]: https://github.com/jbarnette/hoe-rubygems
29
24
  [hoe]: https://github.com/seattlerb/hoe
30
25
  [rsw]: https://github.com/rails/rails/blob/66732971111a62e5940268e1daf7d413c72a234f/tools/strict_warnings.rb
26
+ [gh-user-halostatue]: https://github.com/halostatue
27
+ [gh-user-raggi]: https://github.com/raggi
28
+ [gh-user-jbarnette]: https://github.com/jbarnette
29
+ [gh-user-flavorjones]: https://github.com/flavorjones
30
+ [gh-user-segiddins]: https://github.com/segiddins
31
+ [gh-user-byroot]: https://github.com/byroot
data/LICENCE.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  - SPDX-License-Identifier: [MIT][mit]
4
4
 
5
- - Copyright 2022-2025 Austin Ziegler. Portions copyright 2009 John Barnette.
5
+ - Copyright 2022-2026 Austin Ziegler.
6
+
7
+ - Portions copyright 2009 John Barnette.
8
+ - Portions copyright 2011 James Tucker.
9
+ - Portions copyright 2020–2025 Make Dalessio.
6
10
 
7
11
  The software in this repository is made available under the MIT license.
8
12
 
data/Manifest.txt CHANGED
@@ -8,6 +8,13 @@ README.md
8
8
  Rakefile
9
9
  SECURITY.md
10
10
  lib/hoe/halostatue.rb
11
+ lib/hoe/halostatue/checklist.rb
12
+ lib/hoe/halostatue/gemspec.rb
13
+ lib/hoe/halostatue/git.rb
14
+ lib/hoe/halostatue/markdown.rb
15
+ lib/hoe/halostatue/markdown/linkify.rb
11
16
  lib/hoe/halostatue/strict_warnings.rb
12
17
  lib/hoe/halostatue/version.rb
13
18
  licences/dco.txt
19
+ test/hoe/halostatue/markdown/test_linkify.rb
20
+ test/minitest_helper.rb
data/README.md CHANGED
@@ -12,6 +12,10 @@ Hoe::Halostatue is a [Hoe][hoe] meta-plugin that provides improved support for
12
12
  Markdown README files, provides features from other plugins, and enables
13
13
  improved support for [trusted publishing][tp].
14
14
 
15
+ Hoe::Halostatue 3.0 incorporates functionality derived from
16
+ [`hoe-gemspec2`][hgs2] with more support for [reproducible builds][rb] and
17
+ replaces [`hoe-markdown`][hmd] with an internal implementation.
18
+
15
19
  ## Examples
16
20
 
17
21
  ```ruby
@@ -21,22 +25,22 @@ Hoe.plugin :halostatue
21
25
  Hoe.spec "myproj" do
22
26
  self.checklist = nil if ENV["rubygems_release_gem"] == "true"
23
27
  self.git_tag_enabled = ENV["rubygems_release_gem"] != "true"
28
+ self.reproducible_gemspec = true
24
29
  # ...
25
30
  end
26
31
  ```
27
32
 
28
- If this plugin cannot see that it is in a `.git` directory, `hoe-git2` derived
29
- features will be deactivated.
30
-
31
33
  ## Features
32
34
 
33
- Hoe::Halostatue automatically enables Hoe plugins
34
- [`hoe-gemspec2`][hoe-gemspec2], [`hoe-markdown`][hoe-markdown], and
35
- [`hoe-rubygems`][hoe-rubygems].
35
+ - Improved Markdown support through functionality derived from
36
+ [`hoe-markdown`][hmd].
36
37
 
37
- With version 2, the functionality of [`hoe-doofus`][hoe-doofus] and
38
- [`hoe-git2`][hoe-git2] have been incorporated into Hoe::Halostatue to improve
39
- automated release support.
38
+ - Improved manual release support by adding a display checklist as a reminder of
39
+ tasks frequently forgotten, inspired by [`hoe-doofus`][hd].
40
+
41
+ - Improved support of automated releases and reproducible builds by
42
+ incorporating modified versions of [`hoe-git2`][hg2] and
43
+ [`hoe-gemspec2`][hgs2].
40
44
 
41
45
  ### Improved Metadata URL Parsing
42
46
 
@@ -57,16 +61,189 @@ known aliases for the various RubyGems URI meta keys.
57
61
  | `wiki_uri` | `wiki` |
58
62
  | `mailing_list_uri` | `mail` |
59
63
 
64
+ ### Markdown Support
65
+
66
+ Hoe::Halostatue used code originally developed in [`hoe-markdown`][hmd].
67
+
68
+ #### History and README Files
69
+
70
+ Hoe was originally written before Markdown support was pervasive in software
71
+ forges and before RubyDocs supported Markdown rendering. It assumes that your
72
+ README is `README.txt` and that your changelog file is `History.txt`.
73
+
74
+ As a maintainer, you need to opt out of this — unless you use `hoe-markdown` or
75
+ Hoe::Halostatue, which allows you to remove this modification from your
76
+ `Rakefile`:
77
+
78
+ ```ruby
79
+ Hoe.spec "projectname" do
80
+ # ...
81
+ self.history_file = "CHANGELOG.md"
82
+ self.readme_file = "README.md"
83
+ # ...
84
+ end
85
+ ```
86
+
87
+ Specifically, Hoe::Halostatue will use `README.md` if it exists for
88
+ `spec.readme_file`, and will use case-insensitive matching against
89
+ `CHANGELOG.md` or `HISTORY.md` for your history file. `CHANGELOG` is preferred
90
+ over `HISTORY`, and exact matches are preferred over case-insensitive matches.
91
+
92
+ ```diff
93
+ Hoe.spec "projectname" do
94
+ # ...
95
+ - self.history_file = "CHANGELOG.md"
96
+ - self.readme_file = "README.md"
97
+ # ...
98
+ end
99
+ ```
100
+
101
+ #### Automatically Link to GitHub
102
+
103
+ A rake task `markdown:linkify` is created that automatically converts GitHub
104
+ references to hyperlinks in your Markdown files and bare hyperlinks to readable
105
+ links.
106
+
107
+ | Input | Output |
108
+ | ----------------------------------------------- | ----------------------------------------------------------------- |
109
+ | `@username` | `[@username](https://github.com/username)` |
110
+ | `https://github.com/username` | `[@username](https://github.com/username)` |
111
+ | `https://github.com/owner/repo` | `[owner/repo](https://github.com/owner/repo)` |
112
+ | `owner/repo#123` | `[owner/repo#123](https://github.com/owner/repo/issues/123)` |
113
+ | `https://github.com/owner/repo/issues/123` | `[owner/repo#123](https://github.com/owner/repo/issues/123)` |
114
+ | `https://github.com/owner/repo/pull/123` | `[owner/repo#123](https://github.com/owner/repo/pull/123)` |
115
+ | `https://github.com/owner/repo/discussions/123` | `[owner/repo#123](https://github.com/owner/repo/discussions/123)` |
116
+
117
+ Issue, pull request, and discussion links to comments will be rendered with
118
+ `(comment)` appended:
119
+
120
+ | Input | Output |
121
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
122
+ | `https://github.com/owner/repo/issues/123#issuecomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/issues/123#issuecomment-987)` |
123
+ | `https://github.com/owner/repo/pull/123#issuecomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/pull/123#issuecomment-987)` |
124
+ | `https://github.com/owner/repo/discussions/123#discussioncomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/discussions/123#discussioncomment-987)` |
125
+
126
+ Query parameters and fragments are preserved in the link URL:
127
+
128
+ | Input | Output |
129
+ | -------------------------------------------------- | -------------------------------------------------------------------- |
130
+ | `https://github.com/owner/repo/issues/123?foo=bar` | `[owner/repo#123](https://github.com/owner/repo/issues/123?foo=bar)` |
131
+ | `https://github.com/owner/repo/issues/123#heading` | `[owner/repo#123](https://github.com/owner/repo/issues/123#heading)` |
132
+
133
+ > [!NOTE]
134
+ >
135
+ > If `spec.metadata["bug_tracker_uri"]` points to a GitHub repo, link labels to
136
+ > that repo are shortened:
137
+ >
138
+ > | Input | Output Link Text |
139
+ > | ----------------------------------------------------------- | -------------------------- |
140
+ > | `https://github.com/your/repo/issues/123` | `#123` |
141
+ > | `https://github.com/your/repo/issues/123#issuecomment-789` | `#123 (comment)` |
142
+ > | `https://github.com/other/repo/issues/456` | `other/repo#456` |
143
+ > | `https://github.com/other/repo/issues/456#issuecomment-987` | `other/repo#456 (comment)` |
144
+
145
+ > [!IMPORTANT]
146
+ >
147
+ > Link transformation will be skipped in the following cases:
148
+ >
149
+ > - Patterns in code blocks (`` ``` ``) or code spans (`` ` ``)
150
+ > - Patterns already in links: `[#123](url)` or `<https://...>`
151
+ > - Email addresses: `user@example.com`
152
+ > - Mastodon handles: `@user@instance.com`
153
+ > - Invalid usernames[^2]: `@-invalid`, `@foo--bar`
154
+
155
+ The rest of your Markdown documentation should be unmodified.
156
+
157
+ ##### Example
158
+
159
+ If your README sets the `spec.metadata["bug_tracker_uri"]` to
160
+ `https://github.com/cogswellcogs/sprocketkiller/issues`[^3], when you
161
+ `markdown:linkify` against the CHANGELOG that looks like this:
162
+
163
+ ```markdown
164
+ # Changelog
165
+
166
+ ## v1.0.0
167
+
168
+ Bugfix: Frobnicate the transmogrifier. #123 Thanks, @hobbes!
169
+
170
+ Feature: Finagle the sprocket. See
171
+ https://github.com/cogswellcogs/sprocketkiller/pull/456#issuecomment-987
172
+ ```
173
+
174
+ it is transformed to:
175
+
176
+ ```markdown
177
+ # Changelog
178
+
179
+ ## v1.0.0
180
+
181
+ Bugfix: Frobnicate the transmogrifier. [#123][gh-issue-123] Thanks,
182
+ [@hobbes][gh-user-hobbes]!
183
+
184
+ Feature: Finagle the sprocket. See [#456 (comment)][gh-issue-456-987]
185
+
186
+ [gh-user-hobbes]: https://github.com/hobbes
187
+ [gh-issue-123]: https://github.com/cogswellcogs/sprocketkiller/issues/123
188
+ [gh-issue-456-987]: https://github.com/cogswellcogs/sprocketkiller/pull/456#issuecomment-987
189
+ ```
190
+
191
+ ### Link Generation Options
192
+
193
+ All Markdown files in your `Manifest.txt` will be processed by
194
+ `markdown:linkify`, unless modified by `spec.markdown_linkify_files`.
195
+
196
+ - `spec.markdown_linkify_files` (default `[:default]`): The list of files to
197
+ process. If the list value contains `:default`, then all `.md` files in the
198
+ manifest will be included.
199
+
200
+ Files may be excluded from the list by adding `{exclude: patterns}` to the
201
+ list, where `patterns` is a glob pattern string, a regular expression, or a
202
+ list of glob pattern strings or regular expressions.
203
+
204
+ ```ruby
205
+ self.markdown_linkify_files << {exclude: "licences/*"}
206
+ ```
207
+
208
+ This will exclude any link found in files in the `licenses/` directory.
209
+
210
+ - `spec.markdown_linkify_style` (default `:reference`): The style for producing
211
+ links. Valid values are:
212
+
213
+ - `:reference`, which will produce named reference links (e.g.,
214
+ `[#123][gh-issue-123]`)
215
+ - `:inline`, which produces inline links (e.g., `[#123](https://…)`)
216
+
217
+ Existing links _will not be modified_.
218
+
219
+ When using reference links, existing reference link definitions will not be
220
+ moved, but new definitions will be appended to the end of the file.
221
+
222
+ - `spec.markdown_linkify_uri_prefixes` (default `nil`): Controls whether
223
+ shortened URIs for the current repository have prefixes added to them. This is
224
+ either falsy (no prefixes added), `true` default prefixes are added, or a map
225
+ with one or more type (`issue`, `pull`, `discussion`) and the prefix to be
226
+ applied. The default prefixes (when `true`) are
227
+ `{issue: 'issue', pull: 'pull', discussion: 'discussion'}`.
228
+
229
+ Examples (assuming `true`):
230
+
231
+ ```markdown
232
+ [issue #123](https://github.com/cogswellcogs/sprocketkiller/issues/123
233
+ [pull #246](https://github.com/cogswellcogs/sprocketkiller/pull/246)
234
+ [discussion #369](https://github.com/cogswellcogs/sprocketkiller/discussions/369)
235
+ ```
236
+
60
237
  ### Automated Release Support
61
238
 
62
- Certain features offered by Hoe plugins supported are useful for manual
63
- releases, but work against automated releases (see [trusted publishing][tp]).
239
+ Certain features offered by Hoe plugins are useful for manual releases but work
240
+ against automated releases (see [trusted publishing][tp]).
64
241
 
65
- - `hoe-doofus` has been replaced with an internal implementation that disables
66
- the display if the release checklist is unset or empty.
242
+ - The checklist feature will be disabled when trusted publishing is turned on or
243
+ the checklist is unset or empty.
67
244
 
68
- - `hoe-git2` has been incorporated into Hoe::Halostatue, but the pieces which
69
- affect release can be disabled through configuration.
245
+ - Automatic release tagging is enabled by default, but may be disabled when
246
+ using release triggers like [release-please][rp].
70
247
 
71
248
  In the example below, the release checklist and Git tag creation will be
72
249
  disabled if `$rubygems_release_gem` is `true`.
@@ -83,7 +260,8 @@ end
83
260
 
84
261
  ### Release Checklist (from `hoe-doofus`)
85
262
 
86
- The release checklist feature has been incorporated from `hoe-doofus`.
263
+ The release checklist feature has been incorporated from `hoe-doofus`, described
264
+ as:
87
265
 
88
266
  > A Hoe plugin that helps me (and you, maybe?) keep from messing up gem
89
267
  > releases. It shows a configurable checklist when `rake release` is run, and
@@ -105,15 +283,19 @@ Hoe.spec "myproj" do
105
283
  end
106
284
  ```
107
285
 
286
+ The checklist is automatically disabled when executing a trusted publishing
287
+ workflow.
288
+
108
289
  ### Git Integration Tasks (from `hoe-git2`)
109
290
 
110
- Support for generating the CHANGELOG from the git commit messages has not been
111
- incorporated into Hoe::Halostatue.
291
+ If Hoe::Halostatue cannot see that it is in a `.git` repository, these features
292
+ will be deactivated.
112
293
 
113
294
  #### Generating the Manifest
114
295
 
115
296
  The `Manifest.txt` required by Hoe can be generated with `rake git:manifest`.
116
- This uses `git ls-files`, respecting the Hoe manifest sort order and excludes.
297
+ This uses `git ls-files`, respecting the Hoe manifest sort order and `.hoerc`
298
+ excludes.
117
299
 
118
300
  #### Tagging and Sanity Checking a Release
119
301
 
@@ -129,7 +311,8 @@ be created and pushed to the `origin` remote.
129
311
  $ rake git:tag VERSION=1.0.0 PRERELEASE=beta.1
130
312
  ```
131
313
 
132
- The tag prefix can be with `self.git_release_tag_prefix`, which defaults to `v`.
314
+ The tag prefix can be set with `self.git_release_tag_prefix`, which defaults to
315
+ `v`.
133
316
 
134
317
  The created tag can be pushed to different remotes with `self.git_remotes`,
135
318
  which defaults to `["origin"]`.
@@ -140,18 +323,84 @@ The tag will automatically be created when a release is pushed:
140
323
  $ rake release VERSION=1.0.0 PRERELEASE=beta.1
141
324
  ```
142
325
 
326
+ #### Features Not Included
327
+
328
+ Support for generating the CHANGELOG from the git commit messages has not been
329
+ incorporated into Hoe::Halostatue. There are better tools for producing a
330
+ changelog automatically (such as [changie][cg] or [cocogitto][cc]), and I prefer
331
+ to manage my changelogs by hand.
332
+
333
+ Listing the applied tags is better done with `git tag`.
334
+
335
+ ### Regenerating the Gem Spec (from `hoe-gemspec2`)
336
+
337
+ The ability to regenerate the gem specification using `rake gemspec` has been
338
+ added from `hoe-gemspec2`. This variant adds support for reproducible builds to
339
+ the spec generation.
340
+
341
+ Note that `rake gemspec:full` has been removed; there is no support for RubyGems
342
+ `signing_key` and `cert_chain`.
343
+
344
+ #### Reproducible Build Support
345
+
346
+ > [!NOTE]
347
+ >
348
+ > Documentation on reproducible builds in RubyGems is fairly thin, but this
349
+ > amounts to having a fixed date set for the specification `date`, which is also
350
+ > used to ensure that all files have the same date.
351
+
352
+ Reproducible builds are primarily performed by setting the value of
353
+ `$SOURCE_DATE_EPOCH`. If unset, RubyGems will use a fixed date (1980-01-02), but
354
+ only when building the gem.
355
+
356
+ The Hoe::Halostatue implementation of the `gemspec` task will set the generated
357
+ specification date and `$SOURCE_DATE_EPOCH` for proper handling by the RubyGems
358
+ build process.
359
+
360
+ > [!IMPORTANT]
361
+ >
362
+ > Most projects will use the default reproducible builds behaviour and should
363
+ > not have `$SOURCE_DATE_EPOCH` set when publishing releases (either manually or
364
+ > in CI environments).
365
+
366
+ For other cases, `$SOURCE_DATE_EPOCH` is used if it is set, or behaviour is
367
+ controlled by the `spec.reproducible_gemspec` option.
368
+
369
+ - `:default` / `true`: uses the default RubyGems behaviour, setting the date to
370
+ `1980-01-02`
371
+
372
+ - `:current`: uses the date in the current gem `gemspec` file, or falls back to
373
+ the default RubyGems behaviour
374
+
375
+ - `false`: disables reproducible builds as much as possible
376
+
377
+ - Integer or String values: parsed as the integer source date epoch as seconds
378
+ from the Unix epoch
379
+
380
+ The default `spec.reproducible_gemspec` value is `:default`.
381
+
143
382
  ### Trusted Release
144
383
 
384
+ > [!IMPORTANT]
385
+ >
386
+ > Trusted releases should only be enabled when using a [trusted publishing][tp]
387
+ > workflow. It is strongly recommended that all gem releases be performed with
388
+ > such a workflow.
389
+
145
390
  If `spec.trusted_release` is set to `true` changes will be made to the `release`
146
- workflow. This flag is intended to be used only with a [trusted publishing][tp]
147
- workflow. It will bypass certain protections offered by Hoe and Hoe::Halostatue:
391
+ workflow. It will bypass certain manual release protections offered by Hoe and
392
+ Hoe::Halostatue:
148
393
 
149
394
  - The version discovered by Hoe will be trusted as correct, removing the need
150
395
  for specifying the version.
151
396
 
152
397
  - The release checklist will be skipped.
153
398
 
154
- ### Strict Warnings
399
+ ### Strict Deprecation Warnings
400
+
401
+ Deprecation warnings signal code that will break in future Ruby or gem versions.
402
+ Making warnings strict during tests catches these issues early, before they
403
+ reach production or complicate upgrades.
155
404
 
156
405
  Warnings can be made strict (an exception will be thrown) for tests by adding
157
406
  the following to your test or spec helper file (`test/minitest_helper.rb` or
@@ -161,7 +410,7 @@ the following to your test or spec helper file (`test/minitest_helper.rb` or
161
410
  require "hoe/halostatue/strict_warnings"
162
411
 
163
412
  # Optional but recommended to avoid getting warnings outside of your code.
164
- Hoe::Halostatue::StrictWarnings.project_root = File.expand_path("../", __dir__)
413
+ Hoe::Halostatue::StrictWarnings.project_root = File.expand_path(__dir__, "../")
165
414
 
166
415
  # Optional regex patterns to suppress. Suppressed messages will not be printed
167
416
  # to standard error. The patterns provided will be converted to a single regex
@@ -182,7 +431,7 @@ This is based on [RailsStrictWarnings][rsw].
182
431
 
183
432
  ## Dependencies
184
433
 
185
- Hoe and Git 2.37 or later.
434
+ Hoe 4 and Git 2.37 or later.
186
435
 
187
436
  ## Installation
188
437
 
@@ -190,11 +439,25 @@ Hoe and Git 2.37 or later.
190
439
  $ gem install hoe-halostatue
191
440
  ```
192
441
 
193
- [hoe-doofus]: https://github.com/jbarnette/hoe-doofus
194
- [hoe-gemspec2]: https://github.com/raggi/hoe-gemspec2
195
- [hoe-git2]: https://github.com/halostatue/hoe-git2
196
- [hoe-markdown]: https://github.com/flavorjones/hoe-markdown
197
- [hoe-rubygems]: https://github.com/jbarnette/hoe-rubygems
442
+ [^1]: Also includes discussions and pull requests
443
+
444
+ [^2]: GitHub username may only contain alphanumeric characters or hyphens, may
445
+ not have multiple consecutive hyphens, may not begin or end with a hyphen,
446
+ and may have at most 39 characters.
447
+
448
+ [^3]: ```markdown
449
+ - bugs: <https://github.com/cogswellcogs/sprocketkiller/issues
450
+ ```
451
+
452
+ [cc]: https://docs.cocogitto.io
453
+ [cg]: https://changie.dev
454
+ [hd]: https://github.com/jbarnette/hoe-doofus
455
+ [hg2]: https://github.com/halostatue/hoe-git2
456
+ [hgs2]: https://github.com/raggi/hoe-gemspec2
457
+ [hmd]: https://github.com/flavorjones/hoe-markdown
198
458
  [hoe]: https://github.com/seattlerb/hoe
459
+ [rb]: https://reproducible-builds.org/
460
+ [rp]: https://github.com/googleapis/release-please
199
461
  [rsw]: https://github.com/rails/rails/blob/66732971111a62e5940268e1daf7d413c72a234f/tools/strict_warnings.rb
200
462
  [tp]: https://guides.rubygems.org/trusted-publishing/
463
+ [lgo]: #link-generation-options
data/Rakefile CHANGED
@@ -6,6 +6,8 @@ require "rubygems"
6
6
  require "hoe"
7
7
  require "rake/clean"
8
8
  require "rdoc/task"
9
+ require "minitest"
10
+ require "minitest/test_task"
9
11
 
10
12
  Hoe.plugin :halostatue
11
13
  Hoe.plugins.delete :debug
@@ -23,18 +25,51 @@ hoe = Hoe.spec "hoe-halostatue" do
23
25
  license "MIT"
24
26
 
25
27
  spec_extras[:metadata] = ->(val) {
26
- val.merge!({"rubygems_mfa_required" => "true"})
28
+ val["rubygems_mfa_required"] = "true"
27
29
  }
28
30
 
29
- extra_deps << ["hoe", ">= 3.0", "< 5"]
30
- extra_deps << ["hoe-gemspec2", "~> 1.4"]
31
- extra_deps << ["hoe-markdown", "~> 1.6"]
32
- extra_deps << ["hoe-rubygems", "~> 1.0"]
31
+ extra_deps << ["hoe", "~> 4.0"]
32
+ extra_deps << ["kramdown", "~> 2.3"]
33
+ extra_deps << ["kramdown-parser-gfm", "~> 1.1"]
33
34
 
34
- extra_dev_deps << ["standard", "~> 1.0"]
35
- extra_dev_deps << ["rdoc", ">= 5.0", "< 8"]
35
+ extra_dev_deps << ["minitest", "~> 6.0"]
36
+ extra_dev_deps << ["minitest-autotest", "~> 1.0"]
37
+ extra_dev_deps << ["minitest-focus", "~> 1.1"]
38
+ extra_dev_deps << ["rake", ">= 10.0", "< 14"]
39
+ extra_dev_deps << ["rdoc", ">= 6.0", "< 8"]
40
+ extra_dev_deps << ["simplecov", "~> 0.22"]
41
+ extra_dev_deps << ["simplecov-lcov", "~> 0.8"]
42
+ extra_dev_deps << ["standard", "~> 1.50"]
36
43
  end
37
44
 
45
+ Minitest::TestTask.create :test
46
+ Minitest::TestTask.create :coverage do |t|
47
+ formatters = <<-RUBY.split($/).join(" ")
48
+ SimpleCov::Formatter::MultiFormatter.new([
49
+ SimpleCov::Formatter::HTMLFormatter,
50
+ SimpleCov::Formatter::LcovFormatter,
51
+ SimpleCov::Formatter::SimpleFormatter
52
+ ])
53
+ RUBY
54
+ t.test_prelude = <<-RUBY.split($/).join("; ")
55
+ require "simplecov"
56
+ require "simplecov-lcov"
57
+
58
+ SimpleCov::Formatter::LcovFormatter.config do |config|
59
+ config.report_with_single_file = true
60
+ config.lcov_file_name = "lcov.info"
61
+ end
62
+
63
+ SimpleCov.start "test_frameworks" do
64
+ enable_coverage :branch
65
+ primary_coverage :branch
66
+ formatter #{formatters}
67
+ end
68
+ RUBY
69
+ end
70
+
71
+ task default: :test
72
+
38
73
  task :version do
39
74
  require "hoe/halostatue/version"
40
75
  puts Hoe::Halostatue::VERSION
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hoe::Halostatue::Checklist
4
+ # An array of reminder questions that should be asked before a release, in the form,
5
+ attr_accessor :checklist
6
+
7
+ private
8
+
9
+ def initialize_halostatue_checklist
10
+ self.checklist = [
11
+ "bump the version",
12
+ "check everything in",
13
+ "review the manifest",
14
+ "update the README and docs",
15
+ "update the changelog",
16
+ "regenerate the gemspec"
17
+ ]
18
+ end
19
+
20
+ def define_halostatue_checklist_tasks
21
+ desc "Show a reminder for steps frequently forgotten in a manual release"
22
+ task :checklist do
23
+ if checklist.nil? || checklist.empty?
24
+ puts "Checklist is empty."
25
+ else
26
+ puts "\n### HEY! Did you...\n\n"
27
+
28
+ checklist.each do |question|
29
+ question = question[0..0].upcase + question[1..]
30
+ question = "#{question}?" unless question.end_with?("?")
31
+ puts " * #{question}"
32
+ end
33
+
34
+ puts
35
+ end
36
+ end
37
+
38
+ task :release_sanity do
39
+ unless checklist.nil? || checklist.empty? || trusted_release
40
+ Rake::Task[:checklist].invoke
41
+ puts "Hit return if you're sure, Ctrl-C if you forgot something."
42
+ $stdin.gets
43
+ end
44
+ end
45
+ end
46
+ end