From c7c006cc68573cea356253cb1cc2c428d83fdf6c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 21 Dec 2022 02:06:03 +0900 Subject: [DOC] tool/update-NEWS-refs.rb: Remove extra brackets Surrounding with brackets is just a convention for the bugs tracker links. --- tool/update-NEWS-refs.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tool') diff --git a/tool/update-NEWS-refs.rb b/tool/update-NEWS-refs.rb index b492e9e7d6..5076c6ec0a 100644 --- a/tool/update-NEWS-refs.rb +++ b/tool/update-NEWS-refs.rb @@ -12,9 +12,12 @@ if links.empty? || lines.last != "" raise "NEWS.md must end with a sequence of links" end +labels = links.keys.select {|k| !(k.start_with?("Feature") || k.start_with?("Bug"))} new_src = lines.join("\n").gsub(/\[?\[((?:Feature|Bug)\s+#(\d+))\]\]?/) do links[$1] ||= "[#$1]: ".ljust(18) + "https://bugs.ruby-lang.org/issues/#$2" "[[#$1]]" +end.gsub(/\[\[#{Regexp.union(labels)}\]\]?/) do + "[#$1]" end.chomp + "\n\n" redmine_links, non_redmine_links = links.partition {|k,| k =~ /\A(Feature|Bug)\s+#\d+\z/ } -- cgit v1.2.3