relaton-bipm 1.13.9 → 1.13.10

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: 25ba380a0a3c8be3a780f9ab4e5d9c07c73ba3b6e394718a46528ba731a05f8f
4
- data.tar.gz: 1d42cf0d52fac70d663ee102935dc369e38e56c2cba1a95a6246c62297cc5de1
3
+ metadata.gz: fc2075169e1f56321c3f81448e13c637de70a298c966d8fa9bebc8d084d275f6
4
+ data.tar.gz: aa2b8648ee7782726be9e1f35b7c84c7048178296bda8ef2b7771109bfec71d0
5
5
  SHA512:
6
- metadata.gz: de73958097527e957388c3fe0c1f2d4e22be73cd2be0bd1489e4ed327b575b20ff8bfab86ec2d412af5a0e34dc820e71b1d13f08b2a4bc25b5e10d4f207abb47
7
- data.tar.gz: a10dbfb2077646c9e35c3a910f16e94c1c3e0320e5dc321ffae055ccdf06fc798145df74f16c0b48b9a11fa382b3add39cae26ef676b36e33573f3884b1cf8b4
6
+ metadata.gz: cc3e9b8268d4a7f20fd3d8ca3e1f2cef8ca51f16a76fd0997a0c3edd957cda9f201af3e5c2e4de4f2beaf2a740b2cbbf6bf7fb0dd29138a7d3487c5dfc032de8
7
+ data.tar.gz: 2bc5c3a0df947808564955c755472aadccf38f525ddc9cce0eceeb9079ee8f5b048baf860050b4e1e33a08b180d6af3ed21706c162bf5b81508598a673857b1a
data/grammars/biblio.rng CHANGED
@@ -854,6 +854,12 @@
854
854
  <optional>
855
855
  <attribute name="type"/>
856
856
  </optional>
857
+ <optional>
858
+ <attribute name="language"/>
859
+ </optional>
860
+ <optional>
861
+ <attribute name="script"/>
862
+ </optional>
857
863
  <data type="anyURI"/>
858
864
  </define>
859
865
  <define name="DateType">
@@ -882,6 +888,7 @@
882
888
  <value>vote-started</value>
883
889
  <value>vote-ended</value>
884
890
  <value>announced</value>
891
+ <value>stable-until</value>
885
892
  </choice>
886
893
  </define>
887
894
  <define name="bdate">
@@ -180,7 +180,10 @@ module RelatonBipm
180
180
  gh_src = "https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/"
181
181
  src_en = gh_src + en_file.split("/")[-3..].unshift("main").join("/")
182
182
  src_fr = gh_src + fr_file.split("/")[-3..].unshift("main").join("/")
183
- src = [{ type: "src", content: src_en }, { type: "src", content: src_fr }]
183
+ src = [
184
+ { type: "src", content: src_en, language: "en", script: "Latn" },
185
+ { type: "src", content: src_fr, language: "fr", script: "Latn" },
186
+ ]
184
187
 
185
188
  /^(?<num>\d+)(?:-_(?<part>\d+))?-\d{4}$/ =~ en_md["url"].split("/").last
186
189
  id = "#{body} #{type.capitalize} #{num}"
@@ -275,30 +278,21 @@ module RelatonBipm
275
278
  end
276
279
  end
277
280
 
281
+ #
282
+ # Create contributors
283
+ #
284
+ # @param [Strign] date date of publication
285
+ # @param [Strign] body organization abbreviation (CCTF, CIPM, CGPM)
286
+ #
287
+ # @return [Array<Hash>] contributors
288
+ #
278
289
  def contributors(date, body) # rubocop:disable Metrics/MethodLength
279
- if body == "CCTF" && Date.parse(date).year < 1999
280
- authors = [{
281
- name: [
282
- { content: "Consultative Committee for the Definition of the Second",
283
- language: "en", script: "Latn" },
284
- { content: "Comité Consultatif pour la Définition de la Seconde",
285
- language: "fr", script: "Latn" },
286
- ],
287
- abbreviation: { content: "CCDS", language: ["en", "fr"], script: "Latn" },
288
- }]
289
- elsif body == "CCTF"
290
- authors = [{
291
- name: [
292
- { content: "Consultative Committee for Time and Frequency",
293
- language: "en", script: "Latn" },
294
- { content: "Comité consultatif du temps et des fréquences",
295
- language: "fr", script: "Latn" },
296
- ],
297
- abbreviation: { content: body, language: ["en", "fr"], script: "Latn" },
298
- }]
299
- else authors = []
300
- end
301
- authors.reduce(
290
+ case body
291
+ when "CCTF" then cctf_org date
292
+ when "CGPM" then cgpm_org
293
+ when "CIPM" then cipm_org
294
+ else []
295
+ end.reduce(
302
296
  [{ entity: {
303
297
  url: "www.bipm.org",
304
298
  name: "Bureau International des Poids et Mesures",
@@ -308,6 +302,76 @@ module RelatonBipm
308
302
  ) { |a, e| a << { entity: e, role: [{ type: "author" }] } }
309
303
  end
310
304
 
305
+ #
306
+ # Create CCTF organization
307
+ #
308
+ # @param [String] date date of meeting
309
+ #
310
+ # @return [Array<Hash>] CCTF organization
311
+ #
312
+ def cctf_org(date) # rubocop:disable Metrics/MethodLength
313
+ if Date.parse(date).year < 1999
314
+ nms = [
315
+ { content: "Consultative Committee for the Definition of the Second", language: "en" },
316
+ { content: "Comité Consultatif pour la Définition de la Seconde", language: "fr" },
317
+ ]
318
+ organization nms, "CCDS"
319
+ else
320
+ nms = [
321
+ { content: "Consultative Committee for Time and Frequency", language: "en" },
322
+ { content: "Comité consultatif du temps et des fréquences", language: "fr" },
323
+ ]
324
+ organization nms, "CCTF"
325
+ end
326
+ end
327
+
328
+ #
329
+ # Create organization
330
+ #
331
+ # @param [Array<Hash>] names organization names in different languages
332
+ # @param [String] abbr abbreviation
333
+ #
334
+ # @return [Array<Hash>] organization
335
+ #
336
+ def organization(names, abbr)
337
+ names.each { |ctrb| ctrb[:script] = "Latn" }
338
+ [{ name: names, abbreviation: { content: abbr, language: ["en", "fr"], script: "Latn" } }]
339
+ end
340
+
341
+ #
342
+ # Create CGPM organization
343
+ #
344
+ # @return [Array<Hash>] CGPM organization
345
+ #
346
+ def cgpm_org
347
+ nms = [
348
+ { content: "General Conference on Weights and Measures", language: "en" },
349
+ { content: "Conférence Générale des Poids et Mesures", language: "fr" },
350
+ ]
351
+ organization nms, "CGPM"
352
+ end
353
+
354
+ #
355
+ # Create CIPM organization
356
+ #
357
+ # @return [Array<Hash>] CIPM organization
358
+ #
359
+ def cipm_org
360
+ names = [
361
+ { content: "International Committee for Weights and Measures", language: "en" },
362
+ { content: "Comité International des Poids et Mesures", language: "fr" },
363
+ ]
364
+ organization names, "CIPM"
365
+ end
366
+
367
+ #
368
+ # Create a title
369
+ #
370
+ # @param [String] content title content
371
+ # @param [String] language language code (en, fr)
372
+ #
373
+ # @return [Hash] title
374
+ #
311
375
  def title(content, language)
312
376
  { content: content, language: language, script: "Latn" }
313
377
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonBipm
2
- VERSION = "1.13.9".freeze
2
+ VERSION = "1.13.10".freeze
3
3
  end
data/relaton_bipm.gemspec CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
42
42
 
43
43
  spec.add_dependency "faraday", "~> 1.0"
44
44
  spec.add_dependency "mechanize", "~> 2.8.0"
45
- spec.add_dependency "relaton-bib", "~> 1.13.0"
45
+ spec.add_dependency "relaton-bib", "~> 1.13.9"
46
46
  spec.add_dependency "rubyzip", "~> 2.3.0"
47
47
  spec.add_dependency "serrano", "~> 1.0"
48
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.9
4
+ version: 1.13.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-22 00:00:00.000000000 Z
11
+ date: 2022-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.13.0
145
+ version: 1.13.9
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.13.0
152
+ version: 1.13.9
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubyzip
155
155
  requirement: !ruby/object:Gem::Requirement