glossarist 2.0.5 → 2.0.6

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: 32dd0617dca310b2979fc5d2afb81888c7ec39c09da98c2a5d0a34da56d170b3
4
- data.tar.gz: 86be4aa4175439dd7cd85d63673a3db85813fde697733913f819eaa395ad66d5
3
+ metadata.gz: f22479e4e171b68688f2be4ac4e43826a644d106ecaac478c91d7f05afe19271
4
+ data.tar.gz: e0bcd25c609656d4ed5eec57b82e10c7a33a56f9a78513c93394bc26dc69abe5
5
5
  SHA512:
6
- metadata.gz: 3a1a28e3ce040c3b2b2b31ee8f61fe831f5bdacc9c1105c42bde7efe7404238e018509e3805a50a31df34f36d8dd7e73c3d15c7921bd0d65d2fc9463d86cc14a
7
- data.tar.gz: 1dfffaf4e40421827785ec0f6eb288cc1733a7661cf5a9352000eafa127d4fd6427a6033c37b87d8115414ebc0433091c0c94fedd9c867369d87d2893d2f69ed
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
- localized_concept_dir = File.join(path, "localized_concept")
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
- Dir.glob(File.join(path, "localized_concept", "#{id}.{yaml,yml}"))&.first
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?
@@ -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
 
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.0.5"
7
+ VERSION = "2.0.6"
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.5
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-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton