Class: GemKit::Release::Generators::Setup
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- GemKit::Release::Generators::Setup
- Includes:
- Thor::Actions
- Defined in:
- lib/gem_kit/release/generators/setup.rb
Overview
gem kit setup — a Thor generator, which is what Rails' own generators
are. Using one rather than hand-rolled File.write buys the whole
conflict protocol for free: create/identical/conflict status
lines, a prompt offering diff/overwrite/skip when a file exists and
differs, and --force / --skip / --pretend to answer that prompt ahead
of time.
It writes the two documents that describe this toolchain, rendered for the project's own name and versions. They are copies rather than links because a policy nobody can read in their own repo is a policy nobody follows, and because the examples are worth more with real numbers in them.
Class Method Summary collapse
-
.banner ⇒ Object
Written into the project, not the working directory:
gem kit setuprun from a subdirectory still belongs to the gem. - .source_root ⇒ Object
Instance Method Summary collapse
-
#deprecations_document ⇒ Object
The policy is the repository's — one deprecation policy governs every gem in it — so DEPRECATIONS.md is written once, whichever gem you named.
-
#release_document ⇒ Object
The process is the gem's: every command in it names a version and a changelog belonging to one gem.
- #where_to_link_them ⇒ Object
Class Method Details
.banner ⇒ Object
Written into the project, not the working directory: gem kit setup
run from a subdirectory still belongs to the gem.
39 |
# File 'lib/gem_kit/release/generators/setup.rb', line 39 def self. = "gem kit setup" |
.source_root ⇒ Object
33 34 35 |
# File 'lib/gem_kit/release/generators/setup.rb', line 33 def self.source_root File.("../templates", __dir__) end |
Instance Method Details
#deprecations_document ⇒ Object
The policy is the repository's — one deprecation policy governs every gem in it — so DEPRECATIONS.md is written once, whichever gem you named.
44 45 46 |
# File 'lib/gem_kit/release/generators/setup.rb', line 44 def deprecations_document template("DEPRECATIONS.md.erb", File.join(project.root, "DEPRECATIONS.md")) end |
#release_document ⇒ Object
The process is the gem's: every command in it names a version and a
changelog belonging to one gem. So a repository with two gems gets
RELEASE-
51 52 53 |
# File 'lib/gem_kit/release/generators/setup.rb', line 51 def release_document template("RELEASE.md.erb", File.join(project.root, release_document_name)) end |
#where_to_link_them ⇒ Object
55 56 57 58 |
# File 'lib/gem_kit/release/generators/setup.rb', line 55 def where_to_link_them say "" say "Link them from your README and AGENTS.md so they are found." end |