summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Davis <ryand-ruby@zenspider.com>2023-05-09 09:37:09 -0800
committerRyan Davis <ryand-ruby@zenspider.com>2023-05-09 09:37:09 -0800
commitfd33d5163d9a613e45f3c0f710755324f90a5c94 (patch)
treebc6f91e0bae023ae7c5343e8dd86893047769dab
parentdc8ff846afc993451d80b66a6befbbdea746a678 (diff)
downloadhoe-fd33d5163d9a613e45f3c0f710755324f90a5c94.tar.gz
- Fixed a readme parsing oddity for section headers w/ multiple words that collide.
[git-p4: depot-paths = "//src/hoe/dev/": change = 13782]
-rw-r--r--lib/hoe.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/hoe.rb b/lib/hoe.rb
index 15cfeda..70e27c1 100644
--- a/lib/hoe.rb
+++ b/lib/hoe.rb
@@ -675,12 +675,13 @@ class Hoe
.chunk { |l| l[/^(?:=+|#+)/] || "" }
.map(&:last)
.each_slice(2)
- .map { |k, v|
- kp = k.join
- kp = kp.strip.chomp(":").split.last.downcase if k.size == 1
- [kp, v.join.strip]
- }
- .to_h
+ .to_h { |k, v|
+ kp = k.map { |s|
+ s.strip.chomp(":").sub(/(?:=+|#+)\s*/, '').downcase
+ }.join("\n")
+
+ [kp, v.join.strip]
+ }
unless readme.empty? then
desc = readme.values_at(*description_sections).join("\n\n")