relaton-iso 0.6.1 → 0.6.2

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
  SHA1:
3
- metadata.gz: 36087254e7d4a03e2b10043bf3982b8302c4b03e
4
- data.tar.gz: 410db681abb2e79f7cc6f20adc94ea760fb68c5f
3
+ metadata.gz: 7ffa0d2ff9da9226ea5e8f15547b794112a66c63
4
+ data.tar.gz: 6a7705319268c1f2a26f582ef5720da15ddd0ad6
5
5
  SHA512:
6
- metadata.gz: 4de83577a94249d2a11217f279fcd83d1ea982d5a4e3f37ff50f5a1ab2050d8fcffe402ff18f27ae37c06de35af7e612fd07d678bb46623c5258b5646d8f3227
7
- data.tar.gz: 8d01def2dddc97a28e4bf7f37f5ea1ebc8210adb55d505a555028762269801a8aed7114040ad89a76cd9e0283c221e6daad739efb7b464638093a0566d249abc
6
+ metadata.gz: 922b59fc063a2e78e229af1d0f5458f97ff773bbd606bbff807ecad5374f0781d052fdeb6d1af9ca4b76e89a3ad980671b899eb7a0e82895b8505690f93e2efb
7
+ data.tar.gz: 5b3bbbd6b383c9e660c4dd6abf116e11ab665f57f177616ce4207a72dcf9f31b602e771e65aceeae30394d563d59fae4a68ab893bb140a4f6214beffab0900f6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-iso (0.6.1)
4
+ relaton-iso (0.6.2)
5
5
  relaton-iec (~> 0.4.0)
6
6
  relaton-iso-bib (~> 0.3.0)
7
7
 
@@ -36,13 +36,13 @@ GEM
36
36
  pry (~> 0.10)
37
37
  public_suffix (3.1.1)
38
38
  rake (10.5.0)
39
- relaton-bib (0.3.1)
39
+ relaton-bib (0.3.2)
40
40
  addressable
41
41
  nokogiri (~> 1.10)
42
- relaton-iec (0.4.0)
42
+ relaton-iec (0.4.2)
43
43
  addressable
44
44
  relaton-iso-bib (~> 0.3.0)
45
- relaton-iso-bib (0.3.1)
45
+ relaton-iso-bib (0.3.2)
46
46
  isoics (~> 0.1.6)
47
47
  relaton-bib (~> 0.3.0)
48
48
  ruby_deep_clone (~> 0.8.0)
@@ -300,32 +300,10 @@ module RelatonIso
300
300
  # @param lang [String]
301
301
  # @return [Hash]
302
302
  def fetch_title(doc, lang)
303
- titles = doc.at(
303
+ content = doc.at(
304
304
  "//h3[@itemprop='description'] | //h2[@itemprop='description']",
305
- )&.text&.split " -- "
306
- case titles&.size
307
- when nil, 0
308
- intro, main, part = nil, "", nil
309
- when 1
310
- intro, main, part = nil, titles[0], nil
311
- when 2
312
- if /^(Part|Partie) \d+:/ =~ titles[1]
313
- intro, main, part = nil, titles[0], titles[1]
314
- else
315
- intro, main, part = titles[0], titles[1], nil
316
- end
317
- when 3
318
- intro, main, part = titles[0], titles[1], titles[2]
319
- else
320
- intro, main, part = titles[0], titles[1], titles[2..-1]&.join(" -- ")
321
- end
322
- {
323
- title_intro: intro,
324
- title_main: main,
325
- title_part: part,
326
- language: lang,
327
- script: script(lang),
328
- }
305
+ )&.text
306
+ RelatonIsoBib::HashConverter.split_title content, lang, script(lang)
329
307
  end
330
308
 
331
309
  # Return ISO script code.
@@ -376,7 +354,7 @@ module RelatonIso
376
354
  url = "www.iso.org"
377
355
  end
378
356
  { entity: { name: name, url: url, abbreviation: abbrev },
379
- role: ["publisher"] }
357
+ role: [type: "publisher"] }
380
358
  end
381
359
  end
382
360
  # rubocop:enable Metrics/MethodLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
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: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-30 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler