glossarist 2.8.6 → 2.8.7

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: ac9ce2a15558722dfa456e5fd7a02c288fafecfe67da68e75608318580469bef
4
- data.tar.gz: bdc3ca2aacf91db0a77e341cb8ff114a83b7e897b79b96ba6bcef42dab678689
3
+ metadata.gz: b6de74f1a2e3c9d3379f35ccf94a46a0d407149329e27fa95521e40e8a22c883
4
+ data.tar.gz: 2159f19a3d6c355b7bafba1f76d3f673fe3a0813af919479c1835dbcd609dbd7
5
5
  SHA512:
6
- metadata.gz: e1e026ac1b3daf5f3ed111a69198fea632f698767495d21612743f0161cd41e75466de670322178357e475aa60d1b56b994391ff02efa40953b640265b5f4bac
7
- data.tar.gz: f01e0d1928cd86531326b86c4e150814a080b2bf2536cd3804bce4e7c5e9c484dd88cc561ac20526faf73b5b964b25d3b45c72fbb5160b042a1f98bc85b08e29
6
+ metadata.gz: 9c46b4f37c08ce6d40158098c5b39006b319a3dab247660a43aa4ebb82ba7527ee9898ccf1513e960abf56a6987dea8b083d9b11b4cff2306d66e5e0b054af03
7
+ data.tar.gz: 4bb9c91a99347f353bcabb17702d13e295f50323173c8fd25fde164af7ac0ea117d38542b9e03449fd386e253f31cd003832310ce5cc5b3f85e4c34978a33fdd
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-06-08 08:10:16 UTC using RuboCop version 1.86.1.
3
+ # on 2026-06-09 09:29:01 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -11,35 +11,13 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'glossarist.gemspec'
13
13
 
14
- # Offense count: 1
15
- # This cop supports safe autocorrection (--autocorrect).
16
- # Configuration parameters: EnforcedStyle, IndentationWidth.
17
- # SupportedStyles: with_first_argument, with_fixed_indentation
18
- Layout/ArgumentAlignment:
19
- Exclude:
20
- - 'lib/glossarist/designation.rb'
21
-
22
- # Offense count: 1
23
- # This cop supports safe autocorrection (--autocorrect).
24
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
25
- Layout/ExtraSpacing:
26
- Exclude:
27
- - 'lib/glossarist/designation.rb'
28
-
29
- # Offense count: 420
14
+ # Offense count: 419
30
15
  # This cop supports safe autocorrection (--autocorrect).
31
16
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
32
17
  # URISchemes: http, https
33
18
  Layout/LineLength:
34
19
  Enabled: false
35
20
 
36
- # Offense count: 1
37
- # This cop supports safe autocorrection (--autocorrect).
38
- # Configuration parameters: AllowInHeredoc.
39
- Layout/TrailingWhitespace:
40
- Exclude:
41
- - 'lib/glossarist/designation.rb'
42
-
43
21
  # Offense count: 1
44
22
  # Configuration parameters: AllowedMethods.
45
23
  # AllowedMethods: enums
@@ -112,12 +90,6 @@ Style/IdenticalConditionalBranches:
112
90
  Exclude:
113
91
  - 'scripts/migrate_dataset.rb'
114
92
 
115
- # Offense count: 1
116
- # This cop supports unsafe autocorrection (--autocorrect-all).
117
- Style/ReduceToHash:
118
- Exclude:
119
- - 'lib/glossarist/transforms/concept_to_gloss_transform.rb'
120
-
121
93
  # Offense count: 3
122
94
  # Configuration parameters: Max.
123
95
  Style/SafeNavigationChainLength:
@@ -15,6 +15,7 @@ module Glossarist
15
15
  end
16
16
 
17
17
  attribute :ref, Ref
18
+ attribute :text, :string
18
19
  attribute :locality, Locality
19
20
  attribute :link, :string
20
21
  attribute :original, :string
@@ -35,6 +36,10 @@ module Glossarist
35
36
  parts.empty? ? nil : parts.join(" ")
36
37
  end
37
38
 
39
+ def text
40
+ @text || label
41
+ end
42
+
38
43
  def locality_from_yaml(model, value)
39
44
  locality = Locality.new
40
45
 
@@ -98,5 +98,9 @@ module Glossarist
98
98
  end
99
99
  texts
100
100
  end
101
+
102
+ def annotations
103
+ @annotations ||= Collections::DetailedDefinitionCollection.new
104
+ end
101
105
  end
102
106
  end
@@ -50,6 +50,7 @@ module Glossarist
50
50
 
51
51
  def load_concept_from_file(filename) # rubocop:disable Metrics/CyclomaticComplexity
52
52
  raw = File.read(filename, encoding: "utf-8")
53
+ self.version = detect_version(raw)
53
54
  doc = concept_document_class.from_yamls(raw)
54
55
  concept = doc.concept
55
56
  unless concept
@@ -166,6 +167,14 @@ module Glossarist
166
167
  end
167
168
  end
168
169
 
170
+ def detect_version(raw)
171
+ if (m = raw.match(/^schema_version:\s*v?(\d)/))
172
+ m[1]
173
+ else
174
+ version
175
+ end
176
+ end
177
+
169
178
  def v1_collection?
170
179
  @v1_collection ||= !Dir.glob(File.join(path,
171
180
  "concept-*.{yaml,yml}")).empty?
@@ -7,6 +7,8 @@ module Glossarist
7
7
  map :ref, to: :ref, with: { from: :ref_from_yaml, to: :ref_to_yaml }
8
8
  end
9
9
 
10
+ alias_method :text, :label
11
+
10
12
  def ref_from_yaml(model, value)
11
13
  case value
12
14
  when Hash
@@ -17,6 +17,7 @@ module Glossarist
17
17
  with: { from: :domains_from_yaml, to: :domains_to_yaml }
18
18
  map :tags, to: :tags
19
19
  map :sources, to: :sources
20
+ map :related, to: :related
20
21
  map :localizations, to: :localizations,
21
22
  with: { from: :localizations_from_yaml, to: :localizations_to_yaml }
22
23
  end
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.8.6"
7
+ VERSION = "2.8.7"
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.8.6
4
+ version: 2.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-08 00:00:00.000000000 Z
11
+ date: 2026-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model