relaton-bipm 1.11.8 → 1.12.1

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: d9f54a255e430e5079420ef5a4073baa326b29cbb3d687406b9c940fd1ad7406
4
- data.tar.gz: 2e26e487ef00db549f1fa10075c27de47c520b38544c3e408274299805aae4ff
3
+ metadata.gz: 452c7efc10863231dddcf973d6bba23c40756b5e2bb4eae6a6fe05f1454a8fcc
4
+ data.tar.gz: 559200bd9b5700cfa2f11f69bfa379ae4fe2da10a12a1a0395e1eeb2710cd88e
5
5
  SHA512:
6
- metadata.gz: b20367d802b0f7b46794cc28d149c411ec8f7ec88af5b22195b465051eb28fcd4ae5f49fdcf41a78a8651f79d197a4a96f861ab126801563dfaf8c089b0e5c06
7
- data.tar.gz: c06515b865194bf25520c942025419a0502eb03bff3bc80c9ebb649c91634210cf89afc239319278d81f105cb2af726349ce0c9c4aebfc3ff72c0f6bed90d261
6
+ metadata.gz: 07ec7af51e53a3ecd5fae8fcd4870d8debcbcd4630ad5d8936b9e884e2ed127cfe3a26a6930af742a08067d3f129a7135c1374b3f684d795f00d2b5c6fa56ced
7
+ data.tar.gz: c04e0cee65e8e3ea11dff07868c7f633e8d82cd61d6962eb4788e871275e0f08639ae1947d3b4e2b29f00884e82e77ad9589ae0b2b9c672c8ee9b1289b874e5d
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 2.6
11
11
  Rails:
12
12
  Enabled: false
data/README.adoc CHANGED
@@ -33,6 +33,61 @@ Or install it yourself as:
33
33
 
34
34
  === Search for a standard using keywords
35
35
 
36
+ ==== References for Si-Brochure documents
37
+
38
+ `BIPM {DOCUMENT_NAME}`
39
+
40
+ Allowed document names are:
41
+
42
+ - guide-ccem-ampere-realization
43
+ - guide-ccl-metre-realization-1
44
+ - guide-ccl-metre-realization-2
45
+ - guide-ccl-metre-realization-3
46
+ - guide-ccm-kilogram-calibration
47
+ - guide-ccm-kilogram-dissemination
48
+ - mep-ampere-definition
49
+ - mep-candela-definition
50
+ - mep-candela-rapport
51
+ - mep-kelvin-absolute-uncertainty
52
+ - mep-kelvin-absolute
53
+ - mep-kelvin-definition
54
+ - mep-kelvin-lt-johnson-noise
55
+ - mep-kelvin-relative
56
+ - mep-kilogram-definition
57
+ - mep-metre-definition
58
+ - mep-mole-definition
59
+ - mep-second-definition
60
+ - si-brochure
61
+ - sib-a4
62
+
63
+ ==== Reference structire for Metrologia documents
64
+
65
+ `BIPM Metrologia {JOURNAL} {VOLUME} {ISSUE} {ARTICLE}`
66
+
67
+ - `{JOURNAL}` - number of journal, required
68
+ - `{VOLUME}` - number of volume, optional
69
+ - `{ISSUE}` - number of issue, optional
70
+ - `{ARTICLE}` - number of article, optional
71
+
72
+ ==== Reference structures for CCTF (CCDS), CGMP, CIPM documents
73
+
74
+ - `{BODY} {TYPE} {YEAR}-{2_DIGITS_NUMBER}`
75
+ - `{BODY} {TYPE} {NUMBER} ({YEAR})` or `{BODY} {TYPE} {NUMBER} {YEAR}`
76
+ - `{BODY} {TYPE} {MEETING_NUMBER}-{2_DIGITS_NUMBER}`
77
+ - `{BODY} {TYPE} ({YEAR})` or `{BODY} {TYPE} {YEAR}` - in case only one Resolution/Decision/Declaration/Recommendation is available for the year
78
+ - `{BODY} Meeting {MEETING_NUMBER}` or French version `{BODY} Réunion {MEETING_NUMBER}`
79
+
80
+ The parts of the structures:
81
+
82
+ - `{BODY}` - could be `CCTF` (or old named `CCDS`), CGMP, or CIMP
83
+ - `{TYPE}` - could be English word: `Resolution`, `Decision`, `Declaration`, `Recommendation`; or French word: `Résolution`, `Décision`, `Déclaration`, `Recommandation`
84
+ - `{YEAR}` - year of Resolution/Decision/Declaration/Recommendation
85
+ - `{NUMBER}` - number of Resolution/Decision/Declaration/Recommendation
86
+ - `{2_DIGITS_NUMBER}` - two digits number of Resolution/Decision/Declaration/Recommendatio with lead zero if needs
87
+ - `{MEETING_NUMBER}` - number of mieeting
88
+
89
+ ==== Examples
90
+
36
91
  [source,ruby]
37
92
  ----
38
93
  require 'relaton_bipm'
@@ -78,7 +133,7 @@ RelatonBipm::BipmBibliography.get "CGPM Resolution 1889"
78
133
  => #<RelatonBipm::BipmBibliographicItem:0x00007ff0d1ffae50
79
134
  ...
80
135
 
81
- # get CIPM decision
136
+ # get CIPM decision by year and decision number
82
137
  RelatonBipm::BipmBibliography.get "CIPM Decision 2012-01"
83
138
  [relaton-bipm] ("CIPM Decision 2012-01") fetching...
84
139
  [relaton-bipm] ("CIPM Decision 2012-01") found CIPM Decision 1 (2012)
@@ -91,6 +146,13 @@ RelatonBipm::BipmBibliography.get "CIPM Decision 1 (2012)"
91
146
  => #<RelatonBipm::BipmBibliographicItem:0x00007fb6b9bbec08
92
147
  ...
93
148
 
149
+ # get CIPM decision by meeting number and decision number
150
+ RelatonBipm::BipmBibliography.get "CIPM Decision 101-01"
151
+ [relaton-bipm] ("CIPM Decision 101-01") fetching...
152
+ [relaton-bipm] ("CIPM Decision 101-01") found CIPM Decision 1 (2012)
153
+ => #<RelatonBipm::BipmBibliographicItem:0x00007f9ef2acc400
154
+ ...
155
+
94
156
  # get CIPM recommendation
95
157
  RelatonBipm::BipmBibliography.get "CIPM Recommendation (1948)"
96
158
  [relaton-bipm] ("CIPM Recommendation (1948)") fetching...
@@ -197,6 +259,34 @@ RelatonBipm::BipmBibliographicItem.from_hash hash
197
259
  ...
198
260
  ----
199
261
 
262
+ === Fetch data
263
+
264
+ This gem uses following datasets as data sources:
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
267
+
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
+ Arguments:
270
+
271
+ - `source` - name of the source dataset
272
+ - `output` - folder to save documents (default './data').
273
+ - `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml`, `bibxxml` (default `yaml`).
274
+
275
+ [source,ruby]
276
+ ----
277
+ RelatonBipm::DataFetcher.fetch "bipm-data-outcomes"
278
+ Started at: 2022-06-23 09:36:55 +0200
279
+ Stopped at: 2022-06-23 09:36:58 +0200
280
+ Done in: 2 sec.
281
+ => nil
282
+
283
+ RelatonBipm::DataFetcher.fetch "si-brochure"
284
+ Started at: 2022-06-23 09:37:12 +0200
285
+ Stopped at: 2022-06-23 09:37:12 +0200
286
+ Done in: 0 sec.
287
+ => nil
288
+ ----
289
+
200
290
  == Development
201
291
 
202
292
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/grammars/biblio.rng CHANGED
@@ -614,12 +614,103 @@
614
614
  <optional>
615
615
  <ref name="fetched"/>
616
616
  </optional>
617
- <choice>
618
- <oneOrMore>
619
- <ref name="btitle"/>
620
- </oneOrMore>
617
+ <optional>
621
618
  <ref name="formattedref"/>
622
- </choice>
619
+ </optional>
620
+ <oneOrMore>
621
+ <ref name="btitle"/>
622
+ </oneOrMore>
623
+ <zeroOrMore>
624
+ <ref name="bsource"/>
625
+ </zeroOrMore>
626
+ <oneOrMore>
627
+ <ref name="docidentifier"/>
628
+ </oneOrMore>
629
+ <optional>
630
+ <ref name="docnumber"/>
631
+ </optional>
632
+ <zeroOrMore>
633
+ <ref name="bdate"/>
634
+ </zeroOrMore>
635
+ <zeroOrMore>
636
+ <ref name="contributor"/>
637
+ </zeroOrMore>
638
+ <optional>
639
+ <ref name="edition"/>
640
+ </optional>
641
+ <zeroOrMore>
642
+ <ref name="version"/>
643
+ </zeroOrMore>
644
+ <zeroOrMore>
645
+ <ref name="biblionote"/>
646
+ </zeroOrMore>
647
+ <zeroOrMore>
648
+ <ref name="language"/>
649
+ </zeroOrMore>
650
+ <zeroOrMore>
651
+ <ref name="script"/>
652
+ </zeroOrMore>
653
+ <zeroOrMore>
654
+ <ref name="bibabstract"/>
655
+ </zeroOrMore>
656
+ <optional>
657
+ <ref name="status"/>
658
+ </optional>
659
+ <zeroOrMore>
660
+ <ref name="copyright"/>
661
+ </zeroOrMore>
662
+ <zeroOrMore>
663
+ <ref name="docrelation"/>
664
+ </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="series"/>
667
+ </zeroOrMore>
668
+ <optional>
669
+ <ref name="medium"/>
670
+ </optional>
671
+ <zeroOrMore>
672
+ <ref name="bplace"/>
673
+ </zeroOrMore>
674
+ <zeroOrMore>
675
+ <ref name="bprice"/>
676
+ </zeroOrMore>
677
+ <zeroOrMore>
678
+ <ref name="extent"/>
679
+ </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
683
+ <zeroOrMore>
684
+ <ref name="accesslocation"/>
685
+ </zeroOrMore>
686
+ <zeroOrMore>
687
+ <ref name="license"/>
688
+ </zeroOrMore>
689
+ <zeroOrMore>
690
+ <ref name="bclassification"/>
691
+ </zeroOrMore>
692
+ <zeroOrMore>
693
+ <ref name="bkeyword"/>
694
+ </zeroOrMore>
695
+ <optional>
696
+ <ref name="validity"/>
697
+ </optional>
698
+ </define>
699
+ <define name="ReducedBibliographicItem">
700
+ <optional>
701
+ <attribute name="type">
702
+ <ref name="BibItemType"/>
703
+ </attribute>
704
+ </optional>
705
+ <optional>
706
+ <ref name="fetched"/>
707
+ </optional>
708
+ <optional>
709
+ <ref name="formattedref"/>
710
+ </optional>
711
+ <zeroOrMore>
712
+ <ref name="btitle"/>
713
+ </zeroOrMore>
623
714
  <zeroOrMore>
624
715
  <ref name="bsource"/>
625
716
  </zeroOrMore>
@@ -638,9 +729,9 @@
638
729
  <optional>
639
730
  <ref name="edition"/>
640
731
  </optional>
641
- <optional>
732
+ <zeroOrMore>
642
733
  <ref name="version"/>
643
- </optional>
734
+ </zeroOrMore>
644
735
  <zeroOrMore>
645
736
  <ref name="biblionote"/>
646
737
  </zeroOrMore>
@@ -833,6 +924,12 @@
833
924
  <data type="boolean"/>
834
925
  </attribute>
835
926
  </optional>
927
+ <optional>
928
+ <attribute name="language"/>
929
+ </optional>
930
+ <optional>
931
+ <attribute name="script"/>
932
+ </optional>
836
933
  <text/>
837
934
  </element>
838
935
  </define>
@@ -986,36 +1083,34 @@
986
1083
  <ref name="SeriesType"/>
987
1084
  </attribute>
988
1085
  </optional>
989
- <choice>
1086
+ <optional>
990
1087
  <ref name="formattedref"/>
991
- <group>
992
- <ref name="btitle"/>
993
- <optional>
994
- <ref name="bplace"/>
995
- </optional>
996
- <optional>
997
- <ref name="seriesorganization"/>
998
- </optional>
999
- <optional>
1000
- <ref name="abbreviation"/>
1001
- </optional>
1002
- <optional>
1003
- <ref name="seriesfrom"/>
1004
- </optional>
1005
- <optional>
1006
- <ref name="seriesto"/>
1007
- </optional>
1008
- <optional>
1009
- <ref name="seriesnumber"/>
1010
- </optional>
1011
- <optional>
1012
- <ref name="seriespartnumber"/>
1013
- </optional>
1014
- <optional>
1015
- <ref name="seriesrun"/>
1016
- </optional>
1017
- </group>
1018
- </choice>
1088
+ </optional>
1089
+ <ref name="btitle"/>
1090
+ <optional>
1091
+ <ref name="bplace"/>
1092
+ </optional>
1093
+ <optional>
1094
+ <ref name="seriesorganization"/>
1095
+ </optional>
1096
+ <optional>
1097
+ <ref name="abbreviation"/>
1098
+ </optional>
1099
+ <optional>
1100
+ <ref name="seriesfrom"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <ref name="seriesto"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <ref name="seriesnumber"/>
1107
+ </optional>
1108
+ <optional>
1109
+ <ref name="seriespartnumber"/>
1110
+ </optional>
1111
+ <optional>
1112
+ <ref name="seriesrun"/>
1113
+ </optional>
1019
1114
  </element>
1020
1115
  </define>
1021
1116
  <define name="SeriesType">
@@ -1174,7 +1269,7 @@
1174
1269
  </element>
1175
1270
  </optional>
1176
1271
  <element name="bibitem">
1177
- <ref name="BibliographicItem"/>
1272
+ <ref name="ReducedBibliographicItem"/>
1178
1273
  </element>
1179
1274
  <choice>
1180
1275
  <zeroOrMore>
@@ -1199,9 +1294,9 @@
1199
1294
  <optional>
1200
1295
  <ref name="revision-date"/>
1201
1296
  </optional>
1202
- <zeroOrMore>
1297
+ <optional>
1203
1298
  <ref name="draft"/>
1204
- </zeroOrMore>
1299
+ </optional>
1205
1300
  </element>
1206
1301
  </define>
1207
1302
  <define name="vedition">
data/grammars/bipm.rng CHANGED
@@ -198,6 +198,9 @@
198
198
  <optional>
199
199
  <attribute name="start"/>
200
200
  </optional>
201
+ <optional>
202
+ <ref name="tname"/>
203
+ </optional>
201
204
  <oneOrMore>
202
205
  <ref name="li"/>
203
206
  </oneOrMore>
data/grammars/isodoc.rng CHANGED
@@ -32,6 +32,43 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="admonition">
36
+ <element name="admonition">
37
+ <attribute name="type">
38
+ <ref name="AdmonitionType"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="class"/>
42
+ </optional>
43
+ <attribute name="id">
44
+ <data type="ID"/>
45
+ </attribute>
46
+ <optional>
47
+ <attribute name="uri">
48
+ <data type="anyURI"/>
49
+ </attribute>
50
+ </optional>
51
+ <optional>
52
+ <attribute name="coverpage">
53
+ <data type="boolean"/>
54
+ </attribute>
55
+ </optional>
56
+ <optional>
57
+ <attribute name="notag">
58
+ <data type="boolean"/>
59
+ </attribute>
60
+ </optional>
61
+ <optional>
62
+ <ref name="tname"/>
63
+ </optional>
64
+ <zeroOrMore>
65
+ <ref name="paragraph-with-footnote"/>
66
+ </zeroOrMore>
67
+ <zeroOrMore>
68
+ <ref name="note"/>
69
+ </zeroOrMore>
70
+ </element>
71
+ </define>
35
72
  <define name="index">
36
73
  <element name="index">
37
74
  <optional>
@@ -79,6 +116,11 @@
79
116
  <data type="boolean"/>
80
117
  </attribute>
81
118
  </optional>
119
+ <optional>
120
+ <attribute name="suppress_identifier">
121
+ <data type="boolean"/>
122
+ </attribute>
123
+ </optional>
82
124
  <ref name="BibliographicItem"/>
83
125
  </element>
84
126
  </define>
@@ -245,6 +287,9 @@
245
287
  <ref name="MultilingualRenderingType"/>
246
288
  </attribute>
247
289
  </optional>
290
+ <optional>
291
+ <ref name="tname"/>
292
+ </optional>
248
293
  <oneOrMore>
249
294
  <ref name="ul_li"/>
250
295
  </oneOrMore>
@@ -287,6 +332,9 @@
287
332
  </choice>
288
333
  </attribute>
289
334
  </optional>
335
+ <optional>
336
+ <ref name="tname"/>
337
+ </optional>
290
338
  <oneOrMore>
291
339
  <ref name="li"/>
292
340
  </oneOrMore>
@@ -323,6 +371,9 @@
323
371
  <ref name="MultilingualRenderingType"/>
324
372
  </attribute>
325
373
  </optional>
374
+ <optional>
375
+ <ref name="tname"/>
376
+ </optional>
326
377
  <oneOrMore>
327
378
  <ref name="dt"/>
328
379
  <ref name="dd"/>
@@ -657,6 +708,9 @@
657
708
  <optional>
658
709
  <attribute name="tag"/>
659
710
  </optional>
711
+ <optional>
712
+ <attribute name="type"/>
713
+ </optional>
660
714
  <optional>
661
715
  <attribute name="multilingual-rendering">
662
716
  <ref name="MultilingualRenderingType"/>
@@ -692,6 +746,9 @@
692
746
  <optional>
693
747
  <attribute name="tag"/>
694
748
  </optional>
749
+ <optional>
750
+ <attribute name="type"/>
751
+ </optional>
695
752
  <optional>
696
753
  <attribute name="multilingual-rendering">
697
754
  <ref name="MultilingualRenderingType"/>
@@ -851,6 +908,16 @@
851
908
  <ref name="MultilingualRenderingType"/>
852
909
  </attribute>
853
910
  </optional>
911
+ <optional>
912
+ <attribute name="coverpage">
913
+ <data type="boolean"/>
914
+ </attribute>
915
+ </optional>
916
+ <optional>
917
+ <attribute name="notag">
918
+ <data type="boolean"/>
919
+ </attribute>
920
+ </optional>
854
921
  <oneOrMore>
855
922
  <choice>
856
923
  <ref name="paragraph"/>
@@ -1178,6 +1245,7 @@
1178
1245
  <ref name="concept"/>
1179
1246
  <ref name="add"/>
1180
1247
  <ref name="del"/>
1248
+ <ref name="span"/>
1181
1249
  </choice>
1182
1250
  </define>
1183
1251
  <define name="add">
@@ -1204,6 +1272,14 @@
1204
1272
  </choice>
1205
1273
  </element>
1206
1274
  </define>
1275
+ <define name="span">
1276
+ <element name="span">
1277
+ <attribute name="class"/>
1278
+ <oneOrMore>
1279
+ <ref name="TextElement"/>
1280
+ </oneOrMore>
1281
+ </element>
1282
+ </define>
1207
1283
  <define name="concept">
1208
1284
  <element name="concept">
1209
1285
  <optional>
@@ -1994,6 +2070,7 @@
1994
2070
  <value>compare</value>
1995
2071
  <value>contrast</value>
1996
2072
  <value>see</value>
2073
+ <value>seealso</value>
1997
2074
  </choice>
1998
2075
  </define>
1999
2076
  <define name="deprecates">
@@ -63,8 +63,8 @@ module RelatonBipm
63
63
  b.doctype doctype if doctype
64
64
  editorialgroup&.to_xml b
65
65
  comment_period&.to_xml b
66
- b.send "si-aspect", si_aspect if si_aspect
67
- b.send "meeting-note", meeting_note if meeting_note
66
+ b.send :"si-aspect", si_aspect if si_aspect
67
+ b.send :"meeting-note", meeting_note if meeting_note
68
68
  structuredidentifier&.to_xml b
69
69
  end
70
70
  end
@@ -76,7 +76,7 @@ module RelatonBipm
76
76
  hash = super
77
77
  hash["comment_period"] = comment_period.to_hash if comment_period
78
78
  hash["si_aspect"] = si_aspect if si_aspect
79
- hash["meeting-note"] = meeting_note if meeting_note
79
+ hash["meeting_note"] = meeting_note if meeting_note
80
80
  hash
81
81
  end
82
82
 
@@ -2,15 +2,14 @@ require "mechanize"
2
2
 
3
3
  module RelatonBipm
4
4
  class BipmBibliography
5
- GH_ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-bipm/master/data/".freeze
5
+ GH_ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-bipm/master/".freeze
6
6
  IOP_DOMAIN = "https://iopscience.iop.org".freeze
7
- SUBSTITUTES = {
7
+ TRANSLATIONS = {
8
8
  "Déclaration" => "Declaration",
9
9
  "Réunion" => "Meeting",
10
10
  "Recommandation" => "Recommendation",
11
11
  "Résolution" => "Resolution",
12
12
  "Décision" => "Decision",
13
- "CCDS" => "CCTF",
14
13
  }.freeze
15
14
 
16
15
  class << self
@@ -51,19 +50,17 @@ module RelatonBipm
51
50
  rf = ref.sub(/(?:(\d{1,2})\s)?\(?(\d{4})(?!-)\)?/) do
52
51
  "#{$2}-#{$1.to_s.rjust(2, '0')}"
53
52
  end
54
- SUBSTITUTES.each { |fr, en| rf.sub! fr, en }
55
- path_parts = rf.split.map &:downcase
56
- path_parts.insert(1, "meeting") unless path_parts[1] == "meeting"
57
- url = "#{GH_ENDPOINT}#{path_parts.join '/'}.yaml"
53
+ rf.sub!("CCDS", "CCTF")
54
+ TRANSLATIONS.each { |fr, en| rf.sub! fr, en }
55
+ path = Index.new.search rf
56
+ return unless path
57
+
58
+ url = "#{GH_ENDPOINT}#{path}"
58
59
  resp = agent.get url
59
60
  check_response resp
60
61
  return unless resp.code == "200"
61
62
 
62
- yaml = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0.pre1")
63
- YAML.safe_load(resp.body, permitted_classes: [Date])
64
- else
65
- YAML.safe_load(resp.body, [Date])
66
- end
63
+ yaml = RelatonBib.parse_yaml resp.body, [Date]
67
64
  bib_hash = HashConverter.hash_to_bib yaml
68
65
  BipmBibliographicItem.new(**bib_hash)
69
66
  end
@@ -1,9 +1,335 @@
1
1
  module RelatonBipm
2
2
  class DataFetcher
3
+ #
4
+ # Initialize fetcher
5
+ #
6
+ # @param [String] output output directory to save files
7
+ # @param [String] format format of output files (xml, yaml, bibxml)
8
+ #
3
9
  def initialize(output, format)
4
10
  @output = output
5
11
  @format = format
6
12
  @ext = format.sub(/^bib/, "")
13
+ @files = []
14
+ @index_path = "index.yaml"
15
+ @index = File.exist?(@index_path) ? YAML.load_file(@index_path) : {}
16
+ end
17
+
18
+ #
19
+ # Initialize fetcher and run fetching
20
+ #
21
+ # @param [String] source Source name
22
+ # @param [Strin] output directory to save files, default: "data"
23
+ # @param [Strin] format format of output files (xml, yaml, bibxml), default: yaml
24
+ #
25
+ def self.fetch(source, output: "data", format: "yaml")
26
+ t1 = Time.now
27
+ puts "Started at: #{t1}"
28
+ FileUtils.mkdir_p output unless Dir.exist? output
29
+ new(output, format).fetch(source)
30
+ t2 = Time.now
31
+ puts "Stopped at: #{t2}"
32
+ puts "Done in: #{(t2 - t1).round} sec."
33
+ end
34
+
35
+ #
36
+ # Fetch bipm-data-outcomes or si-brochure
37
+ #
38
+ # @param [String] source Source name
39
+ #
40
+ def fetch(source)
41
+ case source
42
+ when "bipm-data-outcomes" then parse_bipm_data_outcomes
43
+ when "si-brochure" then parse_si_brochure
44
+ end
45
+ File.write @index_path, @index.to_yaml, encoding: "UTF-8"
46
+ end
47
+
48
+ #
49
+ # Parse BIPM meeting and write them to YAML files
50
+ #
51
+ def parse_bipm_data_outcomes
52
+ source_path = File.join "bipm-data-outcomes", "{cctf,cgpm,cipm}"
53
+ Dir[source_path].each { |body_dir| fetch_body(body_dir) }
54
+ end
55
+
56
+ #
57
+ # Parse SI brochure and write them to YAML files
58
+ #
59
+ def parse_si_brochure # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
60
+ Dir["bipm-si-brochure/site/documents/*.rxl"].each do |f|
61
+ docstd = Nokogiri::XML File.read f
62
+ doc = docstd.at "/bibdata"
63
+ hash1 = RelatonBipm::XMLParser.from_xml(doc.to_xml).to_hash
64
+ hash1["fetched"] = Date.today.to_s
65
+ hash1["docid"].detect { |id| id["type"] == "BIPM" }["primary"] = true
66
+ outfile = File.join @output, File.basename(f).sub(/(?:-(?:en|fr))?\.rxl$/, ".yaml")
67
+ @index[[hash1["docnumber"] || File.basename(outfile, ".yaml")]] = outfile
68
+ hash = if File.exist? outfile
69
+ warn_duplicate = false
70
+ hash2 = YAML.load_file outfile
71
+ deep_merge hash1, hash2
72
+ else
73
+ warn_duplicate = true
74
+ hash1
75
+ end
76
+ item = RelatonBipm::BipmBibliographicItem.from_hash(**hash)
77
+ write_file outfile, item, warn_duplicate: warn_duplicate
78
+ end
79
+ end
80
+
81
+ #
82
+ # Deep merge two hashes
83
+ #
84
+ # @param [Hash] hash1
85
+ # @param [Hash] hash2
86
+ #
87
+ # @return [Hash] Merged hash
88
+ #
89
+ def deep_merge(hash1, hash2) # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
90
+ hash1.merge(hash2) do |_, oldval, newval|
91
+ if oldval.is_a?(Hash) && newval.is_a?(Hash)
92
+ deep_merge(oldval, newval)
93
+ elsif oldval.is_a?(Array) && newval.is_a?(Array)
94
+ oldval | newval
95
+ else
96
+ newval || oldval
97
+ end
98
+ end
99
+ end
100
+
101
+ #
102
+ # Search for English meetings in the body directory
103
+ #
104
+ # @param [String] dir body directory
105
+ #
106
+ def fetch_body(dir)
107
+ body = dir.split("/").last.upcase
108
+ Dir[File.join(dir, "*-en")].each { |type_dir| fetch_type type_dir, body }
109
+ end
110
+
111
+ #
112
+ # Search for meetings
113
+ #
114
+ # @param [String] dir meeting directory
115
+ # @param [String] body name of body
116
+ #
117
+ def fetch_type(dir, body) # rubocop:disable Metrics/AbcSize
118
+ type = dir.split("/").last.split("-").first.sub(/s$/, "")
119
+ body_dir = File.join @output, body.downcase
120
+ Dir.mkdir body_dir unless Dir.exist? body_dir
121
+ outdir = File.join body_dir, type.downcase
122
+ Dir.mkdir outdir unless Dir.exist? outdir
123
+ Dir[File.join(dir, "*.{yml,yaml}")].each { |en_file| fetch_meeting en_file, body, type, outdir }
124
+ end
125
+
126
+ #
127
+ # Create and write BIPM meeting/resolution
128
+ #
129
+ # @param [String] en_file Path to English file
130
+ # @param [String] body Body name
131
+ # @param [String] type Type of Recommendation/Decision/Resolution
132
+ # @param [String] dir output directory
133
+ #
134
+ def fetch_meeting(en_file, body, type, dir) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
135
+ en = RelatonBib.parse_yaml File.read(en_file, encoding: "UTF-8"), [Date]
136
+ en_md = en["metadata"]
137
+ fr_file = en_file.sub "en", "fr"
138
+ fr = RelatonBib.parse_yaml File.read(fr_file, encoding: "UTF-8"), [Date]
139
+ fr_md = fr["metadata"]
140
+ gh_src = "https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/"
141
+ src_en = gh_src + en_file.split("/")[-3..].unshift("main").join("/")
142
+ src_fr = gh_src + fr_file.split("/")[-3..].unshift("main").join("/")
143
+ src = [{ type: "src", content: src_en }, { type: "src", content: src_fr }]
144
+
145
+ /^(?<num>\d+)(?:-_(?<part>\d+))?-\d{4}$/ =~ en_md["url"].split("/").last
146
+ id = "#{body} #{type.capitalize} #{num}"
147
+ file = "#{num}.yaml"
148
+ path = File.join dir, file
149
+ link = "https://raw.githubusercontent.com/relaton/relaton-data-bipm/master/#{path}"
150
+ hash = bibitem type: type, en: en_md, fr: fr_md, id: id, num: num, src: src, pdf: en["pdf"]
151
+ if @files.include?(path) && part
152
+ add_part hash, part
153
+ item = RelatonBipm::BipmBibliographicItem.new(**hash)
154
+ yaml = RelatonBib.parse_yaml(File.read(path, encoding: "UTF-8"), [Date])
155
+ has_part_item = RelatonBipm::BipmBibliographicItem.from_hash(yaml)
156
+ has_part_item.relation << RelatonBib::DocumentRelation.new(type: "partOf", bibitem: item)
157
+ write_file path, has_part_item, warn_duplicate: false
158
+ path = File.join dir, "#{num}-#{part}.yaml"
159
+ elsif part
160
+ hash[:title].each { |t| t[:content] = t[:content].sub(/\s\(.+\)$/, "") }
161
+ hash[:link] = [{ type: "src", content: link }]
162
+ h = bibitem type: type, en: en_md, fr: fr_md, id: id, num: num, src: src, pdf: en["pdf"]
163
+ add_part h, part
164
+ part_item = RelatonBipm::BipmBibliographicItem.new(**h)
165
+ part_item_path = File.join dir, "#{num}-#{part}.yaml"
166
+ write_file part_item_path, part_item
167
+ @index[[h[:docnumber]]] = part_item_path
168
+ hash[:relation] = [RelatonBib::DocumentRelation.new(type: "partOf", bibitem: part_item)]
169
+ item = RelatonBipm::BipmBibliographicItem.new(**hash)
170
+ else
171
+ item = RelatonBipm::BipmBibliographicItem.new(**hash)
172
+ end
173
+ write_file path, item
174
+ @index[[hash[:docnumber]]] = path
175
+ fetch_resolution body: body, en: en, fr: fr, dir: dir, src: src, num: num
176
+ end
177
+
178
+ #
179
+ # Parse BIPM resolutions and write them to YAML files
180
+ #
181
+ # @param [String] body body name
182
+ # @param [Hash] eng English metadata
183
+ # @param [Hash] frn French metadata
184
+ # @param [String] dir output directory
185
+ # @param [Array<Hash>] src links to bipm-data-outcomes
186
+ # @param [String] num number of meeting
187
+ #
188
+ def fetch_resolution(**args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
189
+ args[:en]["resolutions"].each.with_index do |r, i| # rubocop:disable Metrics/BlockLength
190
+ hash = { fetched: Date.today.to_s, title: [], doctype: r["type"] }
191
+ hash[:title] << title(r["title"], "en") if r["title"]
192
+ fr_resolution = args[:fr]["resolutions"].fetch(i, nil)
193
+ if fr_resolution
194
+ fr_title = fr_resolution["title"]
195
+ hash[:title] << title(fr_title, "fr") if fr_title
196
+ end
197
+ date = r["dates"].first.to_s
198
+ hash[:date] = [{ type: "published", on: date }]
199
+ num = r["identifier"].to_s.split("-").last
200
+ year = date.split("-").first
201
+ num = "0" if num == year
202
+ num_justed = num.rjust 2, "0"
203
+ type = r["type"].capitalize
204
+ id = "#{args[:body]} #{type}"
205
+ hash[:id] = "#{args[:body]}-#{type}-#{year}"
206
+ if num.to_i.positive?
207
+ id += " #{num}"
208
+ hash[:id] += "-#{num_justed}"
209
+ end
210
+ id += " (#{year})"
211
+ hash[:docid] = [
212
+ make_docid(id: id, type: "BIPM", primary: true),
213
+ make_docid(id: id, type: "BIPM", primary: true, language: "en", script: "Latn"),
214
+ id_fr(id),
215
+ ]
216
+ hash[:docnumber] = id
217
+ hash[:link] = [{ type: "src", content: r["url"] }] + args[:src]
218
+ hash[:link] << { type: "pdf", content: r["reference"] } if r["reference"]
219
+ hash[:language] = %w[en fr]
220
+ hash[:script] = ["Latn"]
221
+ hash[:contributor] = [{
222
+ entity: { url: "www.bipm.org", name: "Bureau International des Poids et Mesures", abbreviation: "BIPM" },
223
+ role: [{ type: "publisher" }],
224
+ }]
225
+ hash[:structuredidentifier] = RelatonBipm::StructuredIdentifier.new docnumber: num
226
+ item = RelatonBipm::BipmBibliographicItem.new(**hash)
227
+ file = year
228
+ file += "-#{num_justed}" if num.size < 4
229
+ file += ".yaml"
230
+ out_dir = File.join args[:dir], r["type"].downcase
231
+ Dir.mkdir out_dir unless Dir.exist? out_dir
232
+ path = File.join out_dir, file
233
+ write_file path, item
234
+ @index[["#{args[:body]} #{type} #{year}-#{num_justed}", "#{args[:body]} #{type} #{args[:num]}-#{num_justed}"]] = path
235
+ end
236
+ end
237
+
238
+ def title(content, language)
239
+ { content: content, language: language, script: "Latn" }
240
+ end
241
+
242
+ #
243
+ # Add part to ID and structured identifier
244
+ #
245
+ # @param [Hash] hash Hash of BIPM meeting
246
+ # @param [String] session number of meeting
247
+ #
248
+ def add_part(hash, part)
249
+ hash[:id] += "-#{part}"
250
+ hash[:docnumber] += "-#{part}"
251
+ id = hash[:docid][0].instance_variable_get(:@id)
252
+ id += "-#{part}"
253
+ hash[:docid][0].instance_variable_set(:@id, id)
254
+ hash[:structuredidentifier].instance_variable_set :@part, part
255
+ end
256
+
257
+ #
258
+ # Create hash from BIPM meeting/resolution
259
+ #
260
+ # @param [Hash] **args Hash of arguments
261
+ # @option args [String] :type Type of meeting/resolution
262
+ # @option args [Hash] :en Hash of English metadata
263
+ # @option args [Hash] :fr Hash of French metadata
264
+ # @option args [String] :id ID of meeting/resolution
265
+ # @option args [String] :num Number of meeting/resolution
266
+ # @option args [Array<Hash>] :src Array of links to bipm-data-outcomes
267
+ # @option args [String] :pdf link to PDF
268
+ #
269
+ # @return [Hash] Hash of BIPM meeting/resolution
270
+ #
271
+ def bibitem(**args) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
272
+ hash = { title: [], doctype: args[:type], fetched: Date.today.to_s }
273
+ hash[:title] << title(args[:en]["title"], "en") if args[:en]["title"]
274
+ hash[:title] << title(args[:fr]["title"], "fr") if args[:fr]["title"]
275
+ hash[:date] = [{ type: "published", on: args[:en]["date"] }]
276
+ hash[:docid] = [
277
+ make_docid(id: args[:id], type: "BIPM", primary: true),
278
+ make_docid(id: args[:id], type: "BIPM", primary: true, language: "en", script: "Latn"),
279
+ id_fr(args[:id]),
280
+ ]
281
+ hash[:id] = args[:id].gsub " ", "-"
282
+ hash[:docnumber] = args[:id]
283
+ hash[:link] = [{ type: "src", content: args[:en]["url"] }]
284
+ RelatonBib.array(args[:pdf]).each { |pdf| hash[:link] << { type: "pdf", content: pdf } }
285
+ hash[:link] += args[:src] if args[:src]&.any?
286
+ hash[:language] = %w[en fr]
287
+ hash[:script] = ["Latn"]
288
+ hash[:contributor] = [{
289
+ entity: { url: "www.bipm.org", name: "Bureau International des Poids et Mesures", abbreviation: "BIPM" },
290
+ role: [{ type: "publisher" }],
291
+ }]
292
+ hash[:structuredidentifier] = RelatonBipm::StructuredIdentifier.new docnumber: args[:num]
293
+ hash
294
+ end
295
+
296
+ def id_fr(en_id)
297
+ tr = BipmBibliography::TRANSLATIONS.detect { |_, v| en_id.include? v }
298
+ id = en_id.sub tr[1], tr[0]
299
+ make_docid(id: id, type: "BIPM", primary: true, language: "fr", script: "Latn")
300
+ end
301
+
302
+ #
303
+ # Create doucment ID
304
+ #
305
+ # @param [String] id ID of document
306
+ # @param [String] type Type of document
307
+ # @param [Boolean] primary Primary document
308
+ # @param [String] language Language of document
309
+ # @param [String] script Script of document
310
+ #
311
+ # @return [RelatonBib::DocumentIdentifier] Document ID
312
+ #
313
+ def make_docid(**args)
314
+ RelatonBib::DocumentIdentifier.new(**args)
315
+ end
316
+
317
+ #
318
+ # Save document to file
319
+ #
320
+ # @param [String] path Path to file
321
+ # @param [RelatonBipm::BipmBibliographicItem] item document to save
322
+ # @param [Boolean, nil] warn_duplicate Warn if document already exists
323
+ #
324
+ # @return [<Type>] <description>
325
+ #
326
+ def write_file(path, item, warn_duplicate: true)
327
+ if @files.include?(path)
328
+ warn "File #{path} already exists" if warn_duplicate
329
+ else
330
+ @files << path
331
+ end
332
+ File.write path, item.to_hash.to_yaml, encoding: "UTF-8"
7
333
  end
8
334
  end
9
335
  end
@@ -9,7 +9,7 @@ module RelatonBipm
9
9
  # @param args [Hash]
10
10
  # @param nested [TrueClass, FalseClass]
11
11
  # @return [Hash]
12
- def hash_to_bib(args, nested = false)
12
+ def hash_to_bib(args)
13
13
  ret = super
14
14
  return if ret.nil?
15
15
 
@@ -28,7 +28,7 @@ module RelatonBipm
28
28
 
29
29
  # @param ret [Hash]
30
30
  def title_hash_to_bib(ret)
31
- ret[:title] &&= array(ret[:title])
31
+ ret[:title] &&= RelatonBib.array(ret[:title])
32
32
  .reduce(RelatonBib::TypedTitleStringCollection.new) do |m, t|
33
33
  m << if t.is_a? Hash
34
34
  RelatonBib::TypedTitleString.new(**t)
@@ -45,7 +45,7 @@ module RelatonBipm
45
45
 
46
46
  # @param ret [Hash]
47
47
  # def project_group_hash_to_bib(ret)
48
- # ret[:project_group] &&= array(ret[:project_group]).map do |pg|
48
+ # ret[:project_group] &&= RelatonBib.array(ret[:project_group]).map do |pg|
49
49
  # wg = RelatonBib::FormattedString.new pg[:workgroup]
50
50
  # ProjectTeam.new(committee: pg[:committee], workgroup: wg)
51
51
  # end
@@ -77,14 +77,14 @@ module RelatonBipm
77
77
  Committee.new(**c)
78
78
  end
79
79
  end
80
- wg = array(ret[:editorialgroup][:workgroup]).map do |w|
80
+ wg = RelatonBib.array(ret[:editorialgroup][:workgroup]).map do |w|
81
81
  w.is_a?(Hash) ? WorkGroup.new(**w) : WorkGroup.new(content: w)
82
82
  end
83
83
  ret[:editorialgroup] = EditorialGroup.new committee: cmt, workgroup: wg
84
84
  end
85
85
 
86
86
  def committee_variants(cmt)
87
- array(cmt[:variants]).each_with_object([]) do |v, a|
87
+ RelatonBib.array(cmt[:variants]).each_with_object([]) do |v, a|
88
88
  c = v[:content] || (ac = acronyms[cmt[:acronym]]) && ac[v[:language]]
89
89
  a << RelatonBib::LocalizedString.new(c, v[:language], v[:script]) if c
90
90
  end
@@ -0,0 +1,68 @@
1
+ module RelatonBipm
2
+ class Index
3
+ #
4
+ # Initialize index
5
+ #
6
+ def initialize
7
+ read_index_file || get_index_from_gh
8
+ end
9
+
10
+ #
11
+ # Search index entry
12
+ #
13
+ # @param [String] ref reference
14
+ #
15
+ # @return [String] path to document file
16
+ #
17
+ def search(ref)
18
+ @index.detect { |key, _| key.include? ref }&.last
19
+ end
20
+
21
+ private
22
+
23
+ #
24
+ # Create dir if need and return path to index file
25
+ #
26
+ # @return [String] path to index file
27
+ #
28
+ def path
29
+ @path ||= begin
30
+ dir = File.join Dir.home, ".relaton", "bipm"
31
+ FileUtils.mkdir_p dir unless Dir.exist? dir
32
+ File.join dir, "index.yaml"
33
+ end
34
+ end
35
+
36
+ #
37
+ # Read index from file if it exists and not outdated
38
+ #
39
+ # @return [Hash, nil] index content
40
+ #
41
+ def read_index_file
42
+ return if !File.exist?(path) || File.ctime(path).to_date < Date.today
43
+
44
+ @index = RelatonBib.parse_yaml File.read(path, encoding: "UTF-8")
45
+ end
46
+
47
+ #
48
+ # Save index to file
49
+ #
50
+ # @return [<Type>] <description>
51
+ #
52
+ def save_index_file
53
+ File.write path, @index.to_yaml, encoding: "UTF-8"
54
+ end
55
+
56
+ #
57
+ # Get index from a GitHub repository
58
+ #
59
+ # @return [Hash] index content
60
+ #
61
+ def get_index_from_gh # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
62
+ resp = Zip::InputStream.new URI("#{BipmBibliography::GH_ENDPOINT}index.zip").open
63
+ zip = resp.get_next_entry
64
+ @index = RelatonBib.parse_yaml zip.get_input_stream.read
65
+ save_index_file
66
+ end
67
+ end
68
+ end
@@ -9,6 +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
13
  end
13
14
 
14
15
  # @param code [String]
@@ -19,6 +20,19 @@ module RelatonBipm
19
20
  ::RelatonBipm::BipmBibliography.get(code, date, opts)
20
21
  end
21
22
 
23
+ #
24
+ # Fetch all the documents from https://github.com/metanorma/bipm-data-outcomes
25
+ # or https://github.com/metanorma/bipm-si-brochure
26
+ #
27
+ # @param [String] source source name
28
+ # @param [Hash] opts
29
+ # @option opts [String] :output directory to output documents
30
+ # @option opts [String] :format
31
+ #
32
+ def fetch_data(source, opts)
33
+ DataFetcher.fetch(source, **opts)
34
+ end
35
+
22
36
  # @param xml [String]
23
37
  # @return [RelatonBipm::BipmBibliographicItem]
24
38
  def from_xml(xml)
@@ -1,3 +1,3 @@
1
1
  module RelatonBipm
2
- VERSION = "1.11.8".freeze
2
+ VERSION = "1.12.1".freeze
3
3
  end
data/lib/relaton_bipm.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require "zip"
2
+ require "fileutils"
1
3
  require "relaton_bib"
2
4
  require "relaton_bipm/version"
3
5
  require "relaton_bipm/editorial_group"
@@ -11,16 +13,20 @@ require "relaton_bipm/bipm_bibliographic_item"
11
13
  require "relaton_bipm/bipm_bibliography"
12
14
  require "relaton_bipm/hash_converter"
13
15
  require "relaton_bipm/xml_parser"
16
+ require "relaton_bipm/index"
17
+ require "relaton_bipm/data_fetcher"
14
18
 
15
19
  module RelatonBipm
16
20
  class Error < StandardError; end
17
21
 
18
22
  # Returns hash of XML reammar
19
23
  # @return [String]
20
- def self.grammar_hash
24
+ def grammar_hash
21
25
  gem_path = File.expand_path "..", __dir__
22
26
  grammars_path = File.join gem_path, "grammars", "*"
23
27
  grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
24
28
  Digest::MD5.hexdigest grammars
25
29
  end
30
+
31
+ extend self
26
32
  end
data/relaton_bipm.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
12
12
  "bibliographic use using the BibliographicItem model"
13
13
  spec.homepage = "https://github.com/relaton/relaton-bipm"
14
14
  spec.license = "BSD-2-Clause"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
16
16
 
17
17
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
18
18
 
@@ -33,17 +33,16 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
33
33
  spec.require_paths = ["lib"]
34
34
 
35
35
  spec.add_development_dependency "byebug"
36
- # spec.add_development_dependency "debase"
37
36
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
38
37
  spec.add_development_dependency "pry-byebug"
39
- # spec.add_development_dependency "rake", "~> 13.0"
40
- # spec.add_development_dependency "ruby-debug-ide"
41
38
  spec.add_development_dependency "ruby-jing"
42
39
  spec.add_development_dependency "simplecov"
43
40
  spec.add_development_dependency "vcr"
44
41
  spec.add_development_dependency "webmock"
45
42
 
43
+ spec.add_dependency "faraday", "~> 1.0"
46
44
  spec.add_dependency "mechanize", "~> 2.8.0"
47
- spec.add_dependency "relaton-bib", "~> 1.11.0"
45
+ spec.add_dependency "relaton-bib", "~> 1.12.0"
46
+ spec.add_dependency "rubyzip", "~> 2.3.0"
48
47
  spec.add_dependency "serrano", "~> 1.0"
49
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.11.8
4
+ version: 1.12.1
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-03 00:00:00.000000000 Z
11
+ date: 2022-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: faraday
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: mechanize
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +142,28 @@ dependencies:
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 1.11.0
145
+ version: 1.12.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.12.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubyzip
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 2.3.0
132
160
  type: :runtime
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: 1.11.0
166
+ version: 2.3.0
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: serrano
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -185,6 +213,7 @@ files:
185
213
  - lib/relaton_bipm/document_relation.rb
186
214
  - lib/relaton_bipm/editorial_group.rb
187
215
  - lib/relaton_bipm/hash_converter.rb
216
+ - lib/relaton_bipm/index.rb
188
217
  - lib/relaton_bipm/processor.rb
189
218
  - lib/relaton_bipm/structured_identifier.rb
190
219
  - lib/relaton_bipm/version.rb
@@ -205,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
234
  requirements:
206
235
  - - ">="
207
236
  - !ruby/object:Gem::Version
208
- version: 2.5.0
237
+ version: 2.6.0
209
238
  required_rubygems_version: !ruby/object:Gem::Requirement
210
239
  requirements:
211
240
  - - ">="