metanorma-csd 1.3.15 → 1.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/csd/converter.rb +1 -0
- data/lib/asciidoctor/csd/front.rb +3 -2
- data/lib/asciidoctor/csd/isodoc.rng +5 -0
- data/lib/asciidoctor/csd/validate.rb +4 -4
- data/lib/asciidoctor/csd/validate_section.rb +16 -16
- data/lib/metanorma/csd/version.rb +1 -1
- data/metanorma-csd.gemspec +0 -1
- metadata +2 -16
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8e97b0d1ef2901121fffd7fff111a20f956228cf43fabd7b9c0ae128abfafc9a
         | 
| 4 | 
            +
              data.tar.gz: 7582ce91df455fc1b2b6746c71834edf2b2da563ea5b3cfafa89b674b888523e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f58c72f802fa14ba50ee4c36057cb17756684b495640f8b6e41d90104e84a089193c92caeb238a88ac668c791113e6ac3c6d25f3324ffc4e7e4ce838f919bccc
         | 
| 7 | 
            +
              data.tar.gz: 243ff39f1ca569e2d2a3e47cc0848fd65f48b584bb73be038cff2834359230637c83551a65a77ab01d1c3cae9a5562542f7ff12b08abf7f5fe8a10a53d9e67cb
         | 
| @@ -43,7 +43,7 @@ module Asciidoctor | |
| 43 43 | 
             
                  def metadata_status(node, xml)
         | 
| 44 44 | 
             
                    status = node.attr("status")
         | 
| 45 45 | 
             
                    unless status && ::Metanorma::Csd::DOCSTATUS.keys.include?(status)
         | 
| 46 | 
            -
                       | 
| 46 | 
            +
                      @log.add("Document Attributes", nil, "#{status} is not a legal status")
         | 
| 47 47 | 
             
                    end
         | 
| 48 48 | 
             
                    super
         | 
| 49 49 | 
             
                  end
         | 
| @@ -70,7 +70,8 @@ module Asciidoctor | |
| 70 70 | 
             
                  def doctype(node)
         | 
| 71 71 | 
             
                    d = node.attr("doctype")
         | 
| 72 72 | 
             
                    unless ::Metanorma::Csd::DOCSUFFIX.keys.include?(d)
         | 
| 73 | 
            -
                       | 
| 73 | 
            +
                      @log.add("Document Attributes", nil,
         | 
| 74 | 
            +
                               "#{d} is not a legal document type: reverting to 'standard'")
         | 
| 74 75 | 
             
                      d = "standard"
         | 
| 75 76 | 
             
                    end
         | 
| 76 77 | 
             
                    d
         | 
| @@ -14,15 +14,15 @@ module Asciidoctor | |
| 14 14 | 
             
                  def doctype_validate(xmldoc)
         | 
| 15 15 | 
             
                    doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
         | 
| 16 16 | 
             
                    %w(directive guide specification standard report administrative amendment
         | 
| 17 | 
            -
                    technical-corrigendum advisory).include? | 
| 18 | 
            -
             | 
| 17 | 
            +
                    technical-corrigendum advisory).include?(doctype) or
         | 
| 18 | 
            +
                    @log.add("Document Attributes", nil, "#{doctype} is not a recognised document type")
         | 
| 19 19 | 
             
                  end
         | 
| 20 20 |  | 
| 21 21 | 
             
                  def stage_validate(xmldoc)
         | 
| 22 22 | 
             
                    stage = xmldoc&.at("//bibdata/status/stage")&.text
         | 
| 23 23 | 
             
                    %w(proposal working-draft committee-draft draft-standard final-draft
         | 
| 24 | 
            -
                    published withdrawn).include? | 
| 25 | 
            -
             | 
| 24 | 
            +
                    published withdrawn).include?(stage) or
         | 
| 25 | 
            +
                    @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
         | 
| 26 26 | 
             
                  end
         | 
| 27 27 | 
             
                end
         | 
| 28 28 | 
             
              end
         | 
| @@ -10,19 +10,19 @@ module Asciidoctor | |
| 10 10 | 
             
                    super
         | 
| 11 11 | 
             
                  end
         | 
| 12 12 |  | 
| 13 | 
            -
                  ONE_SYMBOLS_WARNING = " | 
| 13 | 
            +
                  ONE_SYMBOLS_WARNING = "Only one Symbols and Abbreviated "\
         | 
| 14 14 | 
             
                    "Terms section in the standard".freeze
         | 
| 15 15 |  | 
| 16 | 
            -
                  NON_DL_SYMBOLS_WARNING = " | 
| 16 | 
            +
                  NON_DL_SYMBOLS_WARNING = "Symbols and Abbreviated Terms can "\
         | 
| 17 17 | 
             
                    "only contain a definition list".freeze
         | 
| 18 18 |  | 
| 19 19 | 
             
                  def symbols_validate(root)
         | 
| 20 20 | 
             
                    f = root.xpath("//definitions")
         | 
| 21 21 | 
             
                    f.empty? && return
         | 
| 22 | 
            -
                    (f.size == 1) ||  | 
| 22 | 
            +
                    (f.size == 1) || @log.add("Style", f.first, ONE_SYMBOLS_WARNING)
         | 
| 23 23 | 
             
                    f.first.elements.each do |e|
         | 
| 24 24 | 
             
                      unless e.name == "dl"
         | 
| 25 | 
            -
                         | 
| 25 | 
            +
                        @log.add("Style", f.first, NON_DL_SYMBOLS_WARNING)
         | 
| 26 26 | 
             
                        return
         | 
| 27 27 | 
             
                      end
         | 
| 28 28 | 
             
                    end
         | 
| @@ -31,7 +31,7 @@ module Asciidoctor | |
| 31 31 | 
             
                  def seqcheck(names, msg, accepted)
         | 
| 32 32 | 
             
                    n = names.shift
         | 
| 33 33 | 
             
                    unless accepted.include? n
         | 
| 34 | 
            -
                       | 
| 34 | 
            +
                      @log.add("Style", nil, msg)
         | 
| 35 35 | 
             
                      names = []
         | 
| 36 36 | 
             
                    end
         | 
| 37 37 | 
             
                    names
         | 
| @@ -92,46 +92,46 @@ module Asciidoctor | |
| 92 92 | 
             
                      n = names.shift || return
         | 
| 93 93 | 
             
                    end
         | 
| 94 94 | 
             
                    unless n
         | 
| 95 | 
            -
                       | 
| 95 | 
            +
                      @log.add("Style", nil, "Document must contain at least one clause")
         | 
| 96 96 | 
             
                      return
         | 
| 97 97 | 
             
                    end
         | 
| 98 98 | 
             
                    n[:tag] == "clause" ||
         | 
| 99 | 
            -
                       | 
| 99 | 
            +
                      @log.add("Style", nil, "Document must contain clause after "\
         | 
| 100 100 | 
             
                           "Terms and Definitions")
         | 
| 101 101 | 
             
                    n == { tag: "clause", title: "Scope" } &&
         | 
| 102 | 
            -
                       | 
| 102 | 
            +
                      @log.add("Style", nil, "Scope must occur before Terms and Definitions")
         | 
| 103 103 | 
             
                    n = names.shift || return
         | 
| 104 104 | 
             
                    while n[:tag] == "clause"
         | 
| 105 105 | 
             
                      n[:title] == "Scope" &&
         | 
| 106 | 
            -
                         | 
| 106 | 
            +
                        @log.add("Style", nil, "Scope must occur before Terms and Definitions")
         | 
| 107 107 | 
             
                      n = names.shift || return
         | 
| 108 108 | 
             
                    end
         | 
| 109 109 | 
             
                    unless n[:tag] == "annex" || n[:tag] == "references"
         | 
| 110 | 
            -
                       | 
| 110 | 
            +
                      @log.add("Style", nil, "Only annexes and references can follow clauses")
         | 
| 111 111 | 
             
                    end
         | 
| 112 112 | 
             
                    while n[:tag] == "annex"
         | 
| 113 113 | 
             
                      n = names.shift
         | 
| 114 114 | 
             
                      if n.nil?
         | 
| 115 | 
            -
                         | 
| 115 | 
            +
                        @log.add("Style", nil, "Document must include (references) "\
         | 
| 116 116 | 
             
                             "Normative References")
         | 
| 117 117 | 
             
                        return
         | 
| 118 118 | 
             
                      end
         | 
| 119 119 | 
             
                    end
         | 
| 120 120 | 
             
                    n == { tag: "references", title: "Normative References" } ||
         | 
| 121 | 
            -
                       | 
| 121 | 
            +
                      @log.add("Style", nil, "Document must include (references) "\
         | 
| 122 122 | 
             
                           "Normative References")
         | 
| 123 123 | 
             
                    n = names.shift
         | 
| 124 124 | 
             
                    n == { tag: "references", title: "Bibliography" } ||
         | 
| 125 | 
            -
                       | 
| 125 | 
            +
                      @log.add("Style", nil, "Final section must be (references) Bibliography")
         | 
| 126 126 | 
             
                    names.empty? ||
         | 
| 127 | 
            -
                       | 
| 127 | 
            +
                      @log.add("Style", nil, "There are sections after the final Bibliography")
         | 
| 128 128 | 
             
                  end
         | 
| 129 129 |  | 
| 130 130 | 
             
                  def style_warning(node, msg, text = nil)
         | 
| 131 131 | 
             
                    return if @novalid
         | 
| 132 | 
            -
                    w =  | 
| 132 | 
            +
                    w = msg
         | 
| 133 133 | 
             
                    w += ": #{text}" if text
         | 
| 134 | 
            -
                     | 
| 134 | 
            +
                    @log.add("Style", node, w)
         | 
| 135 135 | 
             
                  end
         | 
| 136 136 | 
             
                end
         | 
| 137 137 | 
             
              end
         | 
    
        data/metanorma-csd.gemspec
    CHANGED
    
    | @@ -40,5 +40,4 @@ Gem::Specification.new do |spec| | |
| 40 40 | 
             
              spec.add_development_dependency "rubocop", "= 0.54.0"
         | 
| 41 41 | 
             
              spec.add_development_dependency "simplecov", "~> 0.15"
         | 
| 42 42 | 
             
              spec.add_development_dependency "timecop", "~> 0.9"
         | 
| 43 | 
            -
              spec.add_development_dependency "metanorma", "~> 0.3.0"
         | 
| 44 43 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: metanorma-csd
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.3. | 
| 4 | 
            +
              version: 1.3.16
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ribose Inc.
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-03- | 
| 11 | 
            +
            date: 2020-03-20 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: metanorma-standoc
         | 
| @@ -164,20 +164,6 @@ dependencies: | |
| 164 164 | 
             
                - - "~>"
         | 
| 165 165 | 
             
                  - !ruby/object:Gem::Version
         | 
| 166 166 | 
             
                    version: '0.9'
         | 
| 167 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 168 | 
            -
              name: metanorma
         | 
| 169 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 170 | 
            -
                requirements:
         | 
| 171 | 
            -
                - - "~>"
         | 
| 172 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 173 | 
            -
                    version: 0.3.0
         | 
| 174 | 
            -
              type: :development
         | 
| 175 | 
            -
              prerelease: false
         | 
| 176 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 177 | 
            -
                requirements:
         | 
| 178 | 
            -
                - - "~>"
         | 
| 179 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 180 | 
            -
                    version: 0.3.0
         | 
| 181 167 | 
             
            description: |
         | 
| 182 168 | 
             
              metanorma-csd lets you write CSD in AsciiDoc syntax.
         | 
| 183 169 |  |