glossarist 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 550f2f9abb0af4adf53b54b99bb00eb40b7bac9b1a3dfb96971a2819f524d0af
4
- data.tar.gz: 58f56b76ae70724248439a06ed2bd45d851cb1e3a135c4e6488efc2c918c7e88
3
+ metadata.gz: 6db3243d2a3dee8ab236ac591b088e291f735880421d586cb7b08881b023c7b4
4
+ data.tar.gz: 4973495641223a4f88cc5c8c83c239c4979d94d77a8986dfaceaf3165ba78a6b
5
5
  SHA512:
6
- metadata.gz: c3d0e053d7da22e44b70ca26bddfc20981cc03d62a13584d17e1f8883cd072f46ec172c46808437e4d73956a2faf4d61adb51b61a486772d52a6e2339030b400
7
- data.tar.gz: 1ea25c4c4ffcc7171cc60e58ba3a4e478d4e0b734037faafcc29790176a1bc72758d79323fa3c5b8365de270f5672a02f4d55c8e5275c0361610f6e2850bfea0
6
+ metadata.gz: b731a9514198432b603978107243ab700657c5738a17a4b7a8db543fb92d4fa9f6db0f8b56c3a75b90e8a371f43d2ba2c70de494a2b393185621ad35e0014496
7
+ data.tar.gz: 852a6dc42b6332816ddbaeb73eefbb21071c685e9965337100f926a53025e892b938141ecb227c43eb662f614a1d459294860dae0745ab025642d4a1c358201a
@@ -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
 
@@ -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
 
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.0.2"
7
+ VERSION = "2.0.3"
8
8
  end
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.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
11
+ date: 2023-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton