From 6aae21b0ab7cbda89aa8f44a1c42a416b1339355 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Mon, 1 Apr 2024 16:15:27 +1100 Subject: [PATCH] automatically set document-scheme based on copyright-year: https://github.com/metanorma/metanorma-iso/issues/1148 --- Gemfile.devel | 3 +- lib/isodoc/iso/index.rb | 10 +- lib/isodoc/iso/word_dis_cleanup.rb | 2 +- lib/isodoc/iso/word_dis_convert.rb | 2 - lib/metanorma/iso/base.rb | 10 +- spec/isodoc/postproc_spec.rb | 310 ++----- spec/isodoc/section_spec.rb | 9 +- spec/metanorma/base_spec.rb | 68 +- spec/metanorma/section_spec.rb | 3 +- spec/metanorma/validate_section_spec.rb | 929 +++++++++++++++++++ spec/metanorma/validate_spec.rb | 1125 ++--------------------- 11 files changed, 1206 insertions(+), 1265 deletions(-) create mode 100644 spec/metanorma/validate_section_spec.rb diff --git a/Gemfile.devel b/Gemfile.devel index 69d8cb93..48b3daa1 100644 --- a/Gemfile.devel +++ b/Gemfile.devel @@ -1 +1,2 @@ -gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "main" +gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/refactor-toWord" +gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main" diff --git a/lib/isodoc/iso/index.rb b/lib/isodoc/iso/index.rb index 2b748a13..2fa3e4c2 100644 --- a/lib/isodoc/iso/index.rb +++ b/lib/isodoc/iso/index.rb @@ -50,9 +50,8 @@ def index_entries(words, index, primary) ret = index_entries_head(words[primary], index.dig(words[primary], nil, nil), index_entries_opt) - words2 = index[words[primary]]&.keys&.reject do |k| - k.nil? - end&.each_with_object({}) { |w, v| v[w.downcase] = w } + words2 = index[words[primary]]&.keys&.compact + &.each_with_object({}) { |w, v| v[w.downcase] = w } unless words2.empty? ret += "