relaton-itu 0.3.1 → 0.3.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_itu/editorial_group.rb +8 -0
- data/lib/relaton_itu/hash_converter.rb +0 -12
- data/lib/relaton_itu/itu_bibliographic_item.rb +0 -8
- data/lib/relaton_itu/itu_bibliography.rb +2 -1
- data/lib/relaton_itu/itu_group.rb +16 -0
- data/lib/relaton_itu/scrapper.rb +2 -1
- data/lib/relaton_itu/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: 84374f1f75d8a8644490ca1377f2788fc05414bc
|
4
|
+
data.tar.gz: 9ccbae6c1244b6fdb053f97f5544c12949304a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fd1f6fb580ad51c5f9d2b6b9f38a674c80b75f57f7befbb0e99e4dbcb7b8d3bda246d3f997ce87e94a5b36cb59809c9288ae76b350095a00f692fba75f8253c
|
7
|
+
data.tar.gz: 9e7c0ee638ea68a1a6e9d1d461f832510ff3fdc4f383aa4965a45cc2644080ab26949ae5d5f0506c810445df6cbb621957eda261d63e9e60b4d34d5027aa162f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-itu (0.3.
|
4
|
+
relaton-itu (0.3.2)
|
5
5
|
relaton-iso-bib (~> 0.3.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -25,7 +25,7 @@ GEM
|
|
25
25
|
json (2.2.0)
|
26
26
|
method_source (0.9.2)
|
27
27
|
mini_portile2 (2.4.0)
|
28
|
-
nokogiri (1.10.
|
28
|
+
nokogiri (1.10.4)
|
29
29
|
mini_portile2 (~> 2.4.0)
|
30
30
|
pry (0.12.2)
|
31
31
|
coderay (~> 1.1.0)
|
@@ -35,10 +35,10 @@ GEM
|
|
35
35
|
pry (~> 0.10)
|
36
36
|
public_suffix (3.1.1)
|
37
37
|
rake (10.5.0)
|
38
|
-
relaton-bib (0.3.
|
38
|
+
relaton-bib (0.3.5)
|
39
39
|
addressable
|
40
40
|
nokogiri (~> 1.10)
|
41
|
-
relaton-iso-bib (0.3.
|
41
|
+
relaton-iso-bib (0.3.4)
|
42
42
|
isoics (~> 0.1.6)
|
43
43
|
relaton-bib (~> 0.3.0)
|
44
44
|
ruby_deep_clone (~> 0.8.0)
|
@@ -33,5 +33,13 @@ module RelatonItu
|
|
33
33
|
builder.workgroup { |b| group.to_xml b } if workgroup
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
# @return [Hash]
|
38
|
+
def to_hash
|
39
|
+
hash = { "bureau" => bureau, "group" => group.to_hash }
|
40
|
+
hash["subgroup"] = subgroup.to_hash if subgroup
|
41
|
+
hash["workgroup"] = workgroup.to_hash if workgroup
|
42
|
+
hash
|
43
|
+
end
|
36
44
|
end
|
37
45
|
end
|
@@ -1,18 +1,6 @@
|
|
1
1
|
module RelatonItu
|
2
2
|
class HashConverter < RelatonIsoBib::HashConverter
|
3
3
|
class << self
|
4
|
-
# @override RelatonBib::HashConverter.hash_to_bib
|
5
|
-
# @param args [Hash]
|
6
|
-
# @param nested [TrueClass, FalseClass]
|
7
|
-
# @return [Hash]
|
8
|
-
# def hash_to_bib(args, nested = false)
|
9
|
-
# ret = super
|
10
|
-
# return if ret.nil?
|
11
|
-
|
12
|
-
# doctype_hash_to_bib(ret)
|
13
|
-
# ret
|
14
|
-
# end
|
15
|
-
|
16
4
|
private
|
17
5
|
|
18
6
|
def editorialgroup_hash_to_bib(ret)
|
@@ -20,7 +20,8 @@ module RelatonItu
|
|
20
20
|
def search(text, year = nil)
|
21
21
|
HitCollection.new text, year
|
22
22
|
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
23
|
-
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
|
23
|
+
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
|
24
|
+
OpenSSL::SSL::SSLError
|
24
25
|
raise RelatonBib::RequestError, "Could not access http://www.itu.int"
|
25
26
|
end
|
26
27
|
|
@@ -21,6 +21,13 @@ module RelatonItu
|
|
21
21
|
builder.end finish if finish
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
# @return [Hash]
|
26
|
+
def to_hash
|
27
|
+
hash = { "start" => start }
|
28
|
+
hash["finish"] = finish if finish
|
29
|
+
hash
|
30
|
+
end
|
24
31
|
end
|
25
32
|
|
26
33
|
TYPES = %w[tsag study-group work-group].freeze
|
@@ -56,5 +63,14 @@ module RelatonItu
|
|
56
63
|
builder.acronym acronym if acronym
|
57
64
|
period&.to_xml builder
|
58
65
|
end
|
66
|
+
|
67
|
+
# @return [Hash]
|
68
|
+
def to_hash
|
69
|
+
hash = { "name" => name }
|
70
|
+
hash["type"] = type if type
|
71
|
+
hash["acronym"] = acronym if acronym
|
72
|
+
hash["period"] = period.to_hash if period
|
73
|
+
hash
|
74
|
+
end
|
59
75
|
end
|
60
76
|
end
|
data/lib/relaton_itu/scrapper.rb
CHANGED
@@ -121,7 +121,8 @@ module RelatonItu
|
|
121
121
|
end
|
122
122
|
Nokogiri::HTML(resp.body)
|
123
123
|
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
124
|
-
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
|
124
|
+
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
|
125
|
+
OpenSSL::SSL::SSLError
|
125
126
|
raise RelatonBib::RequestError, "Could not access #{url}"
|
126
127
|
end
|
127
128
|
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
data/lib/relaton_itu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.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-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|