metanorma-ogc 2.5.2 → 2.5.4

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,17 +68,21 @@ 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
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.5.2".freeze
3
+ VERSION = "2.5.4".freeze
4
4
  end
5
5
  end
@@ -1,8 +1,11 @@
1
1
  module Relaton
2
2
  module Render
3
- class Date
4
- def render
5
- @date&.sub(/-.*$/, "")
3
+ module Ogc
4
+ class Date < ::Relaton::Render::Date
5
+ def render
6
+ @type == "accessed" or @date&.sub(/-.*$/, "")
7
+ @date
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -1,5 +1,3 @@
1
- require_relative "date"
2
-
3
1
  module Relaton
4
2
  module Render
5
3
  module Ogc
@@ -1,6 +1,7 @@
1
1
  require "relaton-render"
2
2
  require_relative "parse"
3
3
  require_relative "fields"
4
+ require_relative "date"
4
5
 
5
6
  module Relaton
6
7
  module Render
@@ -11,12 +12,9 @@ module Relaton
11
12
  end
12
13
 
13
14
  def klass_initialize(_options)
14
- @nametemplateklass = Relaton::Render::Template::Name
15
- @seriestemplateklass = Relaton::Render::Template::Series
16
- @extenttemplateklass = Relaton::Render::Template::Extent
17
- @sizetemplateklass = Relaton::Render::Template::Size
18
- @generaltemplateklass = Relaton::Render::Template::General
15
+ super
19
16
  @fieldsklass = Relaton::Render::Ogc::Fields
17
+ @dateklass = Relaton::Render::Ogc::Date
20
18
  @parseklass = Relaton::Render::Ogc::Parse
21
19
  end
22
20
  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.2"
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.2
4
+ version: 2.5.4
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-19 00:00:00.000000000 Z
11
+ date: 2024-03-10 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.2
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.2
40
+ version: 2.8.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement