relaton-bib 1.6.2 → 1.7.0

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: a7f6ef2eec280ac48d171fa25bc4c88d2df63692b5736823868f1751af971f3d
4
- data.tar.gz: 78e4a52cb0e1d1ce66404af62d2e7f79f27634acbf84094a19e0f593affbdb5a
3
+ metadata.gz: b162f79927577c4ac049606639ff9fbf62b563dc7836446db17b2b34c018bce2
4
+ data.tar.gz: 4e90844acb2975396d8fc818ca980c3c6ed81a011274c40a9970bb9a22d7f09d
5
5
  SHA512:
6
- metadata.gz: 226ead0669d2f060d24b541c8e0eab0d9357b0a697b96572aed3b68b539b97d9f2662f76669a7e0167eedd3fcbc1bdf8ff65e3d3135facdb1531619749095cba
7
- data.tar.gz: 2a333a1a1ba8aa6683a6abc6f97d521c3be510cbaa7455483266e62523764cf6e04de0b909a0109c21c0c1e5aab5fc224140f97b0f2b60c66d55535e5f434c12
6
+ metadata.gz: 96d3ee63701e6b88d312ff4f54c0a5877c7d658bd7553a4ba82cff664b04fa29b5c337e509289f2181f8b60c3ba2891e17df954a9721477a92fc7e01f6493bd6
7
+ data.tar.gz: d244ed452ffecbaa2f6b0dd5e9c9e8993d8ba7a9f9cab4f44d4052e2be9cfd7f08f19727d61f9eaaf31728a98ddd6f4d1a890e57ce9f771afa79595bae71b156
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -1164,49 +1177,7 @@
1164
1177
  </define>
1165
1178
  <define name="annex">
1166
1179
  <element name="annex">
1167
- <optional>
1168
- <attribute name="id">
1169
- <data type="ID"/>
1170
- </attribute>
1171
- </optional>
1172
- <optional>
1173
- <attribute name="language"/>
1174
- </optional>
1175
- <optional>
1176
- <attribute name="script"/>
1177
- </optional>
1178
- <optional>
1179
- <attribute name="inline-header">
1180
- <data type="boolean"/>
1181
- </attribute>
1182
- </optional>
1183
- <attribute name="obligation">
1184
- <choice>
1185
- <value>normative</value>
1186
- <value>informative</value>
1187
- </choice>
1188
- </attribute>
1189
- <optional>
1190
- <ref name="section-title"/>
1191
- </optional>
1192
- <group>
1193
- <group>
1194
- <zeroOrMore>
1195
- <ref name="BasicBlock"/>
1196
- </zeroOrMore>
1197
- <zeroOrMore>
1198
- <ref name="note"/>
1199
- </zeroOrMore>
1200
- </group>
1201
- <zeroOrMore>
1202
- <choice>
1203
- <ref name="annex-subsection"/>
1204
- <ref name="terms"/>
1205
- <ref name="definitions"/>
1206
- <ref name="references"/>
1207
- </choice>
1208
- </zeroOrMore>
1209
- </group>
1180
+ <ref name="Annex-Section"/>
1210
1181
  </element>
1211
1182
  </define>
1212
1183
  <define name="terms">
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.6.2".freeze
2
+ VERSION = "1.7.0".freeze
3
3
  end
@@ -177,16 +177,22 @@ module RelatonBib
177
177
  def ttitle(title)
178
178
  return unless title
179
179
 
180
- variants = title.xpath("variant").map do |v|
181
- LocalizedString.new v.text, v[:language], v[:script]
182
- end
183
- content = variants.any? ? variants : title.text
180
+ content = variants(title)
181
+ content = title.text unless content.any?
184
182
  TypedTitleString.new(
185
183
  type: title[:type], content: content, language: title[:language],
186
184
  script: title[:script], format: title[:format]
187
185
  )
188
186
  end
189
187
 
188
+ # @param title [Nokogiri::XML::Element]
189
+ # @return [Array<RelatonBib::LocalizedString>]
190
+ def variants(elm)
191
+ elm.xpath("variant").map do |v|
192
+ LocalizedString.new v.text, v[:language], v[:script]
193
+ end
194
+ end
195
+
190
196
  def fetch_status(item)
191
197
  status = item.at("./status")
192
198
  return unless status
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-17 00:00:00.000000000 Z
11
+ date: 2020-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug