glossarist 2.3.3 → 2.3.6
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: 46a366e3347c14171eff6007662c77f2a88fb8982e79f9291175db73757bc032
|
4
|
+
data.tar.gz: 642fce8985472649f1fffd9a6a10f92ef36cf0e70ad8309e21df5d49e7379224
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d4d9961dbc660975d821e5b34af478142bbfc67ed72648524ee6e0f6392d5d9cd2f64fa9e0cf3af83ff461576c7716d69065119d5f50c98fb5a9939ddffbc38
|
7
|
+
data.tar.gz: 00ac99f6802c65138601a8900e2c7b2f3132947080a56c2a086c9abc6f4b6b590b78ce95a331446b3ce82d1e0338470624cb8a3713098fd92f2d69f9efd514cd
|
data/lib/glossarist/concept.rb
CHANGED
@@ -3,11 +3,11 @@ module Glossarist
|
|
3
3
|
include Glossarist::Utilities::CommonFunctions
|
4
4
|
|
5
5
|
attribute :dates, ConceptDate, collection: true
|
6
|
-
attribute :definition, DetailedDefinition, collection: true
|
7
|
-
attribute :examples, DetailedDefinition, collection: true
|
6
|
+
attribute :definition, DetailedDefinition, collection: true, initialize_empty: true
|
7
|
+
attribute :examples, DetailedDefinition, collection: true, initialize_empty: true
|
8
8
|
attribute :id, :string
|
9
9
|
attribute :lineage_source_similarity, :integer
|
10
|
-
attribute :notes, DetailedDefinition, collection: true
|
10
|
+
attribute :notes, DetailedDefinition, collection: true, initialize_empty: true
|
11
11
|
attribute :release, :string
|
12
12
|
attribute :sources, ConceptSource, collection: true
|
13
13
|
attribute :terms, Designation::Base, collection: true
|
@@ -25,11 +25,11 @@ module Glossarist
|
|
25
25
|
|
26
26
|
yaml do
|
27
27
|
map :dates, to: :dates
|
28
|
-
map :definition, to: :definition,
|
29
|
-
map :examples, to: :examples,
|
28
|
+
map :definition, to: :definition, value_map: { to: { empty: :empty } }
|
29
|
+
map :examples, to: :examples, value_map: { to: { empty: :empty } }
|
30
30
|
map :id, to: :id
|
31
31
|
map %i[lineage_source_similarity lineageSourceSimilarity], to: :lineage_source_similarity
|
32
|
-
map :notes, to: :notes,
|
32
|
+
map :notes, to: :notes, value_map: { to: { empty: :empty } }
|
33
33
|
map :release, to: :release
|
34
34
|
map :sources, to: :sources
|
35
35
|
map :terms, to: :terms,
|
@@ -4,7 +4,7 @@ module Glossarist
|
|
4
4
|
class ManagedConcept < Lutaml::Model::Serializable
|
5
5
|
include Glossarist::Utilities::CommonFunctions
|
6
6
|
|
7
|
-
attribute :data, ManagedConceptData
|
7
|
+
attribute :data, ManagedConceptData, default: -> { ManagedConceptData.new }
|
8
8
|
|
9
9
|
attribute :related, RelatedConcept, collection: true
|
10
10
|
attribute :dates, ConceptDate, collection: true
|
@@ -89,7 +89,7 @@ module Glossarist
|
|
89
89
|
return unless localized_concepts_collection
|
90
90
|
|
91
91
|
if localized_concepts_collection.is_a?(Hash)
|
92
|
-
|
92
|
+
data.localized_concepts = stringify_keys(localized_concepts_collection)
|
93
93
|
else
|
94
94
|
localized_concepts_collection.each do |localized_concept_hash|
|
95
95
|
lang = localized_concept_hash.dig("data", "language_code").to_s
|
@@ -98,21 +98,24 @@ module Glossarist
|
|
98
98
|
Config.class_for(:localized_concept).of_yaml(localized_concept_hash),
|
99
99
|
)
|
100
100
|
|
101
|
-
|
101
|
+
data.localized_concepts[lang] = localization(lang).uuid
|
102
102
|
|
103
103
|
localized_concept
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
|
+
def localized_concepts
|
109
|
+
data.localized_concepts
|
110
|
+
end
|
108
111
|
|
109
112
|
# Adds concept localization.
|
110
113
|
# @param localized_concept [LocalizedConcept]
|
111
114
|
def add_localization(localized_concept)
|
112
115
|
lang = localized_concept.language_code
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
+
data.localized_concepts ||= {}
|
117
|
+
data.localized_concepts[lang] =
|
118
|
+
data.localized_concepts[lang] || localized_concept.uuid
|
116
119
|
localizations.store(lang, localized_concept)
|
117
120
|
end
|
118
121
|
alias :add_l10n :add_localization
|
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.3.
|
4
|
+
version: 2.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|