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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/relaton_iso/scrapper.rb +4 -26
- data/lib/relaton_iso/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ffa0d2ff9da9226ea5e8f15547b794112a66c63
|
4
|
+
data.tar.gz: 6a7705319268c1f2a26f582ef5720da15ddd0ad6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
39
|
+
relaton-bib (0.3.2)
|
40
40
|
addressable
|
41
41
|
nokogiri (~> 1.10)
|
42
|
-
relaton-iec (0.4.
|
42
|
+
relaton-iec (0.4.2)
|
43
43
|
addressable
|
44
44
|
relaton-iso-bib (~> 0.3.0)
|
45
|
-
relaton-iso-bib (0.3.
|
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)
|
data/lib/relaton_iso/scrapper.rb
CHANGED
@@ -300,32 +300,10 @@ module RelatonIso
|
|
300
300
|
# @param lang [String]
|
301
301
|
# @return [Hash]
|
302
302
|
def fetch_title(doc, lang)
|
303
|
-
|
303
|
+
content = doc.at(
|
304
304
|
"//h3[@itemprop='description'] | //h2[@itemprop='description']",
|
305
|
-
)&.text
|
306
|
-
|
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
|
data/lib/relaton_iso/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|