relaton-bipm 1.16.5 → 1.16.6

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: b1d91960ac9f8357a2ced7209b3dcb7c3ff4637b899639c09a622c2715fe7d36
4
- data.tar.gz: 56536641e820e1d14336f8d40efce9a1be829c9356d362761740fc09a39d5b6f
3
+ metadata.gz: fed200c28077ec8e08f755b1185ec918797d15bf6937b884f207efd95837e230
4
+ data.tar.gz: e252b80a27cf21e0fd9c66af2bec464eea8cc578b6da66b4c51316b707aa4b39
5
5
  SHA512:
6
- metadata.gz: 57a28e5cc70fd280b02caa1d267fa79d8aff4e7b120847bae458e283977e631190d622b727c1830fa442c0507a46227548cee50666bf0010fe50fa242b62edc6
7
- data.tar.gz: cf74e9ff7b2ad3d2db08b17f8c4139b42d43cfe8bba98d7bd81bf154ea51341ecd821e596780b9415e839f47b664adf6d085b8e678fa3497f773211beb64d015
6
+ metadata.gz: 7d73f4d65055a47285532d0bcc0f812e58fa75a0790fc92a1e396d40b444732a84192e9f81467246552c61d0ae780a6449333186417f2a0154c756ae555e5097
7
+ data.tar.gz: 7415e3f9f5bb4cacaa3e28f79b25a08a22814a6de7c52e5effd21f53632c59bcce41a6d4ef52a84169ad996efdd8e82687c7404f32cd22b199ee50a6cfbd77f8
@@ -62,7 +62,7 @@ module RelatonBipm
62
62
 
63
63
  def index
64
64
  Relaton::Index.find_or_create(
65
- :bipm, url: "#{GH_ENDPOINT}index2.zip", file: INDEX_FILE, id_keys: %i[group type number year]
65
+ :bipm, url: "#{GH_ENDPOINT}index2.zip", file: INDEX_FILE, id_keys: %i[group type number year corr]
66
66
  )
67
67
  end
68
68
 
@@ -14,7 +14,7 @@ module RelatonBipm
14
14
  rule(:lang) { comma >> space? >> match["A-Z"].repeat(1, 2).as(:lang) }
15
15
  rule(:lang?) { lang.maybe }
16
16
 
17
- rule(:numdash) { match["0-9-"].repeat(1).as(:number) }
17
+ rule(:numdash) { match["A-Z0-9-"].repeat(1).as(:number) }
18
18
  rule(:number) { numdash >> space? }
19
19
  rule(:number?) { number.maybe }
20
20
  rule(:num_suff) { numdash >> match["a-z"].repeat(1, 2) >> space }
@@ -47,7 +47,11 @@ module RelatonBipm
47
47
 
48
48
  rule(:metrologia) { str("Metrologia").as(:group) >> (space >> match["a-zA-Z0-9\s"].repeat(1).as(:number)).maybe }
49
49
 
50
- rule(:result) { outcome | brochure | metrologia }
50
+ rule(:corr) { space >> str("Corrigendum").as(:corr) }
51
+ rule(:corr?) { corr.maybe }
52
+ rule(:jcgm) { group >> space >> numdash >> (str(":") >> year).maybe >> corr? }
53
+
54
+ rule(:result) { outcome | brochure | metrologia | jcgm }
51
55
 
52
56
  root :result
53
57
  end
@@ -93,7 +97,7 @@ module RelatonBipm
93
97
  hash = to_hash
94
98
  hash.delete(:number) if other_hash[:number].nil? && hash[:number] == "1" and hash[:year]
95
99
  other_hash.delete(:number) if hash[:number].nil? && other_hash[:number] == "1"
96
- hash.delete(:year) unless other_hash[:year]
100
+ # hash.delete(:year) unless other_hash[:year]
97
101
  other_hash.delete(:year) unless hash[:year]
98
102
  hash.delete(:lang) unless other_hash[:lang]
99
103
  other_hash.delete(:lang) unless hash[:lang]
@@ -124,6 +128,7 @@ module RelatonBipm
124
128
  norm_num = normalized_number(src)
125
129
  hash[:number] = norm_num unless norm_num.nil? || norm_num.empty?
126
130
  hash[:year] = src[:year].to_s if src[:year]
131
+ hash[:corr] = true if src[:corr]
127
132
  hash[:lang] = src[:lang].to_s if src[:lang]
128
133
  hash
129
134
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonBipm
2
- VERSION = "1.16.5".freeze
2
+ VERSION = "1.16.6".freeze
3
3
  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.16.5
4
+ version: 1.16.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2023-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday