metanorma-ogc 2.4.1 → 2.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df6f6cbb5bc0bc2323c2ca580974c1b8088c17cd1b8e54ce952ad349990518d1
4
- data.tar.gz: c33fb7fe87342becdb7d44ecd64422d5b911230622f0f571b1318d802b89ead2
3
+ metadata.gz: c36eb2eb19714efe36a2bddd955d89702cbabb9a3206b636f39d89cdddb9b196
4
+ data.tar.gz: 5fa6aaadc06ada3a8f856b33cdd95b8fc3407df9c25f7b43f30d6cac045ab565
5
5
  SHA512:
6
- metadata.gz: 2c8ce9e3fd6cdf2a2f8f349c5991bde3d6809d73cba6b515a20f99dde628d041012602697bad104f21b9578622e18b5acfe6d7b172ae80b08546396f5fdfb527
7
- data.tar.gz: 70e85764d9f88e93075742ca70b5d2c4bfed91b12c5ccf201421f1760235f684732f70f73073e7795dca982f9ec39ef7e14bc8648afb8e9ed6bd7e411e06aa6a
6
+ metadata.gz: c45ff6fe107ed9e9e34b63925a01c4244943e261224d969412183a81baa0ee67fe3ca5ed870ef1cf485cb6c6e9be747e90307c46d3207ae6341e7388db43c4d9
7
+ data.tar.gz: 0fbc5ca07fda92e07ed344beb8aa9d359eccfad72b0ba4514af0880a43db1dc3c74909551592c561ba55ec0d82c9ae68ce8568dc594f187f875549f7d10095ee
@@ -11,14 +11,13 @@ module IsoDoc
11
11
  super
12
12
  end
13
13
 
14
- def pdf_stylesheet(docxml)
15
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
14
+ def pdf_stylesheet(_docxml)
16
15
  %w(abstract-specification-topic best-practice draft-standard
17
16
  change-request-supporting-document community-practice
18
17
  community-standard discussion-paper engineering-report policy
19
18
  reference-model release-notes standard user-guide test-suite
20
- white-paper).include? doctype or doctype = "other"
21
- "ogc.#{doctype}.xsl"
19
+ white-paper).include? @doctype or @doctype = "other"
20
+ "ogc.#{@doctype}.xsl"
22
21
  end
23
22
  end
24
23
  end
@@ -40,13 +40,12 @@ module IsoDoc
40
40
  end
41
41
 
42
42
  def convert1(docxml, filename, dir)
43
- if docxml&.at(ns("//bibdata/ext/doctype"))&.text == "white-paper"
43
+ if @doctype == "white-paper"
44
44
  @wordstylesheet_name = html_doc_path("wordstyle_wp.scss")
45
45
  @standardstylesheet_name = html_doc_path("ogc_wp.scss")
46
46
  @wordcoverpage = html_doc_path("word_ogc_titlepage_wp.html")
47
47
  @wordintropage = html_doc_path("word_ogc_intro_wp.html")
48
48
  @header = html_doc_path("header_wp.html")
49
- @doctype = "white-paper"
50
49
  options[:bodyfont] = '"Arial",sans-serif'
51
50
  options[:headerfont] = '"Lato",sans-serif'
52
51
  options[:normalfontsize] = "11.0pt"
@@ -12,7 +12,7 @@ module IsoDoc
12
12
  "//sections/definitions | " \
13
13
  "//sections/clause[descendant::definitions][not(descendant::terms)]",
14
14
  @klass.middle_clause(docxml)]
15
- ret + if docxml.at(ns("//bibdata/ext/doctype"))&.text == "engineering-report"
15
+ ret + if @doctype == "engineering-report"
16
16
  [{ path: a.join(" | "), multi: true }]
17
17
  else
18
18
  [{ path: a[0] }, { path: a[1] }, { path: a[2], multi: true }]
@@ -34,16 +34,32 @@ module Metanorma
34
34
  def insert_security(xml, sect)
35
35
  description = "document"
36
36
  description = "standard" if %w(standard community-standard)
37
- .include?(sect.at("//bibdata/ext/doctype")&.text)
37
+ .include?(@doctype)
38
+ @doctype == "engineering-report" and return remove_security(xml)
38
39
  preface = sect.at("//preface") ||
39
40
  sect.add_previous_sibling("<preface/>").first
40
41
  sect = xml.at("//clause[@type = 'security']")&.remove ||
41
- "<clause type='security' #{add_id}>" \
42
- "<title>Security considerations</title>" \
43
- "<p>#{@i18n.security_empty.sub(/%/, description)}</p></clause>"
42
+ create_security_clause(xml)
44
43
  preface.add_child sect
45
44
  end
46
45
 
46
+ def remove_security(xml)
47
+ a = xml.at("//clause[@type = 'security']") and
48
+ a.delete("type")
49
+ end
50
+
51
+ def create_security_clause(xml)
52
+ doctype = xml.at("//bibdata/ext/doctype")&.text
53
+ description = "document"
54
+ description = "standard" if %w(standard community-standard)
55
+ .include?(doctype)
56
+ <<~CLAUSE
57
+ <clause type='security' #{add_id}>
58
+ <title>Security considerations</title>
59
+ <p>#{@i18n.security_empty.sub('%', description)}</p></clause>
60
+ CLAUSE
61
+ end
62
+
47
63
  def insert_submitters(xml, sect)
48
64
  if xml.at("//submitters")
49
65
  preface = sect.at("//preface") ||
@@ -62,9 +78,11 @@ module Metanorma
62
78
  super
63
79
  a = xmldoc.at("//bibdata/status/stage")
64
80
  a.text == "published" and a.children = "approved"
65
- doctype = xmldoc.at("//bibdata/ext/doctype")
66
- doctype.text == "technical-paper" and
81
+ if @doctype == "technical-paper"
82
+ doctype = xmldoc.at("//bibdata/ext/doctype")
67
83
  doctype.children = "white-paper"
84
+ @doctype = "white-paper"
85
+ end
68
86
  end
69
87
 
70
88
  def section_names_terms_cleanup(xml)
@@ -2,7 +2,6 @@ module Metanorma
2
2
  module Ogc
3
3
  class Converter < Standoc::Converter
4
4
  def validate(doc)
5
- @doctype = doc.at("//bibdata/ext/doctype")&.text
6
5
  content_validate(doc)
7
6
  schema_validate(formattedstr_strip(doc.dup),
8
7
  File.join(File.dirname(__FILE__), "ogc.rng"))
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.4.1".freeze
3
+ VERSION = "2.4.2".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.5.4"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.6.0"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-28 00:00:00.000000000 Z
11
+ date: 2023-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.5.4
33
+ version: 2.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.5.4
40
+ version: 2.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement