metanorma-itu 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b485ec959d83220ae57c71e774e12136e823013c8c5ba41042a56fa03d477496
4
- data.tar.gz: 7467e85568f8ffa7d421bed9a1213c2b3c86e2ac210868bd37f99c449aab8980
3
+ metadata.gz: e4a2af7108e4cc46b5baae30adab35ca6b676562ac34fb83a4ad575a75c0af3f
4
+ data.tar.gz: 409987853945566a26ce6b68b90135dd3430fa4ce7b3d564d0103ad795547f01
5
5
  SHA512:
6
- metadata.gz: 613b74c11bd22d589f90f020d7bd848fa6e9e9a1b89c08f9b12f7e4084013970537508119c36c33e2f2c87135e7f060a143e21487d8a5d34cf39b56f95dab226
7
- data.tar.gz: 1fab3d12d67a9a5f6c7f84706d935cc60096b0dc0db24ccfb2ae07767a4a5f27ba4201584983ecbaa6c12f0e5b88cdb4a152640b9121cc63179d343a6782d229
6
+ metadata.gz: 6731878ecfb46064d3094c58558bb865b5dd9819a012d2c01f0cfe6e9b63d51b69702860f332b3edaf4581a65d41daecf5a1a301dd298857039b712cf25b5a47
7
+ data.tar.gz: b9ee173f2d18f21355540173d566fa3b4eb348147e2947c27316f5e0f38778ec0e94015c98aab0aface77e2ae218d45141e3b8198e91c437bb9dbe90c493532b
@@ -75,12 +75,12 @@ module IsoDoc
75
75
  %i(affiliations addresses emails faxes phones).each { |i| set(i, []) }
76
76
  authors.each do |a|
77
77
  append(:affiliations,
78
- a&.at(ns("./affiliation/organization/name"))&.text)
79
- append(:addresses, a&.at(ns("./affiliation/organization/address/" \
80
- "formattedAddress"))&.text)
81
- append(:emails, a&.at(ns("./email"))&.text)
82
- append(:faxes, a&.at(ns("./phone[@type = 'fax']"))&.text)
83
- append(:phones, a&.at(ns("./phone[not(@type = 'fax')]"))&.text)
78
+ a.at(ns("./affiliation/organization/name"))&.text)
79
+ append(:addresses, a.at(ns("./affiliation/organization/address/" \
80
+ "formattedAddress"))&.text)
81
+ append(:emails, a.at(ns("./email"))&.text)
82
+ append(:faxes, a.at(ns("./phone[@type = 'fax']"))&.text)
83
+ append(:phones, a.at(ns("./phone[not(@type = 'fax')]"))&.text)
84
84
  end
85
85
  end
86
86
 
@@ -117,7 +117,7 @@ module IsoDoc
117
117
  pubdate and
118
118
  set(:placedate_year,
119
119
  @labels["placedate"]
120
- .sub(/%/, pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
120
+ .sub("%", pubdate.text.sub(/^(\d\d\d\d).*$/, "\\1")))
121
121
  end
122
122
 
123
123
  def monthyr(isodate)
@@ -142,7 +142,7 @@ module IsoDoc
142
142
  else super
143
143
  end
144
144
  d = get[:doctype] and
145
- set(:draft_new_doctype, @labels["draft_new"].sub(/%/, d))
145
+ set(:draft_new_doctype, @labels["draft_new"].sub("%", d))
146
146
  end
147
147
 
148
148
  def ip_notice_received(isoxml, _out)
@@ -187,27 +187,27 @@ module IsoDoc
187
187
  end
188
188
 
189
189
  def techreport(isoxml, _out)
190
- if a = isoxml&.at(ns("//bibdata/ext/meeting"))&.text
190
+ if a = isoxml.at(ns("//bibdata/ext/meeting"))&.text
191
191
  set(:meeting, a)
192
192
  set(:meeting_acronym, a)
193
193
  end
194
- a = isoxml&.at(ns("//bibdata/ext/meeting/@acronym"))&.text and
194
+ a = isoxml.at(ns("//bibdata/ext/meeting/@acronym"))&.text and
195
195
  set(:meeting_acronym, a)
196
- a = isoxml&.at(ns("//bibdata/ext/meeting-place"))&.text and
196
+ a = isoxml.at(ns("//bibdata/ext/meeting-place"))&.text and
197
197
  set(:meeting_place, a)
198
- a = isoxml&.at(ns("//bibdata/ext/intended-type"))&.text and
198
+ a = isoxml.at(ns("//bibdata/ext/intended-type"))&.text and
199
199
  set(:intended_type, a)
200
- a = isoxml&.at(ns("//bibdata/ext/source"))&.text and set(:source, a)
200
+ a = isoxml.at(ns("//bibdata/ext/source"))&.text and set(:source, a)
201
201
  meeting(isoxml)
202
202
  end
203
203
 
204
204
  def meeting(isoxml)
205
205
  resolution =
206
- isoxml&.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
207
- if o = isoxml&.at(ns("//bibdata/ext/meeting-date/on"))&.text
206
+ isoxml.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
207
+ if o = isoxml.at(ns("//bibdata/ext/meeting-date/on"))&.text
208
208
  set(:meeting_date, resolution ? ddMMMMYYYY(o, nil) : ddMMMYYYY(o))
209
- elsif f = isoxml&.at(ns("//bibdata/ext/meeting-date/from"))&.text
210
- t = isoxml&.at(ns("//bibdata/ext/meeting-date/to"))&.text
209
+ elsif f = isoxml.at(ns("//bibdata/ext/meeting-date/from"))&.text
210
+ t = isoxml.at(ns("//bibdata/ext/meeting-date/to"))&.text
211
211
  set(:meeting_date,
212
212
  resolution ? ddMMMMYYYY(f, t) : "#{ddMMMYYYY(f)}/#{ddMMMYYYY(t)}")
213
213
  end
@@ -12,9 +12,8 @@ module IsoDoc
12
12
  super
13
13
  end
14
14
 
15
- def pdf_stylesheet(docxml)
16
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
17
- if File.exist?(File.join(@libdir, "itu.#{doctype}.xsl"))
15
+ def pdf_stylesheet(_docxml)
16
+ if File.exist?(File.join(@libdir, "itu.#{@doctype}.xsl"))
18
17
  "itu.#{doctype}.xsl"
19
18
  else
20
19
  "itu.recommendation.xsl"
@@ -79,8 +79,7 @@ module IsoDoc
79
79
  end
80
80
 
81
81
  def clause1(elem)
82
- elem.at(ns("//bibdata/ext/doctype"))&.text ==
83
- "resolution" or return super
82
+ @doctype == "resolution" or return super
84
83
  %w(sections bibliography).include? elem.parent.name or return super
85
84
  @suppressheadingnumbers || elem["unnumbered"] and return
86
85
  t = elem.at(ns("./title")) and t["depth"] = "1"
@@ -91,8 +90,7 @@ module IsoDoc
91
90
  end
92
91
 
93
92
  def annex1(elem)
94
- elem.at(ns("//bibdata/ext/doctype"))&.text == "resolution" or
95
- return super
93
+ @doctype == "resolution" or return super
96
94
  elem.elements.first.previous = annex1_supertitle(elem)
97
95
  t = elem.at(ns("./title")) and
98
96
  t.children = "<strong>#{to_xml(t.children)}</strong>"
@@ -141,8 +139,7 @@ module IsoDoc
141
139
  end
142
140
 
143
141
  def toc_title(docxml)
144
- doctype = docxml.at(ns("//bibdata/ext/doctype"))
145
- doctype&.text == "resolution" and return
142
+ @doctype == "resolution" and return
146
143
  super
147
144
  end
148
145
 
@@ -42,7 +42,7 @@ module IsoDoc
42
42
  end
43
43
 
44
44
  def convert1(docxml, filename, dir)
45
- if docxml&.at(ns("//bibdata/ext/doctype"))&.text == "service-publication"
45
+ if @doctype == "service-publication"
46
46
  @wordcoverpage = html_doc_path("word_itu_titlepage_sp.html")
47
47
  options[:bodyfont] = "Arial"
48
48
  options[:headerfont] = "Arial"
@@ -35,11 +35,6 @@ module IsoDoc
35
35
  { path: "//preface/*", multi: true }]
36
36
  end
37
37
 
38
- def initial_anchor_names(doc)
39
- @doctype = doc&.at(ns("//bibdata/ext/doctype"))&.text
40
- super
41
- end
42
-
43
38
  def annextype(clause)
44
39
  if clause["obligation"] == "informative" then @labels["appendix"]
45
40
  else @labels["annex"]
@@ -9,8 +9,7 @@ module Metanorma
9
9
  end
10
10
 
11
11
  def resolution_inline_header(xml)
12
- return unless xml&.at("//bibdata/ext/doctype")&.text == "resolution"
13
-
12
+ @doctype == "resolution" or return
14
13
  xml.xpath("//clause//clause").each do |c|
15
14
  next if (title = c.at("./title")) && !title&.text&.empty?
16
15
 
@@ -7,13 +7,12 @@ module Metanorma
7
7
  end
8
8
 
9
9
  def doctype_validate(xmldoc)
10
- doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
11
10
  %w(recommendation recommendation-supplement recommendation-amendment
12
11
  recommendation-corrigendum recommendation-errata recommendation-annex
13
12
  focus-group implementers-guide technical-paper technical-report
14
- joint-itu-iso-iec service-publication).include? doctype or
13
+ joint-itu-iso-iec service-publication).include? @doctype or
15
14
  @log.add("Document Attributes", nil,
16
- "#{doctype} is not a recognised document type")
15
+ "#{@doctype} is not a recognised document type")
17
16
  end
18
17
 
19
18
  def stage_validate(xmldoc)
@@ -111,9 +110,8 @@ module Metanorma
111
110
  end
112
111
 
113
112
  def unnumbered_check(xmldoc)
114
- doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
115
113
  xmldoc.xpath("//clause[@unnumbered = 'true']").each do |c|
116
- next if (doctype == "resolution") && (c.parent.name == "sections") &&
114
+ next if (@doctype == "resolution") && (c.parent.name == "sections") &&
117
115
  !c.at("./preceding-sibling::clause")
118
116
 
119
117
  @log.add("Style", c, "Unnumbered clause out of place")
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.3.1".freeze
3
+ VERSION = "2.3.2".freeze
4
4
  end
5
5
  end
@@ -25,8 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
- spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.5.4"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.6.0"
30
29
  spec.add_dependency "ruby-jing"
31
30
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
31
  spec.add_dependency "tzinfo-data" # we need this for windows only
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.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
- - !ruby/object:Gem::Dependency
14
- name: htmlentities
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 4.3.4
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 4.3.4
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: metanorma-standoc
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 2.5.4
19
+ version: 2.6.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 2.5.4
26
+ version: 2.6.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: ruby-jing
43
29
  requirement: !ruby/object:Gem::Requirement