glossarist 2.9.2 → 2.10.1
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: 444891250f970481ea0b53319bd26988f47374eecbbbf73a4e7e1ab3af0f8cf6
|
|
4
|
+
data.tar.gz: '074328e959207512be6b9c8fc175c3c343a72242e75ca1ed6d75a1c6792846d8'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79aedba5703e0e807f48304caeb17a1e8d95e716aa7e344260417c1f344f2607ee2c416c6b16c397b1c828e0f57a2250cd76a32bccb5172e781ca7c45df754e1
|
|
7
|
+
data.tar.gz: 7b080759a869d7018c1f2019f972cc3b1d374a5fa278aa97cb1db0bb938c0116ebd0a72f121b58cb9f9c6f785d3d68efd6225bb6e67c2d1013a95b65c598b1e6
|
|
@@ -269,7 +269,11 @@ module Glossarist
|
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
def load_legacy_localizations(managed_concept, lc_index, version = "3")
|
|
272
|
-
l10n_class = version.to_s
|
|
272
|
+
l10n_class = case version.to_s
|
|
273
|
+
when "2" then V2::LocalizedConcept
|
|
274
|
+
when "3" then V3::LocalizedConcept
|
|
275
|
+
else LocalizedConcept
|
|
276
|
+
end
|
|
273
277
|
lc_map = managed_concept.data.localized_concepts || {}
|
|
274
278
|
lc_map.each_value do |uuid|
|
|
275
279
|
lc_file = lc_index[uuid]
|
|
@@ -344,7 +348,7 @@ module Glossarist
|
|
|
344
348
|
end
|
|
345
349
|
|
|
346
350
|
def detect_version(raw)
|
|
347
|
-
if (m = raw.match(/^schema_version:\s*v?(\d)/))
|
|
351
|
+
if (m = raw.match(/^schema_version:\s*['"]?v?(\d)/))
|
|
348
352
|
m[1]
|
|
349
353
|
else
|
|
350
354
|
"2"
|
|
@@ -37,53 +37,6 @@ module Glossarist
|
|
|
37
37
|
map "translations", to: :translations
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def [](key)
|
|
41
|
-
case key
|
|
42
|
-
when "shortname", "id" then shortname
|
|
43
|
-
when "name" then name
|
|
44
|
-
when "description" then description
|
|
45
|
-
when "schema_version" then schema_version
|
|
46
|
-
when "version" then version
|
|
47
|
-
when "owner" then owner
|
|
48
|
-
when "languages" then languages
|
|
49
|
-
when "subregisters" then subregisters
|
|
50
|
-
when "uri_prefix" then uri_prefix
|
|
51
|
-
when "concept_uri_template" then concept_uri_template
|
|
52
|
-
when "homepage" then homepage
|
|
53
|
-
when "repository" then repository
|
|
54
|
-
when "license" then license
|
|
55
|
-
when "tags" then tags
|
|
56
|
-
when "translations" then translations
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def dig(*keys)
|
|
61
|
-
return nil if keys.empty?
|
|
62
|
-
|
|
63
|
-
first = self[keys.first]
|
|
64
|
-
keys.length == 1 ? first : nil
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def to_h
|
|
68
|
-
h = {}
|
|
69
|
-
h["shortname"] = shortname if shortname
|
|
70
|
-
h["name"] = name if name
|
|
71
|
-
h["description"] = description if description
|
|
72
|
-
h["schema_version"] = schema_version if schema_version
|
|
73
|
-
h["version"] = version if version
|
|
74
|
-
h["owner"] = owner if owner
|
|
75
|
-
h["languages"] = languages if languages && !languages.empty?
|
|
76
|
-
h["subregisters"] = subregisters if subregisters && !subregisters.empty?
|
|
77
|
-
h["uri_prefix"] = uri_prefix if uri_prefix
|
|
78
|
-
h["concept_uri_template"] = concept_uri_template if concept_uri_template
|
|
79
|
-
h["homepage"] = homepage if homepage
|
|
80
|
-
h["repository"] = repository if repository
|
|
81
|
-
h["license"] = license if license
|
|
82
|
-
h["tags"] = tags if tags && !tags.empty?
|
|
83
|
-
h["translations"] = translations if translations && !translations.empty?
|
|
84
|
-
h
|
|
85
|
-
end
|
|
86
|
-
|
|
87
40
|
def self.from_file(path)
|
|
88
41
|
return nil unless File.exist?(path)
|
|
89
42
|
|
|
@@ -20,10 +20,17 @@ module Glossarist
|
|
|
20
20
|
.transform_keys(&:to_s)
|
|
21
21
|
.freeze
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
# Maps each Designation subclass to the method that builds its RDF
|
|
24
|
+
# counterpart. Lookup is by exact class — a Designation instance is
|
|
25
|
+
# always exactly one of these classes (the STI pattern in
|
|
26
|
+
# Designation::Base#of_yaml enforces this). Adding a new Designation
|
|
27
|
+
# subclass means adding one entry here, not editing a case/when.
|
|
28
|
+
DESIGNATION_BUILDERS = {
|
|
29
|
+
Designation::Abbreviation => :build_gloss_abbreviation,
|
|
30
|
+
Designation::Expression => :build_gloss_expression,
|
|
31
|
+
Designation::GraphicalSymbol => :build_gloss_graphical_symbol,
|
|
32
|
+
Designation::LetterSymbol => :build_gloss_letter_symbol,
|
|
33
|
+
Designation::Symbol => :build_gloss_symbol,
|
|
27
34
|
}.freeze
|
|
28
35
|
|
|
29
36
|
def self.transform(managed_concept, options = {})
|
|
@@ -165,21 +172,21 @@ module Glossarist
|
|
|
165
172
|
end
|
|
166
173
|
|
|
167
174
|
def designation_instance_for(desig, common_attrs, concept_id, lang, index)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
builder = DESIGNATION_BUILDERS[desig.class] || :build_gloss_expression
|
|
176
|
+
send(builder, desig, common_attrs, concept_id, lang, index)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def build_gloss_graphical_symbol(desig, common_attrs, *_unused)
|
|
180
|
+
Rdf::GlossGraphicalSymbol.new(common_attrs.merge(text: desig.text,
|
|
181
|
+
image: desig.image))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def build_gloss_letter_symbol(desig, common_attrs, *_unused)
|
|
185
|
+
Rdf::GlossLetterSymbol.new(common_attrs.merge(text: desig.text))
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def build_gloss_symbol(_desig, common_attrs, *_unused)
|
|
189
|
+
Rdf::GlossSymbol.new(common_attrs)
|
|
183
190
|
end
|
|
184
191
|
|
|
185
192
|
def designation_common_attrs(desig, concept_id, lang, index)
|
|
@@ -337,7 +344,7 @@ desig_index)
|
|
|
337
344
|
Array(dates).map do |date|
|
|
338
345
|
Rdf::GlossConceptDate.new(
|
|
339
346
|
date_value: date.date&.to_s,
|
|
340
|
-
date_type:
|
|
347
|
+
date_type: "gloss:status/#{date.type}",
|
|
341
348
|
concept_id: concept_id.to_s,
|
|
342
349
|
)
|
|
343
350
|
end
|
|
@@ -51,8 +51,8 @@ module Glossarist
|
|
|
51
51
|
def declared_languages
|
|
52
52
|
@declared_languages ||= begin
|
|
53
53
|
reg = load_register_data
|
|
54
|
-
if reg && reg
|
|
55
|
-
reg
|
|
54
|
+
if reg && reg.languages.is_a?(Array)
|
|
55
|
+
reg.languages
|
|
56
56
|
else
|
|
57
57
|
actual_languages
|
|
58
58
|
end
|
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.
|
|
4
|
+
version: 2.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|