metanorma-itu 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.
@@ -49,54 +49,12 @@ module IsoDoc
49
49
  "[#{num}]"
50
50
  end
51
51
 
52
- def reference_format(biblio, ref)
53
- reference_format_start(biblio, ref)
54
- super
55
- end
56
-
57
- def titlecase(str)
58
- str.gsub(/ |_|-/, " ").split(/ /).map(&:capitalize).join(" ")
59
- end
60
-
61
52
  def pref_ref_code(bibitem)
62
53
  ret = bibitem.xpath(ns("./docidentifier[@type = 'ITU']"))
63
54
  ret.empty? and ret = super
64
55
  ret
65
56
  end
66
57
 
67
- def multi_bibitem_ref_code(bibitem)
68
- id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or " \
69
- "#{IsoDoc::Function::References::SKIP_DOCID} or " \
70
- "@type = 'metanorma-ordinal')]"))
71
- id.empty? and
72
- id = bibitem.xpath(ns("./docidentifier[not(@type = 'metanorma' or " \
73
- "@type = 'metanorma-ordinal')]"))
74
- return [] if id.empty?
75
-
76
- id.sort_by { |i| i["type"] == "ITU" ? 0 : 1 }
77
- end
78
-
79
- def render_multi_identifiers(ids)
80
- ids.map do |id|
81
- if id["type"] == "ITU"
82
- doctype_title(id)
83
- else
84
- docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
85
- end
86
- end.join(" | ")
87
- end
88
-
89
- def doctype_title(id)
90
- type = id.parent&.at(ns("./ext/doctype"))&.text || "recommendation"
91
- if type == "recommendation" &&
92
- /^(?<prefix>ITU-[A-Z][  ][A-Z])[  .-]Sup[a-z]*\.[  ]?(?<num>\d+)$/ =~ id.text
93
- "#{prefix}-series Recommendations – Supplement #{num}"
94
- else
95
- d = docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
96
- "#{titlecase(type)} #{d}"
97
- end
98
- end
99
-
100
58
  def unbracket(ident)
101
59
  if ident.respond_to?(:size)
102
60
  ident.map { |x| unbracket1(x) }.join("&#xA0;| ")
@@ -104,15 +62,6 @@ module IsoDoc
104
62
  unbracket1(ident)
105
63
  end
106
64
  end
107
-
108
- def reference_format_start(bib, out)
109
- id = multi_bibitem_ref_code(bib)
110
- id1 = render_multi_identifiers(id)
111
- out << id1
112
- date = bib.at(ns("./date[@type = 'published']")) and
113
- out << " (#{date.text.sub(/-.*$/, '')})"
114
- out << ", " if date || !id1.empty?
115
- end
116
65
  end
117
66
  end
118
67
  end
@@ -45,7 +45,6 @@ module Metanorma
45
45
  xml.docidentifier type: "ITU-lang" do |i|
46
46
  i << itu_id1(node, true)
47
47
  end
48
- xml.docnumber { |i| i << node.attr("docnumber") }
49
48
  end
50
49
 
51
50
  def recommendation_id(node, xml)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.4.1".freeze
3
+ VERSION = "2.4.2".freeze
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require "relaton-render"
2
+ require_relative "parse"
2
3
 
3
4
  module Relaton
4
5
  module Render
@@ -7,6 +8,11 @@ module Relaton
7
8
  def config_loc
8
9
  YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
9
10
  end
11
+
12
+ def klass_initialize(_options)
13
+ super
14
+ @parseklass = Relaton::Render::ITU::Parse
15
+ end
10
16
  end
11
17
  end
12
18
  end
@@ -0,0 +1,9 @@
1
+ module Relaton
2
+ module Render
3
+ module ITU
4
+ class Parse < ::Relaton::Render::Parse
5
+ end
6
+ end
7
+ end
8
+ end
9
+
@@ -25,7 +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 "metanorma-standoc", "~> 2.8.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.8.2"
29
29
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
30
30
  spec.add_dependency "tzinfo-data" # we need this for windows only
31
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
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: 2024-02-05 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.0
19
+ version: 2.8.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.8.0
26
+ version: 2.8.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: twitter_cldr
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -308,6 +308,7 @@ files:
308
308
  - lib/metanorma/itu/version.rb
309
309
  - lib/relaton/render/config.yml
310
310
  - lib/relaton/render/general.rb
311
+ - lib/relaton/render/parse.rb
311
312
  - metanorma-itu.gemspec
312
313
  homepage: https://github.com/metanorma/metanorma-itu
313
314
  licenses: