relaton-bipm 1.12.1 → 1.13.0

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: 452c7efc10863231dddcf973d6bba23c40756b5e2bb4eae6a6fe05f1454a8fcc
4
- data.tar.gz: 559200bd9b5700cfa2f11f69bfa379ae4fe2da10a12a1a0395e1eeb2710cd88e
3
+ metadata.gz: 60cc8b3979fffe05b9bc5d554e7bc6b486867a5a32f332b30c8fb30601b49b18
4
+ data.tar.gz: 3e20d99bb7d1055b6bedc2ab42a8c9eb074738ee8ebd8d26aba67f824a4935d0
5
5
  SHA512:
6
- metadata.gz: 07ec7af51e53a3ecd5fae8fcd4870d8debcbcd4630ad5d8936b9e884e2ed127cfe3a26a6930af742a08067d3f129a7135c1374b3f684d795f00d2b5c6fa56ced
7
- data.tar.gz: c04e0cee65e8e3ea11dff07868c7f633e8d82cd61d6962eb4788e871275e0f08639ae1947d3b4e2b29f00884e82e77ad9589ae0b2b9c672c8ee9b1289b874e5d
6
+ metadata.gz: 5a59447492ae98160a67ed7a5f2843f211edbca658a452e685f521a5a940d102ee47d2b7d39265077407ff5a0cf9892f9d9c19e0719ad7c46e304b9f797e4709
7
+ data.tar.gz: d0c55fe5d12003e400cc660c6561bcf5878741b955785951089405ee64b4e94bc3067b8181f72b88ec7bb04a27dd93163cf19b289bdd3c3c1ccfff68b85579a1
data/README.adoc CHANGED
@@ -263,7 +263,7 @@ RelatonBipm::BipmBibliographicItem.from_hash hash
263
263
 
264
264
  This gem uses following datasets as data sources:
265
265
  - `bipm-data-outcomes` - looking for local directory with the repository https://github.com/metanorma/bipm-data-outcomes
266
- - `si-brochute` - looking for local directory with the repository https://github.com/metanorma/bipm-si-brochure
266
+ - `bipm-si-brochute` - looking for local directory with the repository https://github.com/metanorma/bipm-si-brochure
267
267
 
268
268
  The method `RelatonBipm::DataFetcher.fetch(sourece, output: "data", format: "yaml")` fetches all the documents from the datast and save them to the `./data` folder in YAML format.
269
269
  Arguments:
@@ -280,7 +280,7 @@ Stopped at: 2022-06-23 09:36:58 +0200
280
280
  Done in: 2 sec.
281
281
  => nil
282
282
 
283
- RelatonBipm::DataFetcher.fetch "si-brochure"
283
+ RelatonBipm::DataFetcher.fetch "bipm-si-brochure"
284
284
  Started at: 2022-06-23 09:37:12 +0200
285
285
  Stopped at: 2022-06-23 09:37:12 +0200
286
286
  Done in: 0 sec.
data/grammars/biblio.rng CHANGED
@@ -225,9 +225,9 @@
225
225
  <zeroOrMore>
226
226
  <ref name="forename"/>
227
227
  </zeroOrMore>
228
- <zeroOrMore>
229
- <ref name="initial"/>
230
- </zeroOrMore>
228
+ <optional>
229
+ <ref name="formatted-initials"/>
230
+ </optional>
231
231
  <ref name="surname"/>
232
232
  <zeroOrMore>
233
233
  <ref name="addition"/>
@@ -247,8 +247,8 @@
247
247
  <ref name="LocalizedString"/>
248
248
  </element>
249
249
  </define>
250
- <define name="initial">
251
- <element name="initial">
250
+ <define name="formatted-initials">
251
+ <element name="formatted-initials">
252
252
  <ref name="LocalizedString"/>
253
253
  </element>
254
254
  </define>
@@ -264,6 +264,9 @@
264
264
  </define>
265
265
  <define name="forename">
266
266
  <element name="forename">
267
+ <optional>
268
+ <attribute name="initial"/>
269
+ </optional>
267
270
  <ref name="LocalizedString"/>
268
271
  </element>
269
272
  </define>
data/grammars/isodoc.rng CHANGED
@@ -69,6 +69,17 @@
69
69
  </zeroOrMore>
70
70
  </element>
71
71
  </define>
72
+ <define name="AdmonitionType">
73
+ <choice>
74
+ <value>warning</value>
75
+ <value>note</value>
76
+ <value>tip</value>
77
+ <value>important</value>
78
+ <value>caution</value>
79
+ <value>statement</value>
80
+ <value>editorial</value>
81
+ </choice>
82
+ </define>
72
83
  <define name="index">
73
84
  <element name="index">
74
85
  <optional>
@@ -1274,7 +1285,12 @@
1274
1285
  </define>
1275
1286
  <define name="span">
1276
1287
  <element name="span">
1277
- <attribute name="class"/>
1288
+ <optional>
1289
+ <attribute name="class"/>
1290
+ </optional>
1291
+ <optional>
1292
+ <attribute name="style"/>
1293
+ </optional>
1278
1294
  <oneOrMore>
1279
1295
  <ref name="TextElement"/>
1280
1296
  </oneOrMore>
@@ -2493,6 +2509,16 @@
2493
2509
  <text/>
2494
2510
  </element>
2495
2511
  </optional>
2512
+ <optional>
2513
+ <element name="amendment">
2514
+ <text/>
2515
+ </element>
2516
+ </optional>
2517
+ <optional>
2518
+ <element name="corrigendum">
2519
+ <text/>
2520
+ </element>
2521
+ </optional>
2496
2522
  <optional>
2497
2523
  <element name="language">
2498
2524
  <text/>
@@ -25,7 +25,7 @@ module RelatonBipm
25
25
  def self.fetch(source, output: "data", format: "yaml")
26
26
  t1 = Time.now
27
27
  puts "Started at: #{t1}"
28
- FileUtils.mkdir_p output unless Dir.exist? output
28
+ FileUtils.mkdir_p output
29
29
  new(output, format).fetch(source)
30
30
  t2 = Time.now
31
31
  puts "Stopped at: #{t2}"
@@ -40,7 +40,7 @@ module RelatonBipm
40
40
  def fetch(source)
41
41
  case source
42
42
  when "bipm-data-outcomes" then parse_bipm_data_outcomes
43
- when "si-brochure" then parse_si_brochure
43
+ when "bipm-si-brochure" then parse_si_brochure
44
44
  end
45
45
  File.write @index_path, @index.to_yaml, encoding: "UTF-8"
46
46
  end
@@ -57,7 +57,13 @@ module RelatonBipm
57
57
  # Parse SI brochure and write them to YAML files
58
58
  #
59
59
  def parse_si_brochure # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
60
+ # puts "Parsing SI brochure..."
61
+ # puts "Ls #{Dir['*']}"
62
+ # puts "Ls #{Dir['bipm-si-brochure/*']}"
63
+ # puts "Ls #{Dir['bipm-si-brochure/site/*']}"
64
+ # puts "Ls #{Dir['bipm-si-brochure/site/documents/*']}"
60
65
  Dir["bipm-si-brochure/site/documents/*.rxl"].each do |f|
66
+ puts "Parsing #{f}"
61
67
  docstd = Nokogiri::XML File.read f
62
68
  doc = docstd.at "/bibdata"
63
69
  hash1 = RelatonBipm::XMLParser.from_xml(doc.to_xml).to_hash
@@ -75,6 +81,7 @@ module RelatonBipm
75
81
  end
76
82
  item = RelatonBipm::BipmBibliographicItem.from_hash(**hash)
77
83
  write_file outfile, item, warn_duplicate: warn_duplicate
84
+ puts "Saved to #{outfile}"
78
85
  end
79
86
  end
80
87
 
@@ -117,9 +124,9 @@ module RelatonBipm
117
124
  def fetch_type(dir, body) # rubocop:disable Metrics/AbcSize
118
125
  type = dir.split("/").last.split("-").first.sub(/s$/, "")
119
126
  body_dir = File.join @output, body.downcase
120
- Dir.mkdir body_dir unless Dir.exist? body_dir
127
+ FileUtils.mkdir_p body_dir
121
128
  outdir = File.join body_dir, type.downcase
122
- Dir.mkdir outdir unless Dir.exist? outdir
129
+ FileUtils.mkdir_p outdir
123
130
  Dir[File.join(dir, "*.{yml,yaml}")].each { |en_file| fetch_meeting en_file, body, type, outdir }
124
131
  end
125
132
 
@@ -228,7 +235,7 @@ module RelatonBipm
228
235
  file += "-#{num_justed}" if num.size < 4
229
236
  file += ".yaml"
230
237
  out_dir = File.join args[:dir], r["type"].downcase
231
- Dir.mkdir out_dir unless Dir.exist? out_dir
238
+ FileUtils.mkdir_p out_dir
232
239
  path = File.join out_dir, file
233
240
  write_file path, item
234
241
  @index[["#{args[:body]} #{type} #{year}-#{num_justed}", "#{args[:body]} #{type} #{args[:num]}-#{num_justed}"]] = path
@@ -9,7 +9,7 @@ module RelatonBipm
9
9
  @prefix = "BIPM"
10
10
  @defaultprefix = %r{^(?:BIPM|CCTF|CCDS|CGPM|CIPM)(?!\w)}
11
11
  @idtype = "BIPM"
12
- @datasets = %w[bipm-data-outcomes si-brochure]
12
+ @datasets = %w[bipm-data-outcomes bipm-si-brochure]
13
13
  end
14
14
 
15
15
  # @param code [String]
@@ -1,3 +1,3 @@
1
1
  module RelatonBipm
2
- VERSION = "1.12.1".freeze
2
+ VERSION = "1.13.0".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.12.0"
45
+ spec.add_dependency "relaton-bib", "~> 1.13.0"
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.12.1
4
+ version: 1.13.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: 2022-06-28 00:00:00.000000000 Z
11
+ date: 2022-08-21 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.12.0
145
+ version: 1.13.0
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.12.0
152
+ version: 1.13.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubyzip
155
155
  requirement: !ruby/object:Gem::Requirement