relaton-iso 2.0.0.pre.alpha.7 → 2.0.0.pre.alpha.8
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/iso/model/docidentifier.rb +14 -1
- data/lib/relaton/iso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fdfe75f079abbfdcffde6545be1d017bc010479a84cd5e132edf4bdd0aa8a2b4
|
|
4
|
+
data.tar.gz: 2b2a8cb71b2b2ef7adb467ef19c282eda7474d31fcee76bc87d77df15eb35a02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c686aab9cdcbbc19936f774417a91283cdfa0cde068a0bdded44a845c96dfa65869695afe62aa69d42ff67dd9b272aff5f631b8d68632b0468fa9a54c17b2ed
|
|
7
|
+
data.tar.gz: 30c3eb6d1e1d23a0c4fcda9c427ab9335affe4c5b149567492d0f6ae9dcd9231c1f81498b282baf46c414fd93e234cc9f4a44d8a6d51f78d3fd1ed9a5d3fbf63
|
|
@@ -28,7 +28,8 @@ module Relaton
|
|
|
28
28
|
|
|
29
29
|
# iso-tc identifiers are TC document numbers, not ISO standard
|
|
30
30
|
# identifiers — parsing them through Pubid adds a spurious
|
|
31
|
-
# "ISO" prefix (#178)
|
|
31
|
+
# "ISO" prefix (#178). Bypass Pubid casting for iso-tc content
|
|
32
|
+
# in both direct construction and XML deserialization paths.
|
|
32
33
|
def initialize(arg = nil, **kwargs)
|
|
33
34
|
if arg.is_a?(Hash)
|
|
34
35
|
raw_content = arg["content"] if arg["type"] == "iso-tc"
|
|
@@ -40,6 +41,17 @@ module Relaton
|
|
|
40
41
|
@content = raw_content if raw_content.is_a?(String)
|
|
41
42
|
end
|
|
42
43
|
|
|
44
|
+
# Capture raw iso-tc content before Pubid casting (#178).
|
|
45
|
+
# The lutaml-model setter is defined via define_method, so we
|
|
46
|
+
# wrap it with alias_method instead of super.
|
|
47
|
+
alias_method :original_content=, :content=
|
|
48
|
+
def content=(value)
|
|
49
|
+
if value.is_a?(String) && type == "iso-tc"
|
|
50
|
+
@iso_tc_raw = value
|
|
51
|
+
end
|
|
52
|
+
send(:original_content=, value)
|
|
53
|
+
end
|
|
54
|
+
|
|
43
55
|
def content_to_xml(model, parent, doc)
|
|
44
56
|
doc.add_xml_fragment parent, model.to_s
|
|
45
57
|
end
|
|
@@ -86,6 +98,7 @@ module Relaton
|
|
|
86
98
|
|
|
87
99
|
def to_s
|
|
88
100
|
return content if content.is_a? String
|
|
101
|
+
return @iso_tc_raw if @iso_tc_raw
|
|
89
102
|
|
|
90
103
|
case type
|
|
91
104
|
when "URN" then content.urn
|
data/lib/relaton/iso/version.rb
CHANGED