glossarist 2.0.5 → 2.0.6
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 +4 -4
- data/lib/glossarist/concept_manager.rb +28 -2
- data/lib/glossarist/v1_reader.rb +1 -1
- data/lib/glossarist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f22479e4e171b68688f2be4ac4e43826a644d106ecaac478c91d7f05afe19271
|
4
|
+
data.tar.gz: e0bcd25c609656d4ed5eec57b82e10c7a33a56f9a78513c93394bc26dc69abe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34333ae5aeecddb918c973a708b921684ae459b9e4980c4b8718bd49c8283a1ec50a0a74a785791eabb1ed32d4537b665f79607fc0b6b3722dfa861d4b04fa81
|
7
|
+
data.tar.gz: 2f616084f0bbad3643907bff900828590c834e8dbf27bb72e12b248c427afddcbbd52fac67736624dd7712c5f7fcc01163170e9e376ea69b453803c75c149c3a
|
@@ -5,6 +5,7 @@ module Glossarist
|
|
5
5
|
# Path to concepts directory.
|
6
6
|
# @return [String]
|
7
7
|
attr_accessor :path
|
8
|
+
attr_accessor :localized_concepts_path
|
8
9
|
|
9
10
|
# @param path [String]
|
10
11
|
# concepts directory path, either absolute or relative to CWD
|
@@ -60,8 +61,10 @@ module Glossarist
|
|
60
61
|
end
|
61
62
|
|
62
63
|
def save_concept_to_file(concept)
|
64
|
+
@localized_concepts_path ||= "localized_concept"
|
63
65
|
concept_dir = File.join(path, "concept")
|
64
|
-
|
66
|
+
|
67
|
+
localized_concept_dir = File.join(path, @localized_concepts_path)
|
65
68
|
|
66
69
|
Dir.mkdir(concept_dir) unless Dir.exist?(concept_dir)
|
67
70
|
Dir.mkdir(localized_concept_dir) unless Dir.exist?(localized_concept_dir)
|
@@ -86,7 +89,30 @@ module Glossarist
|
|
86
89
|
end
|
87
90
|
|
88
91
|
def localized_concept_path(id)
|
89
|
-
|
92
|
+
localized_concept_possible_dir = {
|
93
|
+
"localized_concept" => File.join(
|
94
|
+
path,
|
95
|
+
"localized_concept",
|
96
|
+
"#{id}.{yaml,yml}",
|
97
|
+
),
|
98
|
+
|
99
|
+
"localized-concept" => File.join(
|
100
|
+
path,
|
101
|
+
"localized-concept",
|
102
|
+
"#{id}.{yaml,yml}",
|
103
|
+
),
|
104
|
+
}
|
105
|
+
|
106
|
+
localized_concept_possible_dir.each do |dir_name, file_path|
|
107
|
+
actual_path = Dir.glob(file_path)&.first
|
108
|
+
|
109
|
+
if actual_path
|
110
|
+
@localized_concepts_path = dir_name
|
111
|
+
return actual_path
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
actual_path
|
90
116
|
end
|
91
117
|
|
92
118
|
def v1_collection?
|
data/lib/glossarist/v1_reader.rb
CHANGED
@@ -9,7 +9,7 @@ module Glossarist
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def load_concept_from_file(filename)
|
12
|
-
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date])
|
12
|
+
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date, Time])
|
13
13
|
Config.class_for(:managed_concept).new(generate_v2_concept_hash(concept_hash))
|
14
14
|
end
|
15
15
|
|
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.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton
|