rdkit_chem 2025.09.3.12 → 2025.09.3.13
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/rdkit_chem/version.rb +1 -1
- data/lib/rdkit_chem.rb +21 -12
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ead3b69c8da6f0fddb3a5fe01f5a8d6b50045831e09b041f3a41c77bd06c592
|
|
4
|
+
data.tar.gz: 6198fa63ccdece161d05392f179a1c25241707680e79ec16e98de72367bc449c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d552f59f51878f3e521d80ce47c82fd8bcb387cf0fff12f5fe07edb5efe55761a9167cbbaf8189de04fc3ecfcb87d389f68ab6f118b2bef675367bdc135ec72
|
|
7
|
+
data.tar.gz: 78ae51ccc565f8d70738184b8138efb80f43f50a4a092ab830232c085c9ec06e524b81de3acf285916e5237ceba6063a2a6c24dcb3f606435df9f84b93ed5bd5
|
data/lib/rdkit_chem/version.rb
CHANGED
data/lib/rdkit_chem.rb
CHANGED
|
@@ -8,22 +8,31 @@ require 'rdkit_chem/version'
|
|
|
8
8
|
|
|
9
9
|
def find_rdkit_native_extension
|
|
10
10
|
ruby_version = "#{RUBY_VERSION.split('.')[0..1].join('.')}.0"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
base_dir = File.expand_path('rdkit_chem', __dir__)
|
|
12
|
+
|
|
13
|
+
# Location 1: Pre-compiled gem - exact Ruby version match
|
|
14
|
+
precompiled_path = File.join(base_dir, ruby_version)
|
|
15
|
+
return precompiled_path if File.directory?(precompiled_path) && has_native_extension?(precompiled_path)
|
|
16
|
+
|
|
17
|
+
# Location 2: Pre-compiled gem - any available Ruby version (fallback)
|
|
18
|
+
# This handles cases where gem was built with different Ruby minor version
|
|
19
|
+
if File.directory?(base_dir)
|
|
20
|
+
Dir.glob(File.join(base_dir, '*.0')).sort.reverse.each do |version_dir|
|
|
21
|
+
return version_dir if has_native_extension?(version_dir)
|
|
22
|
+
end
|
|
16
23
|
end
|
|
17
24
|
|
|
18
|
-
# Location
|
|
25
|
+
# Location 3: Source-compiled gem (legacy rdkit_chem/lib/)
|
|
19
26
|
source_compiled_path = File.expand_path('../rdkit_chem/lib', __dir__)
|
|
20
|
-
if
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
return source_compiled_path if has_native_extension?(source_compiled_path)
|
|
28
|
+
|
|
29
|
+
raise LoadError, 'Cannot find RDKitChem native extension. ' \
|
|
30
|
+
"Searched in:\n - #{precompiled_path}\n - #{base_dir}/*.0\n - #{source_compiled_path}"
|
|
31
|
+
end
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
def has_native_extension?(dir)
|
|
34
|
+
File.exist?(File.join(dir, 'RDKitChem.so')) ||
|
|
35
|
+
File.exist?(File.join(dir, 'RDKitChem.bundle'))
|
|
27
36
|
end
|
|
28
37
|
|
|
29
38
|
native_path = find_rdkit_native_extension
|