labimotion 1.4.0.rc2 → 1.4.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: 6f07e0d77afbb79bc2652b5f7edbc105133f727593a9a9cc236e17762d1b7e15
4
- data.tar.gz: a6d9a86cd6363b5d81f1c141f56ac85974d6622c3cfd06dc21a3184610d5c76b
3
+ metadata.gz: a0e43bc1bdccd36b76e3c357c88b148f6af58a422ac15967b51018ad68cc570c
4
+ data.tar.gz: bf7e9b0ea4e21736bd9a71cca94b32f02c3d2eed96a1188c07a97be3e11a25f4
5
5
  SHA512:
6
- metadata.gz: 68ab2a10825518b8c7b22e0ae47aeb48c867404f857e98957082f952f7d42983bc07c50f62ff0dd71be1e6c9bb4f0843fabecdcf7f9ef40f5ce0d253b12dc4f6
7
- data.tar.gz: c45113c276c4954803005084733c1e4e13315e9888bb0da50663b3d68577badae0cf5278e2bf1ed4d9cc80002366b981dc80563aa40657cbebf892f34b97f8f7
6
+ metadata.gz: b64d866c7f796c327b3a3f37b7ac5883a1e4ce8e604b0280dc3f47ea300ebbfb82251ea2e42ac2315377d24453f4323de13d10a6a6a85bd6fdf1f57671431d24
7
+ data.tar.gz: 90d185c4806b9e9f10ace66612bad2eb1e31d268a517890c01dd1304fcb53c1b42ef2433a2960d0da53e5c910c7fd8b526c6d4057845f394f663fd148d9e0e2b
@@ -23,7 +23,7 @@ module Labimotion
23
23
 
24
24
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_label'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
25
25
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_tip'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
26
- object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el.molecule_svg_file)
26
+ object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el&.molecule_svg_file || 'nosvg')
27
27
  end
28
28
 
29
29
  field_tables = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['type'] == Labimotion::FieldType::TABLE }
@@ -41,7 +41,7 @@ module Labimotion
41
41
  find_mol = Molecule.find_by(id: sub_value[col_id]['value']['el_id'])
42
42
  next unless find_mol.present?
43
43
 
44
- sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_mol.molecule_svg_file)
44
+ sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_mol.molecule_svg_file) if find_mol&.molecule_svg_file&.present?
45
45
  sub_value[col_id]['value']['el_inchikey'] = find_mol.inchikey
46
46
  sub_value[col_id]['value']['el_smiles'] = find_mol.cano_smiles
47
47
  sub_value[col_id]['value']['el_iupac'] = find_mol.iupac_name
@@ -47,7 +47,7 @@ module Labimotion
47
47
  el.short_label
48
48
  end
49
49
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] =
50
- field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el.molecule_svg_file)
50
+ field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el&.molecule_svg_file || 'nosvg')
51
51
  end
52
52
 
53
53
  field_tables = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['type'] == Labimotion::FieldType::TABLE }
@@ -88,7 +88,7 @@ module Labimotion
88
88
 
89
89
  case obj
90
90
  when Labimotion::Prop::MOLECULE
91
- sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file)
91
+ sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file) if find_obj&.molecule_svg_file&.present?
92
92
  sub_value[col_id]['value']['el_inchikey'] = find_obj.inchikey
93
93
  sub_value[col_id]['value']['el_smiles'] = find_obj.cano_smiles
94
94
  sub_value[col_id]['value']['el_iupac'] = find_obj.iupac_name
@@ -20,7 +20,7 @@ module Labimotion
20
20
 
21
21
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_label'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
22
22
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_tip'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
23
- object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el.molecule_svg_file)
23
+ object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el&.molecule_svg_file || 'nosvg')
24
24
  end
25
25
 
26
26
  field_sys_reactions = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['type'] == Labimotion::FieldType::SYS_REACTION }
@@ -69,7 +69,7 @@ module Labimotion
69
69
 
70
70
  case obj
71
71
  when Labimotion::Prop::MOLECULE
72
- sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file)
72
+ sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file) if find_obj&.molecule_svg_file&.present?
73
73
  sub_value[col_id]['value']['el_inchikey'] = find_obj.inchikey
74
74
  sub_value[col_id]['value']['el_smiles'] = find_obj.cano_smiles
75
75
  sub_value[col_id]['value']['el_iupac'] = find_obj.iupac_name
@@ -22,7 +22,7 @@ module Labimotion
22
22
 
23
23
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_label'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
24
24
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_tip'] = el.short_label if field['type'] == Labimotion::FieldType::DRAG_SAMPLE
25
- object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el.molecule_svg_file)
25
+ object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el&.molecule_svg_file || 'nosvg')
26
26
  end
27
27
 
28
28
  field_tables = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['type'] == Labimotion::FieldType::TABLE }
@@ -40,7 +40,7 @@ module Labimotion
40
40
  find_mol = Molecule.find_by(id: sub_value[col_id]['value']['el_id'])
41
41
  next unless find_mol.present?
42
42
 
43
- sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_mol.molecule_svg_file)
43
+ sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_mol.molecule_svg_file) if find_mol&.molecule_svg_file&.present?
44
44
  sub_value[col_id]['value']['el_inchikey'] = find_mol.inchikey
45
45
  sub_value[col_id]['value']['el_smiles'] = find_mol.cano_smiles
46
46
  sub_value[col_id]['value']['el_iupac'] = find_mol.iupac_name
@@ -24,7 +24,7 @@ module Labimotion
24
24
  value['el_id'] = molecule.id
25
25
  value['el_tip'] = "#{molecule.inchikey}@@#{molecule.cano_smiles}"
26
26
  value['el_label'] = molecule.iupac_name
27
- value['el_svg'] = File.join('/images', 'molecules', molecule.molecule_svg_file)
27
+ value['el_svg'] = File.join('/images', 'molecules', molecule&.molecule_svg_file) if molecule&.molecule_svg_file.present?
28
28
  value['el_inchikey'] = molecule.inchikey
29
29
  value['el_smiles'] = molecule.cano_smiles
30
30
  value['el_type'] = 'molecule' if value['el_type'].nil?
@@ -13,7 +13,7 @@ module Labimotion
13
13
 
14
14
  case obj
15
15
  when Labimotion::Prop::MOLECULE
16
- sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file)
16
+ sub_value[col_id]['value']['el_svg'] = File.join('/images', 'molecules', find_obj.molecule_svg_file) if find_obj&.molecule_svg_file&.present?
17
17
  sub_value[col_id]['value']['el_inchikey'] = find_obj.inchikey
18
18
  sub_value[col_id]['value']['el_smiles'] = find_obj.cano_smiles
19
19
  sub_value[col_id]['value']['el_iupac'] = find_obj.iupac_name
@@ -56,7 +56,7 @@ module Labimotion
56
56
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_tip'] = el.short_label if %w[drag_sample].include?(field['type'])
57
57
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_tip'] = "#{el.element_klass&.label}@@#{el.name}" if %w[drag_element].include?(field['type'])
58
58
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['icon_name'] = el.element_klass&.icon_name || '' if %w[drag_element].include?(field['type'])
59
- object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el.molecule_svg_file) if Labimotion::FieldType::DRAG_MS.include?(field['type'])
59
+ object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_svg'] = field['type'] == Labimotion::FieldType::DRAG_SAMPLE ? el.get_svg_path : File.join('/images', 'molecules', el&.molecule_svg_file || 'nosvg') if Labimotion::FieldType::DRAG_MS.include?(field['type'])
60
60
  object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS][idx]['value']['el_decoupled'] = el.decoupled if %w[drag_sample].include?(field['type'])
61
61
  end
62
62
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  ## Labimotion Version
4
4
  module Labimotion
5
- VERSION = '1.4.0.rc2'
5
+ VERSION = '1.4.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.4.0.rc2
4
+ version: 1.4.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-05-29 00:00:00.000000000 Z
12
+ date: 2024-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails