glossarist 2.0.7 → 2.0.9

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: 9b7d2e4e796d699bcd2a070de356c16c832b0bc7373cb26688acfb8f8ee978ef
4
- data.tar.gz: 957eb00bd6372a5f2f03967c119e65722d80374be6bc5886deef03d2189eed6a
3
+ metadata.gz: b513e776c8273441505b742e4ab559ecf887d994f0242943ac139483b4945749
4
+ data.tar.gz: 3ee9b5ec607d2ca40f7b7b6bec0f05dd2a4dc0c89d1ca44371c2737ff97b9082
5
5
  SHA512:
6
- metadata.gz: 355dc4c998d68cf812144e99a06e9be2a25996bc9070ef62640245a8c3a62f1b6160f768eb890d1320b6e640d8e7de47bc9bc4a70d9d767cdfeaab6e48b02c29
7
- data.tar.gz: e40bc60aba8fa2f4a9232e9eadda853d0bc8894612be3f6bdbf28d6c9cc1503509ad6da9a0663dd83e170c9fcf8bc7a431b9c50d39bd083c90ccaf449a59fc41
6
+ metadata.gz: 2d229ebe8d4a08abe267a13afc67d2eb04b00dfee2e1c2d4c9d6441f7f42d35441effddf48716693778fbcd65095791ee9f1690fc1d064220e74bcabca563807
7
+ data.tar.gz: 85555a89c34a7894b6354fcb3fda79d0170f94c295dc557a0917cdaabcf4e3b4ea80e88812799108b5a3c8117aba9c4256a69a0b901488efca4e2a90302ae937
@@ -74,9 +74,13 @@ module Glossarist
74
74
  end
75
75
 
76
76
  def id=(id)
77
- raise(Glossarist::Error, "Expect id to be a string, Got #{id.class} (#{id})") unless id.is_a?(String) || id.nil?
78
-
79
- @id = id
77
+ # Some of the glossaries that are not generated using glossarist, contains ids that are integers
78
+ # so adding a temporary check until every glossary is updated using glossarist.
79
+ if !id.nil? && (id.is_a?(String) || id.is_a?(Integer))
80
+ @id = id
81
+ else
82
+ raise(Glossarist::Error, "Expect id to be a String or Integer, Got #{id.class} (#{id})")
83
+ end
80
84
  end
81
85
  alias :termid= :id=
82
86
  alias :identifier= :id=
@@ -86,7 +90,6 @@ module Glossarist
86
90
  # removed.
87
91
  # @return [Array<ConceptSource>]
88
92
  attr_reader :sources
89
- alias :authoritative_source :sources
90
93
 
91
94
  # return [Array<ConceptDate>]
92
95
  attr_reader :dates
@@ -128,9 +131,13 @@ module Glossarist
128
131
  sources&.each { |source| @sources << source }
129
132
  end
130
133
 
134
+ def authoritative_source
135
+ @sources.select { |source| source.authoritative? }
136
+ end
137
+
131
138
  def authoritative_source=(sources)
132
- self.sources = sources&.map do |source|
133
- source.merge({ "type" => "authoritative" })
139
+ sources&.each do |source|
140
+ @sources << source.merge({ "type" => "authoritative" })
134
141
  end
135
142
  end
136
143
 
@@ -201,6 +208,7 @@ module Glossarist
201
208
  data = arg.delete("data")
202
209
 
203
210
  arg.merge!(data) if data
211
+ arg.delete("authoritative_source") if arg["sources"]
204
212
  end
205
213
  end
206
214
  end
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.0.7"
7
+ VERSION = "2.0.9"
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.7
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-18 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton