glossarist 2.0.2 → 2.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a350e5e964f972f6b37865cf7cb7d452b0e8281429718b7f8121feceaccd2d
|
4
|
+
data.tar.gz: a474d840ee6d35ee6781f252f678b45fc05835b9915588b151715fe8ef8d5874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75e5f037aa510ad73388b255039c6256d38a057387eb9584f2d3412635f9701719ac8fb1a91be476a8091543cd2366598e4831a84ee066e85fa24173e361117a
|
7
|
+
data.tar.gz: 073b9bd4562d657d7ccfe8adde06de7727e5bd14c51e8cbcbdeef7924619dcee2b23f51538e67e6a859e00f4b15933b631c2d315abaad4e8a20d5fb200842efb
|
@@ -33,7 +33,7 @@ module Glossarist
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def load_concept_from_file(filename)
|
36
|
-
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date])
|
36
|
+
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date, Time])
|
37
37
|
concept_hash["uuid"] = concept_hash["id"] || File.basename(filename, ".*")
|
38
38
|
|
39
39
|
concept = ManagedConcept.new(concept_hash)
|
@@ -50,7 +50,7 @@ module Glossarist
|
|
50
50
|
def load_localized_concept(id)
|
51
51
|
concept_hash = Psych.safe_load(
|
52
52
|
File.read(localized_concept_path(id)),
|
53
|
-
permitted_classes: [Date],
|
53
|
+
permitted_classes: [Date, Time],
|
54
54
|
)
|
55
55
|
concept_hash["uuid"] = id
|
56
56
|
|
data/lib/glossarist/config.rb
CHANGED
@@ -28,7 +28,7 @@ module Glossarist
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def register_class(class_name, klass)
|
31
|
-
@registered_classes[class_name] = klass
|
31
|
+
@registered_classes[class_name.to_sym] = klass
|
32
32
|
end
|
33
33
|
|
34
34
|
def extension_attributes
|
@@ -53,7 +53,7 @@ module Glossarist
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def register_extension_attributes(attributes)
|
56
|
-
self.register_extension_attributes(attributes)
|
56
|
+
self.instance.register_extension_attributes(attributes)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -28,6 +28,10 @@ module Glossarist
|
|
28
28
|
# @return [Array<String>]
|
29
29
|
attr_reader :groups
|
30
30
|
|
31
|
+
# List of authorative sources.
|
32
|
+
# @return [Array<ConceptSource>]
|
33
|
+
attr_reader :sources
|
34
|
+
|
31
35
|
# All localizations for this concept.
|
32
36
|
#
|
33
37
|
# Keys are language codes and values are instances of {LocalizedConcept}.
|
@@ -87,6 +91,12 @@ module Glossarist
|
|
87
91
|
end
|
88
92
|
end
|
89
93
|
|
94
|
+
def sources=(sources)
|
95
|
+
@sources = sources&.map do |source|
|
96
|
+
ConceptSource.new(source)
|
97
|
+
end || []
|
98
|
+
end
|
99
|
+
|
90
100
|
def localizations=(localizations)
|
91
101
|
return unless localizations
|
92
102
|
|
@@ -134,6 +144,7 @@ module Glossarist
|
|
134
144
|
"identifier" => id,
|
135
145
|
"localized_concepts" => localized_concepts.empty? ? nil : localized_concepts,
|
136
146
|
"groups" => groups,
|
147
|
+
"sources" => sources&.map(&:to_h),
|
137
148
|
}.compact,
|
138
149
|
}.compact
|
139
150
|
end
|
@@ -182,6 +193,7 @@ module Glossarist
|
|
182
193
|
localizedConcepts
|
183
194
|
localizations
|
184
195
|
groups
|
196
|
+
sources
|
185
197
|
].compact
|
186
198
|
end
|
187
199
|
|
data/lib/glossarist/model.rb
CHANGED
@@ -18,12 +18,11 @@ module Glossarist
|
|
18
18
|
def set_attribute(name, value)
|
19
19
|
public_send("#{name}=", value)
|
20
20
|
rescue NoMethodError
|
21
|
-
|
22
|
-
|
21
|
+
if Config.extension_attributes.include?(name)
|
22
|
+
extension_attributes[name] = value
|
23
|
+
elsif name.match?(/[A-Z]/) # adding support for camel case
|
23
24
|
name = snake_case(name.to_s).to_sym
|
24
25
|
retry
|
25
|
-
elsif Config.extension_attributes.include?(name)
|
26
|
-
extension_attributes[name] = value
|
27
26
|
else
|
28
27
|
raise ArgumentError, "#{self.class.name} does not have " +
|
29
28
|
"attribute #{name} defined or the attribute is read only."
|
data/lib/glossarist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glossarist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton
|