relaton-bipm 1.19.3 → 1.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bipm/bipm_bibliographic_item.rb +7 -3
- data/lib/relaton_bipm/hash_converter.rb +13 -7
- data/lib/relaton_bipm/version.rb +1 -1
- data/relaton_bipm.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f82a59533864cf6f80702a221409634b40078c86a3089b8f0578cca757052f6
|
4
|
+
data.tar.gz: 6b34ad48868eb793e6d34b4e049ff688144efde7e8431020e618e4f77b7d0185
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5894ea600bac7d43358e31dfdfc4114a83e29962850c07b258424dbb208d7c8087b27bfe927ea82546266ee3babdfeabf7228b81b43bb5889beadba4759ab537
|
7
|
+
data.tar.gz: dd53039d5050bce849c4bed6a6df73046c0ef2c578cd85134ed561a85d27b60367dbc47fbd3e179a0773ba8de98d88b8ee23da44ce196745890ca371f7ab221c
|
@@ -86,12 +86,16 @@ module RelatonBipm
|
|
86
86
|
#
|
87
87
|
def to_hash(embedded: false)
|
88
88
|
hash = super
|
89
|
-
hash["comment_period"] = comment_period.to_hash if comment_period
|
90
|
-
hash["si_aspect"] = si_aspect if si_aspect
|
91
|
-
hash["meeting_note"] = meeting_note if meeting_note
|
89
|
+
hash["ext"]["comment_period"] = comment_period.to_hash if comment_period
|
90
|
+
hash["ext"]["si_aspect"] = si_aspect if si_aspect
|
91
|
+
hash["ext"]["meeting_note"] = meeting_note if meeting_note
|
92
92
|
hash
|
93
93
|
end
|
94
94
|
|
95
|
+
def has_ext?
|
96
|
+
super || comment_period || si_aspect || meeting_note
|
97
|
+
end
|
98
|
+
|
95
99
|
# @param prefix [String]
|
96
100
|
# @return [String]
|
97
101
|
def to_asciibib(prefix = "")
|
@@ -17,6 +17,7 @@ module RelatonBipm
|
|
17
17
|
|
18
18
|
# project_group_hash_to_bib ret
|
19
19
|
commentperiod_hash_to_bib ret
|
20
|
+
ret[:si_aspect] = args["ext"]["si_aspect"] if args.dig("ext", "si_aspect")
|
20
21
|
ret
|
21
22
|
end
|
22
23
|
|
@@ -42,7 +43,10 @@ module RelatonBipm
|
|
42
43
|
|
43
44
|
# @param ret [Hash]
|
44
45
|
def commentperiod_hash_to_bib(ret)
|
45
|
-
ret[:comment_period]
|
46
|
+
compr = ret.dig(:ext, :comment_period) || ret[:comment_period] # @TODO: remove ret[:comment_period] after all data is updated
|
47
|
+
return unless compr
|
48
|
+
|
49
|
+
ret[:comment_period] &&= CommentPeriond.new(**compr)
|
46
50
|
end
|
47
51
|
|
48
52
|
# @param ret [Hash]
|
@@ -69,16 +73,17 @@ module RelatonBipm
|
|
69
73
|
|
70
74
|
# @param ret [Hash]
|
71
75
|
def editorialgroup_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
72
|
-
|
76
|
+
ed = ret.dig(:ext, :editorialgroup) || ret[:editorialgroup] # @TODO: remove ret[:editorialgroup] after all data is updated
|
77
|
+
return unless ed
|
73
78
|
|
74
|
-
cmt =
|
79
|
+
cmt = ed[:committee].map do |c|
|
75
80
|
if (vars = committee_variants c).any?
|
76
81
|
Committee.new acronym: c[:acronym], content: vars
|
77
82
|
else
|
78
83
|
Committee.new(**c)
|
79
84
|
end
|
80
85
|
end
|
81
|
-
wg = RelatonBib.array(
|
86
|
+
wg = RelatonBib.array(ed[:workgroup]).map do |w|
|
82
87
|
w.is_a?(Hash) ? WorkGroup.new(**w) : WorkGroup.new(content: w)
|
83
88
|
end
|
84
89
|
ret[:editorialgroup] = EditorialGroup.new committee: cmt, workgroup: wg
|
@@ -97,9 +102,10 @@ module RelatonBipm
|
|
97
102
|
|
98
103
|
# @param ret [Hash]
|
99
104
|
def structuredidentifier_hash_to_bib(ret)
|
100
|
-
ret[:structuredidentifier]
|
101
|
-
|
102
|
-
|
105
|
+
struct_id = ret.dig(:ext, :structuredidentifier) || ret[:structuredidentifier] # @TODO: remove ret[:structuredidentifier] after all data is updated
|
106
|
+
return unless struct_id
|
107
|
+
|
108
|
+
ret[:structuredidentifier] = StructuredIdentifier.new(**struct_id)
|
103
109
|
end
|
104
110
|
|
105
111
|
def create_doctype(**args)
|
data/lib/relaton_bipm/version.rb
CHANGED
data/relaton_bipm.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
35
35
|
spec.add_dependency "faraday", "~> 2.7.0"
|
36
36
|
spec.add_dependency "mechanize", "~> 2.10"
|
37
37
|
spec.add_dependency "parslet", "~> 2.0.0"
|
38
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-bib", "~> 1.20.0"
|
39
39
|
spec.add_dependency "relaton-index", "~> 0.2.2"
|
40
40
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
41
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
@@ -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: relaton-index
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
rubygems_version: 3.
|
168
|
+
rubygems_version: 3.3.27
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: 'RelatonBipm: retrieve BIPM Standards for bibliographic use using the BibliographicItem
|