labimotion 1.5.0.rc1 → 1.5.0.rc3

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: fb234cedd28a03695520718330ec4b35e7ad7512dce48ccd82919a917f249c52
4
- data.tar.gz: 06c95920f9e0c88705f6c1d3fac27dbc516d57f1025d4798876870cc48a51ddd
3
+ metadata.gz: 4bf785dda2ca949138e3d5f9b5047c3a8696c6171af31b54ee02072f98aa9d58
4
+ data.tar.gz: c90714bacc5941ca475ec8e75f2355ba4e2f5b347f14d49e649e0496799b1ba5
5
5
  SHA512:
6
- metadata.gz: 3c38b52e126ebb661704fcb5bdedcfaa723612e06b7ac5b1a51be30976821dfe5c3ff1cfc0cfd4ab06293d4d7f9706ab442b58674380735bd602ef43fd453dfa
7
- data.tar.gz: cb91684b0d3c8b0b4eb03b43adee712bb16d2a7d402d08fd319e7fbf162dbf7cc2c4438e64429e3fe9d9fc82bbbab703544d924086539628348af0960c58c268
6
+ metadata.gz: cbfb288dc3f358efe920ea49f135208024443e09512f122e7adac44defeafcc3391b4948f9cfea9bfc78fc6597134426bcbc6237733a9101ca69acc264c675f4
7
+ data.tar.gz: 9badebc9b2f3040b1d9c52d4a19bed4a05b7ba03677a044a1451dbf11c647b659a2875b054a2e20412cbcc6d049d568f208148a5312b7996194f74b2f76b89ed
@@ -55,8 +55,8 @@ module Labimotion
55
55
 
56
56
  # list = Labimotion::Vocabulary.all.sort_by { |e| e.name }
57
57
  # present list, with: Labimotion::StdLayer, root: 'klass'
58
- vocabularies = Labimotion::VocabularyHandler.load_all_vocabularies
59
- combined_data = Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
58
+ combined_data = Labimotion::VocabularyHandler.load_all_vocabularies
59
+ # combined_data = Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
60
60
  return { mc: 'ss00', data: combined_data }
61
61
  rescue StandardError => e
62
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['is_vocabulary'] == true}
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['is_vocabulary'] == true && ss['opid'] == 9}
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
- dir_path = Rails.root.join('lib', 'labimotion', 'libs', 'data', 'vocab')
76
- Dir.glob(dir_path.join('*.json')).each do |file_path|
77
- file_content = File.read(file_path)
78
- json_data = JSON.parse(file_content)
79
- merged_data.concat(json_data)
80
- end
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
- # Labimotion::VocabularyEntity.represent(Labimotion::Vocabulary.all.sort_by(&:name), serializable: true)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  ## Labimotion Version
4
4
  module Labimotion
5
- VERSION = '1.5.0.rc1'
5
+ VERSION = '1.5.0.rc3'
6
6
  end
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.rc1
4
+ version: 1.5.0.rc3
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-09-30 00:00:00.000000000 Z
12
+ date: 2024-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails