relaton-un 1.19.0 → 1.20.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff20c5706705ecaa88945f97b061a823977c356880f4dd45c8556f262d848b74
4
- data.tar.gz: 4e291e62cc9cceb8694e332076c32679c4dff39a4d7d77adb8cee0013e0e95e7
3
+ metadata.gz: e9120476339806fdcd9a828b2964ac3ecbda39e6e36145677f845a7bb0aa9a85
4
+ data.tar.gz: a738350b59eb157fef698cab95ecd7b5b5d65cdf3b25ebea0edbe7ba850da95b
5
5
  SHA512:
6
- metadata.gz: d4cbfa1a929c3a833c9172806fa433f5b4343e5411f6f881f4bf34740c664be847271efc8b32b7bbe7e64dbdabacbe96f6873c67c8788ecfc50b4a114c5b85c4
7
- data.tar.gz: edee2e4000a82cfb833ada16951d4e49c345c6480b2afe86dda3fd7bf88f19e8ffb25d427ccb912878de13fd0541a6091bdec0a3c3cc5e3423d09273e90955bc
6
+ metadata.gz: 2b9a11306d032945d285d55353cc089b09ca35d97138d044778803a6fdbde552d4058c8eb7a90668e33653cf16d4e60b136fd132c066dae22904e73932b942d5
7
+ data.tar.gz: deb641be672158598d41550ff20bbcafb4a70dc13fbdd420d7a1ce5670263a2235b703831417ac4eaaf875ede2b3b48172242a74d40b509dd9c7088bea5c6132
@@ -10,21 +10,33 @@ module RelatonUn
10
10
  ret = super
11
11
  return if ret.nil?
12
12
 
13
- ret[:submissionlanguage] = RelatonBib.array ret[:submissionlanguage]
13
+ hash_to_bib_submissions ret
14
14
  session_hash_to_bib ret
15
+ ret[:distribution] = ret[:ext][:distribution] if ret.dig(:ext, :distribution)
16
+ ret[:job_number] = ret[:ext][:job_number] if ret.dig(:ext, :job_number)
15
17
  ret
16
18
  end
17
19
 
18
20
  private
19
21
 
22
+ def hash_to_bib_submissions(ret)
23
+ sm = ret.dig(:ext, :submissionlanguage) || ret[:submissionlanguage] # @TODO remove args[:submissionlanguage] after all gems are updated
24
+ return unless sm
25
+
26
+ ret[:submissionlanguage] = RelatonBib.array sm
27
+ end
28
+
20
29
  # @param ret [Hash]
21
30
  def session_hash_to_bib(ret)
22
- ret[:session] = Session.new(**ret[:session]) if ret[:session]
31
+ session = ret.dig(:ext, :session) || ret[:session] # @TODO remove ret[:session] after all gems are updated
32
+ return unless session
33
+
34
+ ret[:session] = Session.new(**session)
23
35
  end
24
36
 
25
37
  # @param ret [Hash]
26
38
  def editorialgroup_hash_to_bib(ret)
27
- eg = ret[:editorialgroup]
39
+ eg = ret.dig(:ext, :editorialgroup) || ret[:editorialgroup] # @TODO remove ret[:editorialgroup] after all gems are updated
28
40
  return unless eg
29
41
 
30
42
  committee = eg.map { |e| e[:committee] }
@@ -67,14 +67,18 @@ module RelatonUn
67
67
  def to_hash(embedded: false) # rubocop:disable Metrics/AbcSize
68
68
  hash = super
69
69
  if submissionlanguage&.any?
70
- hash["submissionlanguage"] = single_element_array submissionlanguage
70
+ hash["ext"]["submissionlanguage"] = single_element_array submissionlanguage
71
71
  end
72
- hash["distribution"] = distribution if distribution
73
- hash["session"] = session.to_hash if session
74
- hash["job_number"] = job_number if job_number
72
+ hash["ext"]["distribution"] = distribution if distribution
73
+ hash["ext"]["session"] = session.to_hash if session
74
+ hash["ext"]["job_number"] = job_number if job_number
75
75
  hash
76
76
  end
77
77
 
78
+ def has_ext?
79
+ super || submissionlanguage&.any? || distribution || session || job_number
80
+ end
81
+
78
82
  # @param prefix [String]
79
83
  # @return [String]
80
84
  def to_asciibib(prefix = "") # rubocop:disable Metrics/AbcSize
@@ -1,3 +1,3 @@
1
1
  module RelatonUn
2
- VERSION = "1.19.0".freeze
2
+ VERSION = "1.20.0".freeze
3
3
  end
data/relaton_un.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "addressable", "~> 2.8.0"
36
36
  spec.add_dependency "faraday", "~> 2.7.0"
37
37
  spec.add_dependency "http-cookie", "~> 1.0.5"
38
- spec.add_dependency "relaton-bib", "~> 1.19.0"
38
+ spec.add_dependency "relaton-bib", "~> 1.20.0"
39
39
  spec.add_dependency "unf_ext", ">= 0.0.7.7"
40
40
  end
41
41
  # rubocop:enable Metrics/BlockLength
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
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-07-04 00:00:00.000000000 Z
11
+ date: 2024-12-13 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.19.0
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.19.0
68
+ version: 1.20.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: unf_ext
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ licenses:
126
126
  metadata:
127
127
  homepage_uri: https://github.com/relaton/relaton-un
128
128
  source_code_uri: https://github.com/relaton/relaton-un
129
- post_install_message:
129
+ post_install_message:
130
130
  rdoc_options: []
131
131
  require_paths:
132
132
  - lib
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubygems_version: 3.3.27
145
- signing_key:
145
+ signing_key:
146
146
  specification_version: 4
147
147
  summary: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
148
148
  model'