relaton-bib 2.1.1 → 2.1.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 +4 -4
- data/lib/relaton/bib/model/ics.rb +29 -3
- data/lib/relaton/bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 103ee7e7e99ea81a307302c1dd476f812a7b1f9b1653213062e0bf80b9950987
|
|
4
|
+
data.tar.gz: 031625043b1a7b9d6a2d2d674b68f500ccfec8f836c7d9d645a8f4e751cd88e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34d61ff26b50b995ac955707449111866cd15f30c68beda845f0ae3fcb7fe04e1e7999b8c560b3f874dac83e0777cbc7b26723000c8cfd8b0c2e7f11b734e7cf
|
|
7
|
+
data.tar.gz: 838061a378904a0a338e9c87f569099b45656e33614265eb07a61afaa9e7e0b76f5278faeb4e414451fc31c11936867c3db01e61e52f65cd7cc490510e1967bc
|
|
@@ -12,11 +12,37 @@ module Relaton
|
|
|
12
12
|
map_element "text", to: :text
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# Returns the explicit text if set, else the Isoics description for
|
|
16
|
+
# `code`. Kept for consumers that read `.text` directly.
|
|
15
17
|
def text
|
|
16
|
-
|
|
17
|
-
return val if val && !val.empty?
|
|
18
|
+
return @text if @text.is_a?(String) && !@text.empty?
|
|
18
19
|
|
|
19
|
-
Isoics.fetch(code)&.description if code
|
|
20
|
+
Isoics.fetch(code)&.description if code.is_a?(String) && !code.empty?
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# When code is assigned, eagerly populate text from Isoics if no
|
|
24
|
+
# explicit text has been set. Going through the public writer
|
|
25
|
+
# registers the value with the lutaml-model `value_set_for` tracker
|
|
26
|
+
# so the attribute is emitted on serialization.
|
|
27
|
+
def code=(val)
|
|
28
|
+
super
|
|
29
|
+
return unless val.is_a?(String) && !val.empty?
|
|
30
|
+
return if @text.is_a?(String) && !@text.empty?
|
|
31
|
+
|
|
32
|
+
description = Isoics.fetch(val)&.description
|
|
33
|
+
self.text = description if description
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# When the deserializer reaches the end of the XML element and
|
|
37
|
+
# records that <text> was absent, it calls `using_default_for(:text)`
|
|
38
|
+
# to mark the attribute as default-valued (suppressing serialization).
|
|
39
|
+
# Refuse that mark if we've already populated text from Isoics so the
|
|
40
|
+
# value survives round-trip. See #112.
|
|
41
|
+
def using_default_for(attribute_name)
|
|
42
|
+
return if attribute_name == :text &&
|
|
43
|
+
@text.is_a?(String) && !@text.empty?
|
|
44
|
+
|
|
45
|
+
super
|
|
20
46
|
end
|
|
21
47
|
end
|
|
22
48
|
end
|
data/lib/relaton/bib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-bib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.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: 2026-05-
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bibtex-ruby
|