relaton-iso 1.0.3 → 1.0.4

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: b085bd68fb134686bce61bdbb540360ebd52c6f3d7382db66a38b8b05f2e60b8
4
- data.tar.gz: 9c4c0858b18d5da5b45ee552b0489f881adcb7c944fc6817d2c6a378d0de371f
3
+ metadata.gz: 50a6b1b3492ba93ad87e502c5b98d71946277db082a6808c509018f0f454c596
4
+ data.tar.gz: d40c8012e7eb776276cab1bc0ecf9d853651917dfdabfe6a96c761b0abd059ac
5
5
  SHA512:
6
- metadata.gz: 3c6aac2f294c40fc3d8d946d9462e75e6784f593a9734ce6f8f2378a404fe07acbd4bc148d87db1d7e51fb3b460deb1a944d3894cd97ef1e58a0b6850dde6272
7
- data.tar.gz: efdc6acaaaa21d6c1b1354d8c7ff36fc327618edb47f58071e36a277f814f077c414da74c0c7c744bd564f75404fbc65f1d3367342a7cd098f7a5d3e1d4cf4c7
6
+ metadata.gz: a53a91f835cc53171b34f6a79d2d7a6e6533f1f0181ada1daaaaafda12feb7a505dda718456771e0b24bed8c49b9075b3b91e5dbdb501844603629ce4dff2fa7
7
+ data.tar.gz: 06dac6e83cde8774fb3862d76fea547965e3a097a781c5c22f29332a0b2946f89dbbc751cde1c0492820e072e96d2913a5e0df097eb339a789c03046c30ef257
@@ -33,7 +33,21 @@ module RelatonIso
33
33
  "40" => "DIS",
34
34
  "50" => "FDIS",
35
35
  "60" => { "00" => "PRF", "60" => "FINAL" },
36
- }
36
+ }.freeze
37
+
38
+ PUBLISHERS = {
39
+ "ISO" => { name: "International Electrotechnical Commission",
40
+ url: "www.iec.ch" },
41
+ "ISO" => { name: "International Organization for Standardization",
42
+ url: "www.iso.org" },
43
+ "IEEE" => { name: "Institute of Electrical and Electronics Engineers",
44
+ url: "www.ieee.org" },
45
+ "SAE" => { name: "SAE International", url: "www.sae.org" },
46
+ "CIE" => { name: " International Commission on Illumination",
47
+ url: "cie.co.at" },
48
+ "ASME" => { name: "American Society of Mechanical Engineers",
49
+ url: "www.asme.org" },
50
+ }.freeze
37
51
 
38
52
  class << self
39
53
  # Parse page.
@@ -320,17 +334,12 @@ module RelatonIso
320
334
  end
321
335
 
322
336
  def fetch_contributors(ref)
323
- ref.sub(/\s.*/, "").split("/").map do |abbrev|
324
- case abbrev
325
- when "IEC"
326
- name = "International Electrotechnical Commission"
327
- url = "www.iec.ch"
328
- else
329
- name = "International Organization for Standardization"
330
- url = "www.iso.org"
331
- end
332
- { entity: { name: name, url: url, abbreviation: abbrev },
333
- role: [type: "publisher"] }
337
+ ref.sub(/\s.*/, "").split("/").reduce([]) do |mem, abbrev|
338
+ publisher = PUBLISHERS[abbrev]
339
+ next mem unless publisher
340
+
341
+ publisher[:abbreviation] = abbrev
342
+ mem << { entity: publisher, role: [type: "publisher"] }
334
343
  end
335
344
  end
336
345
  # rubocop:enable Metrics/MethodLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
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-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug