summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCharlotte Koch <charlotte@magentastripe.com>2024-11-19 14:47:35 -0800
committerCharlotte Koch <charlotte@magentastripe.com>2024-11-19 14:47:35 -0800
commitdf6ea623721722e635d1f136d29c3d29aebe7a62 (patch)
tree6397a15847e24e675a041a72754b0a5387f0f459 /lib
parentf5b890675338d964c0bac9c571081ae48e64fe9a (diff)
Add a bunch of missing files for "willora new"
Diffstat (limited to 'lib')
-rw-r--r--lib/willora/willora.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/willora/willora.rb b/lib/willora/willora.rb
index 1867fbb..9cfe62f 100644
--- a/lib/willora/willora.rb
+++ b/lib/willora/willora.rb
@@ -95,8 +95,12 @@ class Willora
templates = {
"Makefile.erb" => "",
+ "acknowledgments.adoc.erb" => "adoc",
+ "backmatter.adoc.erb" => "adoc",
+ "biography.adoc.erb" => "adoc",
"CHAP01.adoc.erb" => "adoc",
- "frontmatter.adoc.erb" => "adoc",
+ "dedication.adoc.erb" => "adoc",
+ "frontmatter-template.adoc.erb" => "adoc",
"part01.adoc.erb" => "adoc",
}
@@ -107,7 +111,14 @@ class Willora
end
templatefile = File.join(_templatedir, template)
result = ERB.new(File.read(templatefile)).result(binding)
- newfile = File.join(destdir, File.basename(template, ".erb"))
+
+ # This file gets installed *with* the .erb extension.
+ if template == "frontmatter-template.adoc.erb"
+ newfile = File.join(destdir, template)
+ else
+ newfile = File.join(destdir, File.basename(template, ".erb"))
+ end
+
puts "GENERATE #{newfile}"
File.open(newfile, "w") do |fp|
fp.puts(result)