hoe-halostatue 1.0.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad97817e3c7c25d416ce2d84fd8768ef988585984ec9c121faeead466a7f6eae
4
- data.tar.gz: e4909280d9be7adbb5bfc781830554850b94c42f466f6445cb66959654c14960
3
+ metadata.gz: b19e26f2b478d5b4f6f3e3f9df2ce7daa349871c81ba5be8d842c9aefe157584
4
+ data.tar.gz: 72de2f56fcf575787e2a776c77a22e46e69a740b554defefad17a7eff99370db
5
5
  SHA512:
6
- metadata.gz: 30f90f79f0f6170a551602bc77b9d68e1abfb2df5ded177ff37f12b7a5a6d6125f1819a4062e115355af84ef16aa10ebf385b9f7ace9560b058ec666ee87b5bf
7
- data.tar.gz: 3afd08e69cec5931e41fa5f66f395b76e29f40f85a92ef2c9715da93c14efdd6b8bc5447c2cf7cd6d651c08450907f53ac927f1864aa7adb061c4ef80bc15372
6
+ metadata.gz: 984b0a2599039fd0eae94a72f5565d13d4b12a0924f27a7048332c989fd1e4ecd647f4350f42ae976bfea168978f93bb244536e238665fd08fb38d294f973366
7
+ data.tar.gz: daabe4505ba07b2ff42f9356cbfa45d8da4cc68092ab21d9baded8b302e16d17873076bea73d91da6b4b569c9f5df010a38a8647d1001225882fa606618b8cb4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # hoe-halostatue Changelog
2
2
 
3
+ ## 2.0.0 / 2025-02-19
4
+
5
+ - Directly incorporate the functionality of `hoe-doofus` and `hoe-git2` into
6
+ `hoe-halostatue` and make it possible to disable features that would block
7
+ automated releases via [rubygems/release-gem][trusted].
8
+
9
+ - Minor improvements to `Hoe#parse_urls` for Markdown READMEs so that wrapped
10
+ URLs work.
11
+
12
+ - Added a `trusted_release` mode that skips the need for a `VERSION` specifier
13
+ on the release task and ensures that features which impede automated releases
14
+ are disabled.
15
+
16
+ - Enabled trusted publishing for this repo.
17
+
3
18
  ## 1.0.1 / 2024-12-31
4
19
 
5
20
  - Birthday!
21
+
22
+ [trusted]: https://github.com/rubygems/release-gem
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at [INSERT CONTACT
63
+ METHOD]. All complaints will be reviewed and investigated promptly and fairly.
64
+
65
+ All community leaders are obligated to respect the privacy and security of the
66
+ reporter of any incident.
67
+
68
+ ## Enforcement Guidelines
69
+
70
+ Community leaders will follow these Community Impact Guidelines in determining
71
+ the consequences for any action they deem in violation of this Code of Conduct:
72
+
73
+ ### 1. Correction
74
+
75
+ **Community Impact**: Use of inappropriate language or other behavior deemed
76
+ unprofessional or unwelcome in the community.
77
+
78
+ **Consequence**: A private, written warning from community leaders, providing
79
+ clarity around the nature of the violation and an explanation of why the
80
+ behavior was inappropriate. A public apology may be requested.
81
+
82
+ ### 2. Warning
83
+
84
+ **Community Impact**: A violation through a single incident or series of
85
+ actions.
86
+
87
+ **Consequence**: A warning with consequences for continued behavior. No
88
+ interaction with the people involved, including unsolicited interaction with
89
+ those enforcing the Code of Conduct, for a specified period of time. This
90
+ includes avoiding interactions in community spaces as well as external channels
91
+ like social media. Violating these terms may lead to a temporary or permanent
92
+ ban.
93
+
94
+ ### 3. Temporary Ban
95
+
96
+ **Community Impact**: A serious violation of community standards, including
97
+ sustained inappropriate behavior.
98
+
99
+ **Consequence**: A temporary ban from any sort of interaction or public
100
+ communication with the community for a specified period of time. No public or
101
+ private interaction with the people involved, including unsolicited interaction
102
+ with those enforcing the Code of Conduct, is allowed during this period.
103
+ Violating these terms may lead to a permanent ban.
104
+
105
+ ### 4. Permanent Ban
106
+
107
+ **Community Impact**: Demonstrating a pattern of violation of community
108
+ standards, including sustained inappropriate behavior, harassment of an
109
+ individual, or aggression toward or disparagement of classes of individuals.
110
+
111
+ **Consequence**: A permanent ban from any sort of public interaction within the
112
+ community.
113
+
114
+ ## Attribution
115
+
116
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117
+ version 2.1, available at
118
+ <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
119
+
120
+ Community Impact Guidelines were inspired by
121
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
122
+
123
+ For answers to common questions about this code of conduct, see the FAQ at
124
+ <https://www.contributor-covenant.org/faq>. Translations are available at
125
+ <https://www.contributor-covenant.org/translations>.
126
+
127
+ [homepage]: https://www.contributor-covenant.org
128
+ [Mozilla CoC]: https://github.com/mozilla/diversity
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,35 @@
1
+ # Contributing
2
+
3
+ I value any contribution to Hoe::Halostatue you can provide: a bug report, a
4
+ feature request, or code contributions. There are a few guidelines for
5
+ contributing to Hoe::Halostatue:
6
+
7
+ - Match my coding style.
8
+ - Use a thoughtfully-named topic branch that contains your change. Rebase your
9
+ commits into logical chunks as necessary.
10
+ - Use [quality commit messages][quality commit messages].
11
+ - Do not change the version number; when your patch is accepted and a release is
12
+ made, the version will be updated at that point.
13
+ - Submit a GitHub pull request with your changes.
14
+ - New or changed behaviours require appropriate documentation.
15
+
16
+ Hoe::Halostatue uses Ryan Davis's [Hoe][Hoe] to manage the release process, and
17
+ it adds a number of rake tasks.
18
+
19
+ ## Workflow
20
+
21
+ Here's the most direct way to get your work merged into the project:
22
+
23
+ - Fork the project.
24
+ - Clone your fork (`git clone git://github.com/<username>/hoe-halostatue.git`).
25
+ - Create a topic branch to contain your change
26
+ (`git checkout -b my_awesome_feature`).
27
+ - Hack away, add tests. Not necessarily in that order.
28
+ - Make sure everything still passes by running `rake`.
29
+ - If necessary, rebase your commits into logical chunks, without errors.
30
+ - Push the branch up (`git push origin my_awesome_feature`).
31
+ - Create a pull request against halostatue/hoe-halostatue and describe what your
32
+ change does and the why you think it should be merged.
33
+
34
+ [quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
35
+ [hoe]: https://github.com/seattlerb/hoe
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,20 @@
1
+ # Contributors
2
+
3
+ - Austin Ziegler created Hoe::Halostatue.
4
+
5
+ It would not be possible without Ryan Davis's [Hoe][hoe] and depends on the work
6
+ of others in the Ruby community:
7
+
8
+ - James Tucker (@raggi) for [`hoe-gemspec2`][hoe-gemspec2]
9
+ - James Barnette (@jbarnette) for [`hoe-doofus`][hoe-doofus],
10
+ [`hoe-git2`][hoe-git2], and [`hoe-rubygems`][hoe-rubygems]
11
+ - Mike Dalessio (@flavorjones) for [`hoe-markdown`][hoe-markdown]
12
+ - Samuel Giddins (@segiddins) for providing the inspiration to make all of this
13
+ work better for trusted publishing for RubyGems.
14
+
15
+ [hoe]: https://github.com/seattlerb/hoe
16
+ [hoe-doofus]: https://github.com/jbarnette/hoe-doofus
17
+ [hoe-gemspec2]: https://github.com/raggi/hoe-gemspec2
18
+ [hoe-git2]: https://github.com/halostatue/hoe-git2
19
+ [hoe-markdown]: https://github.com/flavorjones/hoe-markdown
20
+ [hoe-rubygems]: https://github.com/jbarnette/hoe-rubygems
data/LICENCE.md ADDED
@@ -0,0 +1,24 @@
1
+ ## Licence
2
+
3
+ Hoe::Halostatue is free software available under the MIT licence.
4
+
5
+ Copyright 2022-2025 Austin Ziegler (halostatue@gmail.com)
6
+
7
+ Portions copyright 2009 John Barnette
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
10
+ this software and associated documentation files (the 'Software'), to deal in
11
+ the Software without restriction, including without limitation the rights to
12
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13
+ the Software, and to permit persons to whom the Software is furnished to do so,
14
+ subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest.txt CHANGED
@@ -1,5 +1,11 @@
1
1
  CHANGELOG.md
2
+ CODE_OF_CONDUCT.md
3
+ CONTRIBUTING.md
4
+ CONTRIBUTORS.md
5
+ LICENCE.md
2
6
  Manifest.txt
3
7
  README.md
4
8
  Rakefile
9
+ SECURITY.md
5
10
  lib/hoe/halostatue.rb
11
+ lib/hoe/halostatue/version.rb
data/README.md CHANGED
@@ -1,66 +1,159 @@
1
- # Hoe - Halostatue Meta-Plugin
1
+ # Hoe::Halostatue Meta-Plugin
2
+
3
+ - home :: <https://github.com/halostatue/halostatue-data/>
4
+ - issues :: <https://github.com/halostatue/halostatue-data/issues>
5
+ - code :: <https://github.com/halostatue/halostatue-data/>
6
+ - changelog ::
7
+ <https://github.com/halostatue/halostatue-data/blob/main/CHANGELOG.md>
2
8
 
3
9
  ## Description
4
10
 
5
- Hoe::Halostatue is a [Hoe][hoe] meta-plugin that ensures that the following
6
- plugins are installed and enabled for your project:
11
+ Hoe::Halostatue is a [Hoe][hoe] meta-plugin that provides improved support for
12
+ Markdown README files, provides features from other plugins, and enables
13
+ improved support for [trusted publishing][tp].
7
14
 
8
- - [`hoe-doofus`][hoe-doofus]
9
- - [`hoe-gemspec2`][hoe-gemspec2]
10
- - [`hoe-git2`][hoe-git2]
11
- - [`hoe-markdown`][hoe-markdown]
12
- - [`hoe-rubygems`][hoe-rubygems]
15
+ ## Examples
13
16
 
14
- It also provides an improved implementation for `Hoe#parse_urls` that works
15
- better with a Markdown README. It allows either `*` or `-` as list leaders for
16
- the README. It also allows the URLs to be blank. Double colons are still
17
- required for pattern matching.
17
+ ```ruby
18
+ # In your Rakefile
19
+ Hoe.plugin :halostatue
18
20
 
19
- In addition to the four letter aliases in `Hoe::URLS_TO_META_MAP` (`bugs`,
20
- `clog`, `doco`, `docs`, `home`, `code`, `wiki`, and `mail`), this adds:
21
+ Hoe.spec "myproj" do
22
+ self.checklist = nil if ENV["rubygems_release_gem"] == "true"
23
+ self.git_tag_enabled = ENV["rubygems_release_gem"] != "true"
24
+ # ...
25
+ end
26
+ ```
21
27
 
22
- - `changelog`, `changes`, and `history` as aliases for `changelog_uri`
23
- - `documentation` for `documentation_uri`
24
- - `issues` and `tickets` for `bug_tracker_uri`
28
+ If this plugin cannot see that it is in a `.git` directory, `hoe-git2` derived
29
+ features will be deactivated.
25
30
 
26
- ## Examples
31
+ ## Features
32
+
33
+ Hoe::Halostatue automatically enables Hoe plugins
34
+ [`hoe-gemspec2`][hoe-gemspec2], [`hoe-markdown`][hoe-markdown], and
35
+ [`hoe-rubygems`][hoe-rubygems].
36
+
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.
40
+
41
+ ### Improved Metadata URL Parsing
42
+
43
+ Hoe::Halostatue provides an improved implementation for `Hoe#parse_urls`. The
44
+ expected format is more or less the same, but accepts any left-aligned Markdown
45
+ list (beginning with `-`, `+`, or `*`) and handles lists that wrap lines (such
46
+ as the `changelog` entry at the top of this file).
47
+
48
+ It is more strict than the default `Hoe#parse_urls` because it only accepts the
49
+ known aliases for the various RubyGems URI meta keys.
50
+
51
+ | RubyGems URI Meta Key | Alias |
52
+ | --------------------- | ----------------------------------------- |
53
+ | `documentation_uri` | `doco`, `docs`, `documentation` |
54
+ | `bug_tracker_uri` | `bugs`, `issues`, `tickets` |
55
+ | `changelog_uri` | `clog`, `changelog`, `changes`, `history` |
56
+ | `homepage_uri` | `home`, `homepage` |
57
+ | `wiki_uri` | `wiki` |
58
+ | `mailing_list_uri` | `mail` |
59
+
60
+ ### Automated Release Support
61
+
62
+ Certain features offered by Hoe plugins supported are useful for manual
63
+ releases, but work against automated releases (see [trusted publishing][tp]).
64
+
65
+ - `hoe-doofus` has been replaced with an internal implementation that disables
66
+ the display if the release checklist is unset or empty.
67
+
68
+ - `hoe-git2` has been incorporated into Hoe::Halostatue, but the pieces which
69
+ affect release can be disabled through configuration.
70
+
71
+ In the example below, the release checklist and Git tag creation will be
72
+ disabled if `$rubygems_release_gem` is `true`.
27
73
 
28
74
  ```ruby
29
- # in your Rakefile
30
75
  Hoe.plugin :halostatue
76
+
77
+ Hoe.spec "myproj" do
78
+ self.checklist = nil if ENV["rubygems_release_gem"] == "true"
79
+ self.git_tag_enabled = ENV["rubygems_release_gem"] != "true"
80
+ # ...
81
+ end
31
82
  ```
32
83
 
33
- ## Dependencies
84
+ ### Release Checklist (from `hoe-doofus`)
34
85
 
35
- Hoe and Git, obviously. I wouldn't be surprised if things don't quite work for
36
- git < 2.37.
86
+ The release checklist feature has been incorporated from `hoe-doofus`.
37
87
 
38
- ## Installation
88
+ > A Hoe plugin that helps me (and you, maybe?) keep from messing up gem
89
+ > releases. It shows a configurable checklist when `rake release` is run, and
90
+ > provides a chance to abort if anything's been forgotten.
91
+
92
+ The current checklist can be seen by running `rake checklist` and the checklist
93
+ may be set by using `self.checklist << "new item"` in your spec. If the
94
+ checklist is `nil` or empty, the checklist prompt will not be displayed.
95
+
96
+ ```ruby
97
+ Hoe.plugin :halostatue
98
+
99
+ Hoe.spec "myproj" do
100
+ if ENV["rubygems_release_gem"] == "true"
101
+ self.checklist = nil
102
+ else
103
+ checklist << "Given the release a snappy name"
104
+ end
105
+ end
106
+ ```
107
+
108
+ ### Git Integration Tasks (from `hoe-git2`)
109
+
110
+ Support for generating the CHANGELOG from the git commit messages has not been
111
+ incorporated into Hoe::Halostatue.
112
+
113
+ #### Generating the Manifest
114
+
115
+ 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.
117
+
118
+ #### Tagging and Sanity Checking a Release
119
+
120
+ A release will be aborted if your Git index is dirty or there are untracked
121
+ files present. After the release is published, a Git tag will be created and
122
+ pushed to your repo remotes. Both `$PRERELEASE` and `$PRE` tags are supported,
123
+ with `$PRERELEASE` taking precedence over `$PRE`, just as with Hoe itself.
124
+
125
+ In the following example with no other configuration, a `v1.0.0.beta.1` tag will
126
+ be created and pushed to the `origin` remote.
39
127
 
40
128
  ```console
41
- $ gem install hoe-halostatue
129
+ $ rake release VERSION=1.0.0 PRERELEASE=beta.1
42
130
  ```
43
131
 
44
- ## License
132
+ The tag prefix can be with `self.git_release_tag_prefix`, which defaults to `v`.
133
+
134
+ The created tag can be pushed to different remotes with `self.git_remotes`,
135
+ which defaults to `["origin"]`.
136
+
137
+ ### Trusted Release
45
138
 
46
- Copyright 2024 Austin Ziegler (halostatue@gmail.com)
139
+ If `spec.trusted_release` is set to `true` changes will be made to the `release`
140
+ workflow. This flag is intended to be used only with a [trusted publishing][tp]
141
+ workflow. It will bypass certain protections offered by Hoe and Hoe::Halostatue:
47
142
 
48
- Permission is hereby granted, free of charge, to any person obtaining a copy of
49
- this software and associated documentation files (the 'Software'), to deal in
50
- the Software without restriction, including without limitation the rights to
51
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
52
- the Software, and to permit persons to whom the Software is furnished to do so,
53
- subject to the following conditions:
143
+ - The version discovered by Hoe will be trusted as correct, removing the need
144
+ for specifying the version.
145
+
146
+ - The release checklist will be skipped.
147
+
148
+ ## Dependencies
54
149
 
55
- The above copyright notice and this permission notice shall be included in all
56
- copies or substantial portions of the Software.
150
+ Hoe and Git 2.37 or later.
57
151
 
58
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
60
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
61
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
62
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
63
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
152
+ ## Installation
153
+
154
+ ```console
155
+ $ gem install hoe-halostatue
156
+ ```
64
157
 
65
158
  [hoe-doofus]: https://github.com/jbarnette/hoe-doofus
66
159
  [hoe-gemspec2]: https://github.com/raggi/hoe-gemspec2
@@ -68,3 +161,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
68
161
  [hoe-markdown]: https://github.com/flavorjones/hoe-markdown
69
162
  [hoe-rubygems]: https://github.com/jbarnette/hoe-rubygems
70
163
  [hoe]: https://github.com/seattlerb/hoe
164
+ [tp]: https://guides.rubygems.org/trusted-publishing/
data/Rakefile CHANGED
@@ -9,14 +9,18 @@ Hoe.plugin :halostatue
9
9
  Hoe.spec "hoe-halostatue" do
10
10
  developer "Austin Ziegler", "halostatue@gmail.com"
11
11
 
12
+ self.trusted_release = ENV["rubygems_release_gem"] == "true"
13
+
12
14
  self.extra_rdoc_files = FileList["*.rdoc"]
13
15
 
14
16
  license "MIT"
15
17
 
18
+ spec_extras[:metadata] = ->(val) {
19
+ val.merge!({"rubygems_mfa_required" => "true"})
20
+ }
21
+
16
22
  extra_deps << ["hoe", ">= 3.0", "< 5"]
17
- extra_deps << ["hoe-doofus", "~> 1.0"]
18
23
  extra_deps << ["hoe-gemspec2", "~> 1.1"]
19
- extra_deps << ["hoe-git2", "~> 1.8"]
20
24
  extra_deps << ["hoe-markdown", "~> 1.6"]
21
25
  extra_deps << ["hoe-rubygems", "~> 1.0"]
22
26
 
data/SECURITY.md ADDED
@@ -0,0 +1,20 @@
1
+ # Hoe::Halostatue Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Security reports are accepted only for the most recent minor release.
6
+
7
+ ## Reporting a Vulnerability
8
+
9
+ Alternatively, Send an email to [hoe-halostatue@halostatue.ca][email] with the
10
+ text `hoe-halostatue` in the subject. Emails sent to this address should be
11
+ encrypted using [age][age] with the following public key:
12
+
13
+ ```
14
+ age1fc6ngxmn02m62fej5cl30lrvwmxn4k3q2atqu53aatekmnqfwumqj4g93w
15
+ ```
16
+
17
+ [email]: mailto:hoe-halostatue@halostatue.ca
18
+ [age]: https://github.com/FiloSottile/age
19
+ [CVE-2017-17405]: https://nvd.nist.gov/vuln/detail/CVE-2017-17405
20
+ [openuri]: https://sakurity.com/blog/2015/02/28/openuri.html
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hoe::Halostatue
4
+ VERSION = "2.0.0"
5
+ end
@@ -1,64 +1,223 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Hoe.plugin :doofus
3
+ require "shellwords"
4
+ require_relative "halostatue/version"
5
+
4
6
  Hoe.plugin :gemspec2
5
- Hoe.plugin :git2
6
7
  Hoe.plugin :markdown
7
8
  Hoe.plugin :rubygems
8
9
 
9
- # Hoe::Halostatue is a Hoe meta-plugin that ensures that the following
10
- # plugins are installed and enabled for your project:
10
+ # This module is a Hoe plugin. You can set its options in your Rakefile Hoe spec, like
11
+ # this:
11
12
  #
12
- # - hoe-doofus (release checklist)
13
- # - hoe-gemspec2 (gemspec generation)
14
- # - hoe-git2 (git manifest and tag generation)
15
- # - hoe-markdown (default to Markdown files and auto-linkification)
13
+ # Hoe.plugin :git
16
14
  #
17
- # It also provides an improved implementation for Hoe#parse_urls that
18
- # works better with a Markdown README. It allows either +*+ or +-+ as
19
- # list leaders for the README. It also allows the URLs to be blank.
20
- # Double colons are still required for pattern matching.
15
+ # Hoe.spec "myproj" do
16
+ # self.checklist = nil if ENV["rubygems_release_gem"] == "true"
17
+ # self.git_release_tag_prefix = "REL_"
18
+ # self.git_remotes << "myremote"
19
+ # end
21
20
  #
22
- # In addition to the four letter aliases in Hoe::URLS_TO_META_MAP
23
- # (+bugs+, +clog+, +doco+, +docs+, +home+, +code+, +wiki+, and +mail+),
24
- # this adds:
21
+ # === Tasks
25
22
  #
26
- # - +changelog+, +changes+, and +history+ as aliases for +changelog_uri+
27
- # - +documentation+ for +documentation_uri+
28
- # - +issues+ and +tickets+ for +bug_tracker_uri+
29
-
23
+ # git:changelog:: Print the current changelog.
24
+ # git:manifest:: Update the manifest with Git's file list.
25
+ # git:tag:: Create and push a tag.
26
+ #
27
+ # === Options
28
+ #
29
+ # - +checklist+: An array of reminder questions that should be asked before a release, in
30
+ # the form, "Did you... [question]?" You can see the defaults by running <tt>rake
31
+ # checklist</tt>. If the checklist is +nil+ or empty, the checklist will not shown
32
+ # during release. This is originally from hoe-doofus and called +doofus_checklist+.
33
+ #
34
+ # - +git_release_tag_prefix+: What do you want at the front of your release tags? The
35
+ # default is <tt>"v"</tt>.
36
+ #
37
+ # - +git_remotes+: Which remotes do you want to push tags, etc. to? The default is
38
+ # <tt>%w[origin]</tt>
39
+ #
40
+ # - +git_tag_enabled+: Whether a git tag should be created on release. The default is
41
+ # +true+.
30
42
  module Hoe::Halostatue
31
- VERSION = "1.0.1"
43
+ # Indicates that this release is being run as part of a trusted release workflow.
44
+ # [default: +false+]
45
+ attr_accessor :trusted_release
32
46
 
33
- def initialize_halostatue # :nodoc:
34
- Hoe::URLS_TO_META_MAP.update Hoe::Halostatue::ParseUrls::URLS_TO_META_MAP
47
+ # An array of reminder questions that should be asked before a release, in the form,
48
+ # "Did you... [question]?" You can see the defaults by running <tt>rake checklist</tt>.
49
+ #
50
+ # If the checklist is +nil+ or empty, the checklist will not shown during release.
51
+ attr_accessor :checklist
35
52
 
36
- Hoe.prepend Hoe::Halostatue::ParseUrls
37
- end
53
+ # What do you want at the front of your release tags?
54
+ # [default: <tt>"v"</tt>]
55
+ attr_accessor :git_release_tag_prefix
38
56
 
39
- def define_halostatue_tasks # :nodoc:
40
- end
57
+ # Which remotes do you want to push tags, etc. to?
58
+ # [default: <tt>%w[origin]</tt>]
59
+ attr_accessor :git_remotes
41
60
 
42
- module ParseUrls
43
- URLS_TO_META_MAP = {
61
+ # Should git tags be created on release? [default: +true+]
62
+ attr_accessor :git_tag_enabled
63
+
64
+ def initialize_halostatue # :nodoc:
65
+ Hoe::URLS_TO_META_MAP.update({
66
+ "bugs" => "bug_tracker_uri",
44
67
  "changelog" => "changelog_uri",
45
68
  "changes" => "changelog_uri",
69
+ "clog" => "changelog_uri",
70
+ "code" => "source_code_uri",
71
+ "doco" => "documentation_uri",
72
+ "docs" => "documentation_uri",
46
73
  "documentation" => "documentation_uri",
47
74
  "history" => "changelog_uri",
75
+ "home" => "homepage_uri",
48
76
  "issues" => "bug_tracker_uri",
49
- "tickets" => "bug_tracker_uri"
50
- }
77
+ "mail" => "mailing_list_uri",
78
+ "tickets" => "bug_tracker_uri",
79
+ "wiki" => "wiki_uri"
80
+ })
81
+ Hoe.prepend Hoe::Halostatue::ParseUrls
51
82
 
52
- def parse_urls text
53
- lines = text.gsub(/^[-*] /, "").delete("<>").split("\n").grep(/\S+/)
83
+ self.checklist = [
84
+ "bump the version",
85
+ "check everything in",
86
+ "review the manifest",
87
+ "update the README and RDocs",
88
+ "update the changelog",
89
+ "regenerate the gemspec"
90
+ ]
54
91
 
55
- return {} if lines.empty?
92
+ self.git_release_tag_prefix = "v"
93
+ self.git_remotes = %w[origin]
94
+ self.git_tag_enabled = true
95
+ self.trusted_release = false
96
+ end
56
97
 
57
- if /::/.match?(lines.first)
58
- Hash[lines.map { |line| line.split(/\s*::\s*/) }]
98
+ def define_halostatue_tasks # :nodoc:
99
+ desc "Show a reminder for steps I frequently forget"
100
+ task :checklist do
101
+ if checklist.nil? || checklist.empty?
102
+ puts "Checklist is empty."
59
103
  else
60
- {}
104
+ puts "\n### HEY! Did you...\n\n"
105
+
106
+ checklist.each do |question|
107
+ question = question[0..0].upcase + question[1..]
108
+ question = "#{question}?" unless question.end_with?("?")
109
+ puts " * #{question}"
110
+ end
111
+
112
+ puts
113
+ end
114
+ end
115
+
116
+ task :release_sanity do
117
+ unless checklist.nil? || checklist.empty? || trusted_release
118
+ Rake::Task[:checklist].invoke
119
+ puts "Hit return if you're sure, Ctrl-C if you forgot something."
120
+ $stdin.gets
121
+ end
122
+ end
123
+
124
+ task :spec_clean_markdown_text do
125
+ spec.description =
126
+ spec.description.gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
127
+ .gsub(/\[([^\]]+)\]\[[^\]]+\]/, '\1')
128
+
129
+ spec.summary =
130
+ spec.summary.gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
131
+ .gsub(/\[([^\]]+)\]\[[^\]]+\]/, '\1')
132
+ end
133
+
134
+ task "#{spec.name}.gemspec" => :spec_clean_markdown_text
135
+
136
+ if trusted_release
137
+ task :trusted_release do
138
+ vm = %r{^(?<version>\d+(?:\.\d+)+)(?:\.(?<pre>[a-z]\w+(?:\.\d+)+))?}
139
+ .match(spec.version.to_s)
140
+
141
+ ENV["VERSION"] = vm[:version]
142
+ ENV["PRERELEASE"] = vm[:pre]
61
143
  end
144
+
145
+ task release_sanity: :trusted_release
146
+ end
147
+
148
+ return unless __run_git("rev-parse", "--is-inside-work-tree") == "true"
149
+
150
+ desc "Update the manifest with Git's file list. Use Hoe's excludes."
151
+ task "git:manifest" do
152
+ with_config do |config, _|
153
+ files = __run_git("ls-files").split($/)
154
+ files.reject! { |f| f =~ config["exclude"] }
155
+
156
+ File.open "Manifest.txt", "w" do |f|
157
+ f.puts files.sort.join("\n")
158
+ end
159
+ end
160
+ end
161
+
162
+ desc "Create and push a TAG (default #{git_release_tag_prefix}#{version})."
163
+ task "git:tag" do
164
+ if git_tag_enabled
165
+ tag = ENV["TAG"]
166
+ ver = ENV["VERSION"] || version
167
+ pre = ENV["PRERELEASE"] || ENV["PRE"]
168
+ ver += ".#{pre}" if pre
169
+ tag ||= "#{git_release_tag_prefix}#{ver}"
170
+
171
+ git_tag_and_push tag
172
+ end
173
+ end
174
+
175
+ task :release_sanity do
176
+ unless __run_git("status", "--porcelain").empty?
177
+ abort "Won't release: Dirty index or untracked files present!"
178
+ end
179
+ end
180
+
181
+ task release_to: "git:tag"
182
+ end
183
+
184
+ def __git(command, *params)
185
+ "git #{command.shellescape} #{params.compact.shelljoin}"
186
+ end
187
+
188
+ def __run_git(command, *params)
189
+ `#{__git(command, *params)}`.strip.chomp
190
+ end
191
+
192
+ def git_svn?
193
+ File.exist?(File.join(__run_git("rev-parse", "--show-toplevel"), ".git/svn"))
194
+ end
195
+
196
+ def git_tag_and_push tag
197
+ msg = "Tagging #{tag}."
198
+
199
+ if git_svn?
200
+ sh __git("svn", "tag", tag, "-m", msg)
201
+ else
202
+ flags =
203
+ if __run_git("config", "--get", "user.signingkey").empty?
204
+ nil
205
+ else
206
+ "-s"
207
+ end
208
+
209
+ sh __git("tag", flags, "-f", tag, "-m", msg)
210
+ git_remotes.each { |remote| sh __git("push", "-f", remote, "tag", tag) }
211
+ end
212
+ end
213
+
214
+ # This replaces Hoe#parse_urls with something that works better for Markdown.
215
+ module ParseUrls # :nodoc:
216
+ def parse_urls text
217
+ keys = Hoe::URLS_TO_META_MAP.keys.join("|")
218
+ pattern = %r{^[-+*]\s+(#{keys})\s+::\s+[<]?(\w+://[^>\s]+)[>]?}m
219
+
220
+ text.scan(pattern).to_h
62
221
  end
63
222
  end
64
223
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-halostatue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
11
+ date: 2025-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hoe
@@ -30,20 +30,6 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5'
33
- - !ruby/object:Gem::Dependency
34
- name: hoe-doofus
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.0'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.0'
47
33
  - !ruby/object:Gem::Dependency
48
34
  name: hoe-gemspec2
49
35
  requirement: !ruby/object:Gem::Requirement
@@ -58,20 +44,6 @@ dependencies:
58
44
  - - "~>"
59
45
  - !ruby/object:Gem::Version
60
46
  version: '1.1'
61
- - !ruby/object:Gem::Dependency
62
- name: hoe-git2
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '1.8'
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '1.8'
75
47
  - !ruby/object:Gem::Dependency
76
48
  name: hoe-markdown
77
49
  requirement: !ruby/object:Gem::Requirement
@@ -135,44 +107,43 @@ dependencies:
135
107
  - !ruby/object:Gem::Version
136
108
  version: '7'
137
109
  description: |-
138
- Hoe::Halostatue is a [Hoe][hoe] meta-plugin that ensures that the following
139
- plugins are installed and enabled for your project:
140
-
141
- - [`hoe-doofus`][hoe-doofus]
142
- - [`hoe-gemspec2`][hoe-gemspec2]
143
- - [`hoe-git2`][hoe-git2]
144
- - [`hoe-markdown`][hoe-markdown]
145
- - [`hoe-rubygems`][hoe-rubygems]
146
-
147
- It also provides an improved implementation for `Hoe#parse_urls` that works
148
- better with a Markdown README. It allows either `*` or `-` as list leaders for
149
- the README. It also allows the URLs to be blank. Double colons are still
150
- required for pattern matching.
151
-
152
- In addition to the four letter aliases in `Hoe::URLS_TO_META_MAP` (`bugs`,
153
- `clog`, `doco`, `docs`, `home`, `code`, `wiki`, and `mail`), this adds:
154
-
155
- - `changelog`, `changes`, and `history` as aliases for `changelog_uri`
156
- - `documentation` for `documentation_uri`
157
- - `issues` and `tickets` for `bug_tracker_uri`
110
+ Hoe::Halostatue is a [Hoe][hoe] meta-plugin that provides improved support for
111
+ Markdown README files, provides features from other plugins, and enables
112
+ improved support for [trusted publishing][tp].
158
113
  email:
159
114
  - halostatue@gmail.com
160
115
  executables: []
161
116
  extensions: []
162
117
  extra_rdoc_files:
163
118
  - CHANGELOG.md
119
+ - CODE_OF_CONDUCT.md
120
+ - CONTRIBUTING.md
121
+ - CONTRIBUTORS.md
122
+ - LICENCE.md
164
123
  - Manifest.txt
165
124
  - README.md
125
+ - SECURITY.md
166
126
  files:
167
127
  - CHANGELOG.md
128
+ - CODE_OF_CONDUCT.md
129
+ - CONTRIBUTING.md
130
+ - CONTRIBUTORS.md
131
+ - LICENCE.md
168
132
  - Manifest.txt
169
133
  - README.md
170
134
  - Rakefile
135
+ - SECURITY.md
171
136
  - lib/hoe/halostatue.rb
172
- homepage:
137
+ - lib/hoe/halostatue/version.rb
138
+ homepage: https://github.com/halostatue/halostatue-data/
173
139
  licenses:
174
140
  - MIT
175
- metadata: {}
141
+ metadata:
142
+ homepage_uri: https://github.com/halostatue/halostatue-data/
143
+ bug_tracker_uri: https://github.com/halostatue/halostatue-data/issues
144
+ source_code_uri: https://github.com/halostatue/halostatue-data/
145
+ changelog_uri: https://github.com/halostatue/halostatue-data/blob/main/CHANGELOG.md
146
+ rubygems_mfa_required: 'true'
176
147
  post_install_message:
177
148
  rdoc_options:
178
149
  - "--main"
@@ -190,12 +161,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
161
  - !ruby/object:Gem::Version
191
162
  version: '0'
192
163
  requirements: []
193
- rubygems_version: 3.5.23
164
+ rubygems_version: 3.5.22
194
165
  signing_key:
195
166
  specification_version: 4
196
- summary: 'Hoe::Halostatue is a [Hoe][hoe] meta-plugin that ensures that the following
197
- plugins are installed and enabled for your project: - [`hoe-doofus`][hoe-doofus]
198
- - [`hoe-gemspec2`][hoe-gemspec2] - [`hoe-git2`][hoe-git2] - [`hoe-markdown`][hoe-markdown]
199
- - [`hoe-rubygems`][hoe-rubygems] It also provides an improved implementation for
200
- `Hoe#parse_urls` that works better with a Markdown README'
167
+ summary: Hoe::Halostatue is a [Hoe][hoe] meta-plugin that provides improved support
168
+ for Markdown README files, provides features from other plugins, and enables improved
169
+ support for [trusted publishing][tp].
201
170
  test_files: []