labimotion 1.5.0.rc2 → 1.5.0.rc4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3afb085685be0c64eb0eca90f28704e5f5305c41cb61c2f6b8a3bd13b5e2c452
|
4
|
+
data.tar.gz: 0caa5656084de5a97b354cb1f7f10f8ffc016f326feb99b207d5f5a6c6453874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a9d39347435dcbc76a8a400e22bd5d7cd45278ca83c9bf32ff690bca3bed7d714c2f5d8dcab0859f062b14bc5cfbb81e73d097c25829a622ed1f16597164f12
|
7
|
+
data.tar.gz: b6b346ea8463d6a0a5e70d17a7797ae8db50b25d810e0c37a0de497ce00ff0a725da23490dd7aae9ef709182d0da9497a36ff946d35cfacbfcf2f5878aa93e63
|
@@ -48,16 +48,15 @@ module Labimotion
|
|
48
48
|
get do
|
49
49
|
# merged_data = []
|
50
50
|
# Dir.glob(Rails.public_path.join('generic', 'vocabularies', '*.json')).each do |file_path|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
merged_data.concat(json_data)
|
56
|
-
end
|
51
|
+
# file_content = File.read(file_path)
|
52
|
+
# json_data = JSON.parse(file_content)
|
53
|
+
# merged_data.concat(json_data)
|
54
|
+
# end
|
57
55
|
|
58
|
-
list = Labimotion::Vocabulary.all.sort_by { |e| e.name }
|
59
|
-
|
60
|
-
combined_data =
|
56
|
+
# list = Labimotion::Vocabulary.all.sort_by { |e| e.name }
|
57
|
+
# present list, with: Labimotion::StdLayer, root: 'klass'
|
58
|
+
combined_data = Labimotion::VocabularyHandler.load_all_vocabularies
|
59
|
+
# combined_data = Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
|
61
60
|
return { mc: 'ss00', data: combined_data }
|
62
61
|
rescue StandardError => e
|
63
62
|
Labimotion.log_exception(e, current_user)
|
@@ -9,7 +9,7 @@ module Labimotion
|
|
9
9
|
(object&.properties.is_a?(Hash) && object.properties[Labimotion::Prop::LAYERS]&.keys || []).each do |key|
|
10
10
|
# layer = object.properties[key]
|
11
11
|
|
12
|
-
# field_vocabularies = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['
|
12
|
+
# field_vocabularies = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['is_voc'] == true}
|
13
13
|
# field_vocabularies.each do |field|
|
14
14
|
# idx = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].index(field)
|
15
15
|
# if field['identifier'] == '7c30cd4f-aef4-433a-946e-d0f81f8918f1'
|
@@ -6,7 +6,7 @@ module Labimotion
|
|
6
6
|
def self.update_vocabularies(properties, current_user, element)
|
7
7
|
properties[Labimotion::Prop::LAYERS].keys.each do |key|
|
8
8
|
layer = properties[Labimotion::Prop::LAYERS][key]
|
9
|
-
field_vocabularies = layer[Labimotion::Prop::FIELDS].select { |ss| ss['
|
9
|
+
field_vocabularies = layer[Labimotion::Prop::FIELDS].select { |ss| ss['is_voc'] == true && ss['opid'] == 9}
|
10
10
|
field_vocabularies.each do |field|
|
11
11
|
idx = properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].index(field)
|
12
12
|
val = ''
|
@@ -72,18 +72,23 @@ module Labimotion
|
|
72
72
|
|
73
73
|
def self.load_from_files
|
74
74
|
merged_data = []
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
# byebug
|
76
|
+
sys_json = File.join(__dir__, 'data', 'vocab', 'System.json')
|
77
|
+
# byebug
|
78
|
+
file_content = File.read(sys_json)
|
79
|
+
json_data = JSON.parse(file_content)
|
80
|
+
merged_data.concat(json_data)
|
81
|
+
|
82
|
+
std_json = File.join(__dir__, 'data', 'vocab', 'Standard.json')
|
83
|
+
file_content = File.read(std_json)
|
84
|
+
json_data = JSON.parse(file_content)
|
85
|
+
merged_data.concat(json_data)
|
81
86
|
merged_data
|
82
87
|
end
|
83
88
|
|
84
89
|
def self.load_from_database
|
85
|
-
Labimotion::Vocabulary.all.sort_by(&:name)
|
86
|
-
|
90
|
+
vocabularies = Labimotion::Vocabulary.all.sort_by(&:name)
|
91
|
+
Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
|
87
92
|
end
|
88
93
|
|
89
94
|
private_class_method :load_from_files, :load_from_database
|
data/lib/labimotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labimotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.
|
4
|
+
version: 1.5.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chia-Lin Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-10-
|
12
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|