relaton-itu 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa06401d8a01fbeec3a0debc94dd6adf35c41dc9
4
- data.tar.gz: 8fb8d5554c349fe7dcbc0f1e8e3d4b0f91b0ec2f
3
+ metadata.gz: 84374f1f75d8a8644490ca1377f2788fc05414bc
4
+ data.tar.gz: 9ccbae6c1244b6fdb053f97f5544c12949304a72
5
5
  SHA512:
6
- metadata.gz: 83d8e30cc9b7cdaca1eb04fb85d2d4634a807525fd1d5e8866fb5a492ad11b443b04ffa3eaf7380591097e34cef2a75274dd6b59a5b42584569beac6cf4d7b81
7
- data.tar.gz: dabf910e6a85a08362dd796f640ccbe75027aa977d3dacb5ccb70705a4d15b32a95fc5f705b1d0280cb36320f12af5403b291b62388948314369e3c2ee99f991
6
+ metadata.gz: 4fd1f6fb580ad51c5f9d2b6b9f38a674c80b75f57f7befbb0e99e4dbcb7b8d3bda246d3f997ce87e94a5b36cb59809c9288ae76b350095a00f692fba75f8253c
7
+ data.tar.gz: 9e7c0ee638ea68a1a6e9d1d461f832510ff3fdc4f383aa4965a45cc2644080ab26949ae5d5f0506c810445df6cbb621957eda261d63e9e60b4d34d5027aa162f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-itu (0.3.1)
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.3)
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.2)
38
+ relaton-bib (0.3.5)
39
39
  addressable
40
40
  nokogiri (~> 1.10)
41
- relaton-iso-bib (0.3.2)
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)
@@ -15,13 +15,5 @@ module RelatonItu
15
15
 
16
16
  super
17
17
  end
18
-
19
- def to_xml(builder = nil, **opts)
20
- super builder, **opts do |b|
21
- if opts[:bibdata]
22
- # b.doctype doctype if doctype
23
- end
24
- end
25
- end
26
18
  end
27
19
  end
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
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.1
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-05 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler