relaton-iec 1.19.1 → 1.20.0
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 +4 -4
- data/lib/relaton_iec/hash_converter.rb +14 -0
- data/lib/relaton_iec/iec_bibliographic_item.rb +12 -9
- data/lib/relaton_iec/version.rb +1 -1
- data/lib/relaton_iec/xml_parser.rb +0 -1
- data/relaton_iec.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f20588ecb2038b53252427cb01e0993d843195c12ea912a274116787f20ce74
|
4
|
+
data.tar.gz: 13f77733184dd0e26a46a83cf9b05838903818e6f6b68e91ce397c529370878f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca90f4613d002f0845e966e5c80f03bdb3e813daa11363d78c0c35540ed0e6ee2216e1da61dd0582393bd41d62666377ceec22a9cbc9be3313ce66cba02832c9
|
7
|
+
data.tar.gz: 83025369d42c19658ac6948f92f8b41e07148a7c66f46e7e24a32e5504a675d188406152cddfa0aa155caa2218eb24821179d2092fbcaf947f17b0615e62c90a
|
@@ -3,6 +3,20 @@ module RelatonIec
|
|
3
3
|
include RelatonIsoBib::HashConverter
|
4
4
|
extend self
|
5
5
|
|
6
|
+
def hash_to_bib(hash)
|
7
|
+
ret = super
|
8
|
+
ret[:function] = ret[:ext][:function] if ret.dig(:ext, :function)
|
9
|
+
ret[:updates_document_type] = ret[:ext][:updates_document_type] if ret.dig(:ext, :updates_document_type)
|
10
|
+
unless ret.dig(:ext, :accessibility_color_inside).nil?
|
11
|
+
ret[:accessibility_color_inside] = ret[:ext][:accessibility_color_inside]
|
12
|
+
end
|
13
|
+
ret[:price_code] = ret[:ext][:price_code] if ret.dig(:ext, :price_code)
|
14
|
+
ret[:cen_processing] = ret[:ext][:cen_processing] unless ret.dig(:ext, :cen_processing).nil?
|
15
|
+
ret[:secretary] = ret[:ext][:secretary] if ret.dig(:ext, :secretary)
|
16
|
+
ret[:interest_to_committees] = ret[:ext][:interest_to_committees] if ret.dig(:ext, :interest_to_committees)
|
17
|
+
ret
|
18
|
+
end
|
19
|
+
|
6
20
|
#
|
7
21
|
# Ovverides superclass's method
|
8
22
|
#
|
@@ -5,7 +5,7 @@ module RelatonIec
|
|
5
5
|
FUNCTION = %w[emc safety enviroment quality-assurance].freeze
|
6
6
|
|
7
7
|
# @return [String, nil]
|
8
|
-
attr_reader :function, :updates_document_type, :
|
8
|
+
attr_reader :function, :updates_document_type, :secretary,
|
9
9
|
:interest_to_committees
|
10
10
|
|
11
11
|
# @return [Boolean, nil]
|
@@ -43,7 +43,6 @@ module RelatonIec
|
|
43
43
|
@function = args.delete :function
|
44
44
|
@updates_document_type = args.delete :updates_document_type
|
45
45
|
@accessibility_color_inside = args.delete :accessibility_color_inside
|
46
|
-
@price_code = args.delete :price_code
|
47
46
|
@cen_processing = args.delete :cen_processing
|
48
47
|
@secretary = args.delete :secretary
|
49
48
|
@interest_to_committees = args.delete :interest_to_committees
|
@@ -103,20 +102,24 @@ module RelatonIec
|
|
103
102
|
# @return [Hash]
|
104
103
|
def to_hash(embedded: false) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
105
104
|
hash = super
|
106
|
-
hash["function"] = function if function
|
105
|
+
hash["ext"]["function"] = function if function
|
107
106
|
if updates_document_type
|
108
|
-
hash["updates_document_type"] = updates_document_type
|
107
|
+
hash["ext"]["updates_document_type"] = updates_document_type
|
109
108
|
end
|
110
109
|
unless accessibility_color_inside.nil?
|
111
|
-
hash["accessibility_color_inside"] = accessibility_color_inside
|
110
|
+
hash["ext"]["accessibility_color_inside"] = accessibility_color_inside
|
112
111
|
end
|
113
|
-
hash["
|
114
|
-
hash["
|
115
|
-
hash["secretary"] = secretary if secretary
|
112
|
+
hash["ext"]["cen_processing"] = cen_processing unless cen_processing.nil?
|
113
|
+
hash["ext"]["secretary"] = secretary if secretary
|
116
114
|
if interest_to_committees
|
117
|
-
hash["interest_to_committees"] = interest_to_committees
|
115
|
+
hash["ext"]["interest_to_committees"] = interest_to_committees
|
118
116
|
end
|
119
117
|
hash
|
120
118
|
end
|
119
|
+
|
120
|
+
def has_ext?
|
121
|
+
super || function || updates_document_type || !accessibility_color_inside.nil? ||
|
122
|
+
!cen_processing.nil? || secretary || interest_to_committees
|
123
|
+
end
|
121
124
|
end
|
122
125
|
end
|
data/lib/relaton_iec/version.rb
CHANGED
@@ -13,7 +13,6 @@ module RelatonIec
|
|
13
13
|
data[:updates_document_type] = ext.at("./updates-document-type")&.text
|
14
14
|
aci = ext.at("./accessibility-color-inside")
|
15
15
|
data[:accessibility_color_inside] = aci.text == "true" if aci
|
16
|
-
data[:price_code] = ext.at("./price-code")&.text
|
17
16
|
cp = ext.at("./cen-processing")
|
18
17
|
data[:cen_processing] = cp.text == "true" if cp
|
19
18
|
data[:secretary] = ext.at("./secretary")&.text
|
data/relaton_iec.gemspec
CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency "addressable"
|
27
27
|
spec.add_dependency "base64"
|
28
28
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
29
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
29
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.20.0"
|
30
30
|
spec.add_dependency "rubyzip"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.20.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.20.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubyzip
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +143,7 @@ homepage: https://github.com/relaton/relaton-iec
|
|
143
143
|
licenses:
|
144
144
|
- MIT
|
145
145
|
metadata: {}
|
146
|
-
post_install_message:
|
146
|
+
post_install_message:
|
147
147
|
rdoc_options: []
|
148
148
|
require_paths:
|
149
149
|
- lib
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubygems_version: 3.3.27
|
162
|
-
signing_key:
|
162
|
+
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: 'RelatonIec: retrieve IEC Standards for bibliographic use using the IecBibliographicItem
|
165
165
|
model'
|