metanorma-ogc 2.5.1 → 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,14 +10,20 @@ module Metanorma
10
10
  personal_author(node, xml)
11
11
  end
12
12
 
13
+ def safe_xml_string(node, key, value)
14
+ node.send key do |n|
15
+ n << value
16
+ end
17
+ end
18
+
13
19
  def corporate_author(node, xml)
14
20
  node.attr("submitting-organizations") or return
15
- csv_split(HTMLEntities.new
16
- .decode(node.attr("submitting-organizations")), ";")&.each do |org|
21
+ csv_split(@c.decode(node.attr("submitting-organizations")),
22
+ ";")&.each do |org|
17
23
  xml.contributor do |c|
18
24
  c.role type: "author"
19
25
  c.organization do |a|
20
- a.name org
26
+ safe_xml_string(a, "name", org)
21
27
  end
22
28
  end
23
29
  end
@@ -39,9 +45,7 @@ module Metanorma
39
45
  type = node.attr("role#{suffix}")&.downcase || "editor"
40
46
  if type == "contributor"
41
47
  contrib.role type: "author" do |r|
42
- r.description do |d|
43
- d << type
44
- end
48
+ safe_xml_string(r, "description", type)
45
49
  end
46
50
  else contrib.role type: type
47
51
  end
@@ -64,23 +68,27 @@ module Metanorma
64
68
  personal_role(node, c, suffix)
65
69
  c.person do |p|
66
70
  p.name do |n|
67
- if node.attr("fullname#{suffix}")
68
- n.completename node.attr("fullname#{suffix}")
69
- else
70
- n.forename node.attr("givenname#{suffix}")
71
- n.surname node.attr("surname#{suffix}")
72
- end
71
+ personal_author_name(node, n, suffix)
73
72
  end
74
73
  end
75
74
  end
76
75
  end
77
76
 
77
+ def personal_author_name(node, xml, suffix)
78
+ if node.attr("fullname#{suffix}")
79
+ safe_xml_string(xml, "completename", node.attr("fullname#{suffix}"))
80
+ else
81
+ safe_xml_string(xml, "forename", node.attr("givenname#{suffix}"))
82
+ safe_xml_string(xml, "surname", node.attr("surname#{suffix}"))
83
+ end
84
+ end
85
+
78
86
  def default_publisher
79
87
  "OGC"
80
88
  end
81
89
 
82
- def org_abbrev
83
- { "Open Geospatial Consortium" => "OGC" }
90
+ def org_abbrev
91
+ { "Open Geospatial Consortium" => "OGC" }
84
92
  end
85
93
 
86
94
  def metadata_committee(node, xml)
@@ -108,7 +116,7 @@ module Metanorma
108
116
  a = node.attr("abbrev")
109
117
  d && a or return
110
118
  url = "http://www.opengis.net/doc/#{IsoDoc::Ogc::DOCTYPE_ABBR[d]}/#{a}"
111
- v = (node.attr("edition") || node.attr("version")) and url += "/#{v}"
119
+ v = node.attr("edition") || node.attr("version") and url += "/#{v}"
112
120
  url
113
121
  end
114
122
 
@@ -119,7 +127,6 @@ module Metanorma
119
127
  docnumber = node.attr("docnumber") || node.attr("docreference")
120
128
  id = node.attr("docidentifier") || docnumber
121
129
  xml.docidentifier id, type: "ogc-internal"
122
- docnumber and xml.docnumber docnumber
123
130
  end
124
131
 
125
132
  def externalurl(node)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.5.1".freeze
3
+ VERSION = "2.5.3".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.8.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.8.4"
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.5.1
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-05 00:00:00.000000000 Z
11
+ date: 2024-03-04 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.8.0
33
+ version: 2.8.4
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.8.0
40
+ version: 2.8.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement