glossarist 2.6.9 → 2.8.0

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: 3795091506d72a808355270feba237f8daf8f9d21b32ff97fb84942641ec1836
4
- data.tar.gz: bd2779483c782edb05046d386f2591cd3555cd95dcedd1a239e47cff8ea236cf
3
+ metadata.gz: c8c40cbee20f8b32a07768e3a18f5424d47200fbf1881d37563403399e94dac8
4
+ data.tar.gz: ff491ad1c74576a7ee743dc77fbb143dc4c71e690f1d13a57c2601d98da6289f
5
5
  SHA512:
6
- metadata.gz: e3265eccbe271d756ef246968fa03bccaae9063e547de774faab0b4fd61b8ca371dbfcbe4b520d099ab54e04ed5ccf9e89e2ebb4114cd3967b81d74664242cf1
7
- data.tar.gz: 6e0f5ba16d874c2df69e1a1f8f66c52e722d16f8c9e601bb0eb7b0e5704d8e3f515d391e4d564e6b5167bc4cb856810adb5c2bf9a7a2b40d202a0f3101ed502b
6
+ metadata.gz: 1c6688d6e709e85dfaf7316306e37f743b5eb093e248ba6a189077c55e7274fb6405a38b94e49c32bb12ab3f7f51c31546e170fc88cdb5ad774f7fe9fae7e975
7
+ data.tar.gz: 6e031043ea2dc45971cb29858c8be4d11110a8751680e3041f8d5593f4ccc1992660a5d41981026fabd86c68b10847f0f7df611cf61ae33eb416f5c99136456c
@@ -15,13 +15,21 @@ module Glossarist
15
15
  result = ValidationResult.new
16
16
  context = Validation::Rules::DatasetContext.new(@path)
17
17
  concept_rules = Validation::Rules::Registry.for_scope(:concept)
18
- total = ConceptCollector.count(@path)
19
- file_idx = 0
20
18
 
21
- ConceptCollector.each_concept(@path) do |concept|
22
- context.add_concept(concept)
19
+ all_concepts = ConceptCollector.collect(@path)
20
+ total = all_concepts.length
23
21
 
24
- fname = concept_file_name(concept, file_idx)
22
+ if total.zero?
23
+ yaml_files = find_yaml_files
24
+ if yaml_files.any?
25
+ result.add_error("YAML files found but no parseable concepts")
26
+ end
27
+ end
28
+
29
+ all_concepts.each { |c| context.add_concept(c) }
30
+
31
+ all_concepts.each_with_index do |concept, idx|
32
+ fname = concept_file_name(concept, idx)
25
33
  concept_context = Validation::Rules::ConceptContext.new(
26
34
  concept, file_name: fname, collection_context: context
27
35
  )
@@ -32,15 +40,7 @@ module Glossarist
32
40
  rule.check(concept_context).each { |i| result.add_issue(i) }
33
41
  end
34
42
 
35
- file_idx += 1
36
- @on_progress&.call(file_idx, total)
37
- end
38
-
39
- if file_idx.zero?
40
- yaml_files = find_yaml_files
41
- if yaml_files.any?
42
- result.add_error("YAML files found but no parseable concepts")
43
- end
43
+ @on_progress&.call(idx + 1, total)
44
44
  end
45
45
 
46
46
  # Run collection-level rules
@@ -28,9 +28,14 @@ module Glossarist
28
28
  end
29
29
 
30
30
  def self.build_from_directory(dataset_path)
31
+ concepts = ConceptCollector.collect(dataset_path)
32
+ build_from_concepts(concepts, dataset_path)
33
+ end
34
+
35
+ def self.build_from_concepts(concepts, dataset_path)
31
36
  index = new
32
37
  index_image_files(index, dataset_path)
33
- index_model_assets(index, dataset_path)
38
+ index_concept_assets(index, concepts)
34
39
  index
35
40
  end
36
41
 
@@ -63,11 +68,6 @@ module Glossarist
63
68
  end
64
69
  end
65
70
 
66
- def index_model_assets(index, dataset_path)
67
- concepts = ConceptCollector.collect(dataset_path)
68
- index_concept_assets(index, concepts)
69
- end
70
-
71
71
  def index_zip_images(index, zip_path)
72
72
  Zip::File.open(zip_path) do |zf|
73
73
  zf.entries.each do |entry|
@@ -38,7 +38,7 @@ module Glossarist
38
38
  end
39
39
 
40
40
  def asset_index
41
- @asset_index ||= AssetIndex.build_from_directory(@path)
41
+ @asset_index ||= AssetIndex.build_from_concepts(concepts, @path)
42
42
  end
43
43
 
44
44
  def declared_languages
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.6.9"
7
+ VERSION = "2.8.0"
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.6.9
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-25 00:00:00.000000000 Z
11
+ date: 2026-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model